Skip to content
Snippets Groups Projects
Commit 6866ae46 authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

git_handler.import_git_commit: figure out when to detect renames

get_files_changed doesn't do anything with this yet, but it will in upcoming
patches.
parent c24d2ea1
No related branches found
No related tags found
No related merge requests found
......@@ -683,7 +683,8 @@
def import_git_commit(self, commit):
self.ui.debug(_("importing: %s\n") % commit.id)
detect_renames = False
(strip_message, hg_renames,
hg_branch, extra) = git2hg.extract_hg_metadata(
commit.message, commit.extra)
if hg_renames is None:
......@@ -686,8 +687,9 @@
(strip_message, hg_renames,
hg_branch, extra) = git2hg.extract_hg_metadata(
commit.message, commit.extra)
if hg_renames is None:
# don't do any rename detection for now
detect_renames = True
# empty dictionary so that code below continues to work
renames = {}
else:
renames = hg_renames
......@@ -700,7 +702,7 @@
'please run hg git-cleanup'))
# get a list of the changed, added, removed files and gitlinks
files, gitlinks = self.get_files_changed(commit)
files, gitlinks = self.get_files_changed(commit, detect_renames)
git_commit_tree = self.git[commit.tree]
......@@ -1287,7 +1289,7 @@
elif isinstance(obj, Tree):
otree = obj
def get_files_changed(self, commit):
def get_files_changed(self, commit, detect_renames):
tree = commit.tree
btree = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment