diff 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
line wrap: on
line diff
--- a/tests/test-convert-git.t	Sun Jul 12 17:59:25 2015 +0900
+++ b/tests/test-convert-git.t	Mon Jul 13 21:37:46 2015 -0700
@@ -642,6 +642,30 @@
   $ hg -R git-repo6-hg tip -T "{file_dels}\n"
   .hgsub .hgsubstate
 
+convert using a different remote prefix
+  $ git init git-repo7
+  Initialized empty Git repository in $TESTTMP/git-repo7/.git/
+  $ cd git-repo7
+  $ touch a && git add a && git commit -am "commit a"
+  [master (root-commit) 8ae5f69] commit a
+   Author: nottest <test@example.org>
+   1 file changed, 0 insertions(+), 0 deletions(-)
+   create mode 100644 a
+  $ cd ..
+  $ git clone git-repo7 git-repo7-client
+  Cloning into 'git-repo7-client'...
+  done.
+  $ hg convert --config convert.git.remoteprefix=origin git-repo7-client hg-repo7
+  initializing destination hg-repo7 repository
+  scanning source...
+  sorting...
+  converting...
+  0 commit a
+  updating bookmarks
+  $ hg -R hg-repo7 bookmarks
+     master                    0:03bf38caa4c6
+     origin/master             0:03bf38caa4c6
+
 damaged git repository tests:
 In case the hard-coded hashes change, the following commands can be used to
 list the hashes and their corresponding types in the repository: