Mercurial > public > mercurial-scm > hg
diff hgext/convert/git.py @ 22512:6b6da715cb96
convert: change default for git rename detection to 50%
This default mirrors the default for 'git diff'. Other commands have slightly
different defaults -- for example, the move/copy detection for 'git blame'
assumes that a hunk is moved if more than 40 alphanumeric characters are the
same, or copied if more than 20 alphanumeric characters are the same. 50% seems
to be the most common default, though.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 23 Sep 2014 14:45:23 -0700 |
parents | b1ec65b3ba31 |
children | a7f25a31e021 |
line wrap: on
line diff
--- a/hgext/convert/git.py Tue Sep 23 14:40:32 2014 -0700 +++ b/hgext/convert/git.py Tue Sep 23 14:45:23 2014 -0700 @@ -94,7 +94,8 @@ if not os.path.exists(path + "/objects"): raise NoRepo(_("%s does not look like a Git repository") % path) - similarity = ui.configint('convert', 'git.similarity', default=0) + # The default value (50) is based on the default for 'git diff'. + similarity = ui.configint('convert', 'git.similarity', default=50) if similarity < 0 or similarity > 100: raise util.Abort(_('similarity must be between 0 and 100')) if similarity > 0: