contrib/convert-repo
changeset 3948 b58c1681d23b
parent 3947 0fab73b3f453
child 3954 fad134931327
equal deleted inserted replaced
3947:0fab73b3f453 3948:b58c1681d23b
     1 #!/usr/bin/env python
     1 #!/usr/bin/env python
     2 #
     2 #
     3 # This is a generalized framework for converting between SCM
     3 # This is a generalized framework for converting between SCM
     4 # repository formats.
     4 # repository formats.
     5 #
     5 #
     6 # In its current form, it's hardcoded to convert incrementally between
       
     7 # git and Mercurial.
       
     8 #
       
     9 # To use, run:
     6 # To use, run:
    10 #
     7 #
    11 # convert-repo <git-dir> <hg-dir> <mapfile>
     8 # convert-repo <source> [<dest> [<mapfile>]]
    12 #
     9 #
    13 # (don't forget to create the <hg-dir> repository beforehand)
    10 # Currently accepted source formats: git
    14 #
    11 # Currently accepted destination formats: hg
    15 # The <mapfile> is a simple text file that maps a git commit hash to
    12 #
    16 # the hash in Mercurial for that version, like so:
    13 # If destination isn't given, a new Mercurial repo named <src>-hg will
    17 #
    14 # be created. If <mapfile> isn't given, it will be put in a default
    18 # <git hash> <mercurial hash>
    15 # location (<dest>/.hg/shamap by default)
       
    16 #
       
    17 # The <mapfile> is a simple text file that maps each source commit ID to
       
    18 # the destination ID for that revision, like so:
       
    19 #
       
    20 # <source ID> <destination ID>
    19 #
    21 #
    20 # If the file doesn't exist, it's automatically created.  It's updated
    22 # If the file doesn't exist, it's automatically created.  It's updated
    21 # on each commit copied, so convert-repo can be interrupted and can
    23 # on each commit copied, so convert-repo can be interrupted and can
    22 # be run repeatedly to copy new commits.
    24 # be run repeatedly to copy new commits.
    23 
    25