comparison tests/test-convert-git.t @ 25749:f2748cc43b2a

convert: support multiple specifed revs in git source This allows specifying multiple revs/branches to convert from a git repo.
author Durham Goode <durham@fb.com>
date Wed, 08 Jul 2015 10:29:11 -0700
parents eb15c5be381c
children d9133e89d39d
comparison
equal deleted inserted replaced
25748:baea47cafe75 25749:f2748cc43b2a
440 $ hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg 440 $ hg convert --sourcesort git-repo4 git-repo4-sourcesort-hg
441 initializing destination git-repo4-sourcesort-hg repository 441 initializing destination git-repo4-sourcesort-hg repository
442 abort: --sourcesort is not supported by this data source 442 abort: --sourcesort is not supported by this data source
443 [255] 443 [255]
444 444
445 test converting certain branches
446
447 $ mkdir git-testrevs
448 $ cd git-testrevs
449 $ git init
450 Initialized empty Git repository in $TESTTMP/git-testrevs/.git/
451 $ echo a >> a ; git add a > /dev/null; git commit -m 'first' > /dev/null
452 $ echo a >> a ; git add a > /dev/null; git commit -m 'master commit' > /dev/null
453 $ git checkout -b goodbranch 'HEAD^'
454 Switched to a new branch 'goodbranch'
455 $ echo a >> b ; git add b > /dev/null; git commit -m 'good branch commit' > /dev/null
456 $ git checkout -b badbranch 'HEAD^'
457 Switched to a new branch 'badbranch'
458 $ echo a >> c ; git add c > /dev/null; git commit -m 'bad branch commit' > /dev/null
459 $ cd ..
460 $ hg convert git-testrevs hg-testrevs --rev master --rev goodbranch
461 initializing destination hg-testrevs repository
462 scanning source...
463 sorting...
464 converting...
465 2 first
466 1 good branch commit
467 0 master commit
468 updating bookmarks
469 $ cd hg-testrevs
470 $ hg log -G -T '{rev} {bookmarks}'
471 o 2 master
472 |
473 | o 1 goodbranch
474 |/
475 o 0
476
477 $ cd ..
478
445 test sub modules 479 test sub modules
446 480
447 $ mkdir git-repo5 481 $ mkdir git-repo5
448 $ cd git-repo5 482 $ cd git-repo5
449 $ git init-db >/dev/null 2>/dev/null 483 $ git init-db >/dev/null 2>/dev/null