Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
30645:a3f335d1247c | 30646:ea3540e66fd8 |
---|---|
372 > --config convert.git.findcopiesharder=1 --datesort git-repo2 fullrepo | 372 > --config convert.git.findcopiesharder=1 --datesort git-repo2 fullrepo |
373 $ hg -R fullrepo status -C --change master | 373 $ hg -R fullrepo status -C --change master |
374 A bar-copied2 | 374 A bar-copied2 |
375 bar | 375 bar |
376 | 376 |
377 renamelimit config option works | |
378 | |
379 $ cd git-repo2 | |
380 $ cp bar bar-copy0 | |
381 $ echo 0 >> bar-copy0 | |
382 $ cp bar bar-copy1 | |
383 $ echo 1 >> bar-copy1 | |
384 $ git add bar-copy0 bar-copy1 | |
385 $ commit -a -m 'copy bar 2 times' | |
386 $ cd .. | |
387 | |
388 $ hg -q convert --config convert.git.renamelimit=1 \ | |
389 > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo2 | |
390 $ hg -R fullrepo2 status -C --change master | |
391 A bar-copy0 | |
392 A bar-copy1 | |
393 | |
394 $ hg -q convert --config convert.git.renamelimit=100 \ | |
395 > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo3 | |
396 $ hg -R fullrepo3 status -C --change master | |
397 A bar-copy0 | |
398 bar | |
399 A bar-copy1 | |
400 bar | |
401 | |
377 test binary conversion (issue1359) | 402 test binary conversion (issue1359) |
378 | 403 |
379 $ count=19 | 404 $ count=19 |
380 $ mkdir git-repo3 | 405 $ mkdir git-repo3 |
381 $ cd git-repo3 | 406 $ cd git-repo3 |