Mercurial > hg > hg-git
diff hggit/git_handler.py @ 839:f6f84d51a154
git_handler.get_files_changed: switch to diff_tree's tree_changes
object_store.tree_changes doesn't allow us to specify a rename detector, but
diff_tree's tree_changes does.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 01 Dec 2014 23:25:25 -0800 (2014-12-02) |
parents | 6866ae460ee7 |
children | 83a0e6c0e82c |
line wrap: on
line diff
--- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -7,6 +7,7 @@ from dulwich.repo import Repo, check_ref_format from dulwich import client from dulwich import config as dul_config +from dulwich import diff_tree try: from mercurial import bookmarks @@ -1296,10 +1297,12 @@ if commit.parents: btree = self.git[commit.parents[0]].tree - changes = self.git.object_store.tree_changes(btree, tree) + changes = diff_tree.tree_changes(self.git.object_store, btree, tree) files = {} gitlinks = {} - for (oldfile, newfile), (oldmode, newmode), (oldsha, newsha) in changes: + for change in changes: + oldfile, oldmode, oldsha = change.old + newfile, newmode, newsha = change.new # actions are described by the following table ('no' means 'does not # exist'): # old new | action