Mercurial > public > mercurial-scm > hg
diff hgext/convert/git.py @ 30646:ea3540e66fd8
convert: config option for git rename limit
By default, Git applies rename and copy detection to 400 files. The
diff.renamelimit config option and -l argument to diff commands can
override this.
As part of converting some repositories in the wild, I was hitting
the default limit. Unfortunately, the warnings that Git prints in this
scenario are swallowed because the process running functionality in
common.py redirects stderr to /dev/null by default. This seems like
a bug, but a bug for another day.
This commit establishes a config option to send the rename limit
through to `git diff-tree`. The added tests demonstrate a too-low
rename limit doesn't result in copy metadata being recorded.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 18 Dec 2016 12:53:20 -0800 |
parents | a0939666b836 |
children | 1f21a6835604 |
line wrap: on
line diff
--- a/hgext/convert/git.py Thu Dec 22 01:09:45 2016 +0900 +++ b/hgext/convert/git.py Sun Dec 18 12:53:20 2016 -0800 @@ -78,6 +78,10 @@ False) if findcopiesharder: self.simopt.append('--find-copies-harder') + + renamelimit = ui.configint('convert', 'git.renamelimit', + default=400) + self.simopt.append('-l%d' % renamelimit) else: self.simopt = []