##// END OF EJS Templates
convert: allow customizing git remote prefix...
Durham Goode -
r25787:d9133e89 default
parent child Browse files
Show More
@@ -309,6 +309,10 b' def convert(ui, src, dest=None, revmapfi'
309 is very expensive for large projects, and is only effective when
309 is very expensive for large projects, and is only effective when
310 ``convert.git.similarity`` is greater than 0. The default is False.
310 ``convert.git.similarity`` is greater than 0. The default is False.
311
311
312 :convert.git.remoteprefix: remote refs are converted as bookmarks with
313 ``convert.git.remoteprefix`` as a prefix followed by a /. The default
314 is 'remote'.
315
312 Perforce Source
316 Perforce Source
313 ###############
317 ###############
314
318
@@ -376,7 +376,8 b' class convert_git(converter_source):'
376 prefixlen = len(prefix)
376 prefixlen = len(prefix)
377
377
378 # factor two commands
378 # factor two commands
379 gitcmd = { 'remote/': 'git ls-remote --heads origin',
379 remoteprefix = self.ui.config('convert', 'git.remoteprefix', 'remote')
380 gitcmd = { remoteprefix + '/': 'git ls-remote --heads origin',
380 '': 'git show-ref'}
381 '': 'git show-ref'}
381
382
382 # Origin heads
383 # Origin heads
@@ -642,6 +642,30 b' submodules)'
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:
@@ -259,6 +259,10 b''
259 for large projects, and is only effective when
259 for large projects, and is only effective when
260 "convert.git.similarity" is greater than 0. The default is
260 "convert.git.similarity" is greater than 0. The default is
261 False.
261 False.
262 convert.git.remoteprefix
263 remote refs are converted as bookmarks with
264 "convert.git.remoteprefix" as a prefix followed by a /. The
265 default is 'remote'.
262
266
263 Perforce Source
267 Perforce Source
264 ###############
268 ###############
General Comments 0
You need to be logged in to leave comments. Login now