diff tests/test-convert-git.t @ 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 a56296f55a5e
children 73b1a209b5b8
line wrap: on
line diff
--- a/tests/test-convert-git.t	Thu Dec 22 01:09:45 2016 +0900
+++ b/tests/test-convert-git.t	Sun Dec 18 12:53:20 2016 -0800
@@ -374,6 +374,31 @@
   A bar-copied2
     bar
 
+renamelimit config option works
+
+  $ cd git-repo2
+  $ cp bar bar-copy0
+  $ echo 0 >> bar-copy0
+  $ cp bar bar-copy1
+  $ echo 1 >> bar-copy1
+  $ git add bar-copy0 bar-copy1
+  $ commit -a -m 'copy bar 2 times'
+  $ cd ..
+
+  $ hg -q convert --config convert.git.renamelimit=1 \
+  > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo2
+  $ hg -R fullrepo2 status -C --change master
+  A bar-copy0
+  A bar-copy1
+
+  $ hg -q convert --config convert.git.renamelimit=100 \
+  > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo3
+  $ hg -R fullrepo3 status -C --change master
+  A bar-copy0
+    bar
+  A bar-copy1
+    bar
+
 test binary conversion (issue1359)
 
   $ count=19