# HG changeset patch # User Scott Chacon # Date 1241913157 25200 # Node ID 6305f274fc63850dd07587b7a27aa5f771bdb69e # Parent 91ad344df42f88e2be39f3c972171e58bf77707e fixed subtree issue and zero padding issue diff -r 91ad344df42f -r 6305f274fc63 TODO.txt --- a/TODO.txt Sat May 09 15:36:53 2009 -0700 +++ b/TODO.txt Sat May 09 16:52:37 2009 -0700 @@ -28,6 +28,7 @@ Created in Git: * encoding field / utf-8 +* respect modes on tree write * octopus merge explode/implode WEBSITE diff -r 91ad344df42f -r 6305f274fc63 dulwich/objects.py --- a/dulwich/objects.py Sat May 09 15:36:53 2009 -0700 +++ b/dulwich/objects.py Sat May 09 16:52:37 2009 -0700 @@ -429,6 +429,7 @@ self._needs_serialization = True def entry(self, name): + self._ensure_parsed() try: return self._entries[name] except: diff -r 91ad344df42f -r 6305f274fc63 dulwich/repo.py --- a/dulwich/repo.py Sat May 09 15:36:53 2009 -0700 +++ b/dulwich/repo.py Sat May 09 16:52:37 2009 -0700 @@ -374,7 +374,7 @@ rawsha = hex_to_sha(entry[2]) if entry[0] == 'tree': tree_name = entry[1][0:-1] - tree_data += "%s %s\0%s" % ('040000', tree_name, rawsha) + tree_data += "%s %s\0%s" % ('40000', tree_name, rawsha) if entry[0] == 'blob': # TODO : respect the modes tree_data += "%s %s\0%s" % ('100644', entry[1], rawsha) diff -r 91ad344df42f -r 6305f274fc63 git_handler.py --- a/git_handler.py Sat May 09 15:36:53 2009 -0700 +++ b/git_handler.py Sat May 09 16:52:37 2009 -0700 @@ -294,7 +294,7 @@ dirs.sort(lambda a, b: len(b.split('/'))-len(a.split('/'))) dirs.remove('/') dirs.append('/') - + # write all the trees tree_sha = None tree_shas = {} @@ -308,6 +308,7 @@ tree_data.append(entry) tree_sha = self.git.write_tree_array(tree_data) # writing new trees to git tree_shas[dirnm] = tree_sha + return (tree_sha, renames) # should be the last root tree sha def remote_head(self, remote_name): @@ -514,7 +515,7 @@ try: (mode, sha, data) = self.git.get_file(commit, f) e = self.convert_git_int_mode(mode) - except TypeError, KeyError: + except TypeError: raise IOError() if f in hg_renames: copied_path = hg_renames[f] @@ -557,7 +558,7 @@ if hg_branch: extra['branch'] = hg_branch - + text = strip_message date = datetime.datetime.fromtimestamp(commit.author_time).strftime("%Y-%m-%d %H:%M:%S") ctx = context.memctx(self.repo, (p1, p2), text, files, getfilectx,