tests/test-convert-tagsbranch-topology.t
changeset 12534 3ee3d7634e94
parent 9431 d1b135f2f415
child 13756 6b7077df4aa5
equal deleted inserted replaced
12533:068449e515e2 12534:3ee3d7634e94
       
     1 
       
     2   $ "$TESTDIR/hghave" git || exit 80
       
     3   $ echo "[extensions]" >> $HGRCPATH
       
     4   $ echo "convert=" >> $HGRCPATH
       
     5   $ echo 'hgext.graphlog =' >> $HGRCPATH
       
     6   $ echo '[convert]' >> $HGRCPATH
       
     7   $ echo 'hg.usebranchnames = True' >> $HGRCPATH
       
     8   $ echo 'hg.tagsbranch = tags-update' >> $HGRCPATH
       
     9   $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
       
    10   $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
       
    11   $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
       
    12   $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
       
    13   $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
       
    14   $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
       
    15   $ count=10
       
    16   $ action()
       
    17   > {
       
    18   >     GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"
       
    19   >     GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
       
    20   >     git "$@" >/dev/null 2>/dev/null || echo "git command error"
       
    21   >     count=`expr $count + 1`
       
    22   > }
       
    23   $ glog()
       
    24   > {
       
    25   >     hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
       
    26   > }
       
    27   $ convertrepo()
       
    28   > {
       
    29   >     hg convert --datesort git-repo hg-repo
       
    30   > }
       
    31 
       
    32 Build a GIT repo with at least 1 tag
       
    33 
       
    34   $ mkdir git-repo
       
    35   $ cd git-repo
       
    36   $ git init >/dev/null 2>&1
       
    37   $ echo a > a
       
    38   $ git add a
       
    39   $ action commit -m "rev1"
       
    40   $ action tag -m "tag1" tag1
       
    41   $ cd ..
       
    42 
       
    43 Do a first conversion
       
    44 
       
    45   $ convertrepo
       
    46   initializing destination hg-repo repository
       
    47   scanning source...
       
    48   sorting...
       
    49   converting...
       
    50   0 rev1
       
    51   updating tags
       
    52 
       
    53 Simulate upstream  updates after first conversion
       
    54 
       
    55   $ cd git-repo
       
    56   $ echo b > a
       
    57   $ git add a
       
    58   $ action commit -m "rev2"
       
    59   $ action tag -m "tag2" tag2
       
    60   $ cd ..
       
    61 
       
    62 Perform an incremental conversion
       
    63 
       
    64   $ convertrepo
       
    65   scanning source...
       
    66   sorting...
       
    67   converting...
       
    68   0 rev2
       
    69   updating tags
       
    70 
       
    71 Print the log
       
    72 
       
    73   $ cd hg-repo
       
    74   $ glog
       
    75   o  3 "update tags" files: .hgtags
       
    76   |
       
    77   | o  2 "rev2" files: a
       
    78   | |
       
    79   o |  1 "update tags" files: .hgtags
       
    80    /
       
    81   o  0 "rev1" files: a
       
    82