comparison tests/test-convert-git.t @ 25787:d9133e89d39d

convert: allow customizing git remote prefix Previously all git remotes were created as "remote/foo". This patch adds a configuration option for deciding what the prefix should be. This is useful if you want the bookmarks to be "origin/foo" like they are in git, or if you're integrating with the remotenames extension and don't want the local remote/foo bookmarks to overlap with the remote foo bookmarks.
author Durham Goode <durham@fb.com>
date Mon, 13 Jul 2015 21:37:46 -0700
parents f2748cc43b2a
children 80149d0b6842 d4e1e947444b
comparison
equal deleted inserted replaced
25786:35fa7c77c754 25787:d9133e89d39d
640 $ hg -R git-repo6-hg tip -T "{desc|firstline}\n" 640 $ hg -R git-repo6-hg tip -T "{desc|firstline}\n"
641 remove .gitmodules and submodule git-repo5 641 remove .gitmodules and submodule git-repo5
642 $ hg -R git-repo6-hg tip -T "{file_dels}\n" 642 $ hg -R git-repo6-hg tip -T "{file_dels}\n"
643 .hgsub .hgsubstate 643 .hgsub .hgsubstate
644 644
645 convert using a different remote prefix
646 $ git init git-repo7
647 Initialized empty Git repository in $TESTTMP/git-repo7/.git/
648 $ cd git-repo7
649 $ touch a && git add a && git commit -am "commit a"
650 [master (root-commit) 8ae5f69] commit a
651 Author: nottest <test@example.org>
652 1 file changed, 0 insertions(+), 0 deletions(-)
653 create mode 100644 a
654 $ cd ..
655 $ git clone git-repo7 git-repo7-client
656 Cloning into 'git-repo7-client'...
657 done.
658 $ hg convert --config convert.git.remoteprefix=origin git-repo7-client hg-repo7
659 initializing destination hg-repo7 repository
660 scanning source...
661 sorting...
662 converting...
663 0 commit a
664 updating bookmarks
665 $ hg -R hg-repo7 bookmarks
666 master 0:03bf38caa4c6
667 origin/master 0:03bf38caa4c6
668
645 damaged git repository tests: 669 damaged git repository tests:
646 In case the hard-coded hashes change, the following commands can be used to 670 In case the hard-coded hashes change, the following commands can be used to
647 list the hashes and their corresponding types in the repository: 671 list the hashes and their corresponding types in the repository:
648 cd git-repo4/.git/objects 672 cd git-repo4/.git/objects
649 find . -type f | cut -c 3- | sed 's_/__' | xargs -n 1 -t git cat-file -t 673 find . -type f | cut -c 3- | sed 's_/__' | xargs -n 1 -t git cat-file -t