Mercurial > hg-git
diff git_handler.py @ 8:2548735d24ef
will now more or less correctly determine a changelist from a git commit
author | Scott Chacon <schacon@gmail.com> |
---|---|
date | Sat, 25 Apr 2009 16:57:11 -0700 |
parents | 89992b6d2eef |
children | 7e776864b301 |
line wrap: on
line diff
--- a/git_handler.py Fri Apr 24 14:05:50 2009 -0700 +++ b/git_handler.py Sat Apr 25 16:57:11 2009 -0700 @@ -81,19 +81,18 @@ # import each of the commits, oldest first for commit in convert_list: - print "commit: %s" % sha self.import_git_commit(commit) # TODO : update Hg bookmarks (possibly named heads?) print bookmarks.parse(self.repo) def import_git_commit(self, commit): - print commit.parents - + print "importing: " + commit.id + # TODO : have to handle merge contexts at some point (two parent files, etc) def getfilectx(repo, memctx, f): - data = commit.getfile(f) - e = commit.getmode(f) + (e, sha, data) = self.git.get_file(commit, f) + e = '' # TODO : make this a real mode return context.memfilectx(f, data, 'l' in e, 'x' in e, None) p1 = "0" * 40 @@ -109,7 +108,9 @@ # TODO : map extra parents to the extras file pass - files = commit.getfiles() + files = self.git.get_files_changed(commit) + + print files # get a list of the changed, added, removed files extra = {}