tests/test-convert-hg-sink.t
changeset 12525 81bf25ddd76a
parent 8693 68e0a55eee6e
child 19892 77872b002e73
equal deleted inserted replaced
12524:8773cac3a455 12525:81bf25ddd76a
       
     1 
       
     2   $ cat >> $HGRCPATH <<EOF
       
     3   > [extensions]
       
     4   > convert=
       
     5   > [convert]
       
     6   > hg.saverev=False
       
     7   > EOF
       
     8   $ hg init orig
       
     9   $ cd orig
       
    10   $ echo foo > foo
       
    11   $ echo bar > bar
       
    12   $ hg ci -qAm 'add foo and bar'
       
    13   $ hg rm foo
       
    14   $ hg ci -m 'remove foo'
       
    15   $ mkdir foo
       
    16   $ echo file > foo/file
       
    17   $ hg ci -qAm 'add foo/file'
       
    18   $ hg tag some-tag
       
    19   $ hg log
       
    20   changeset:   3:593cbf6fb2b4
       
    21   tag:         tip
       
    22   user:        test
       
    23   date:        Thu Jan 01 00:00:00 1970 +0000
       
    24   summary:     Added tag some-tag for changeset ad681a868e44
       
    25   
       
    26   changeset:   2:ad681a868e44
       
    27   tag:         some-tag
       
    28   user:        test
       
    29   date:        Thu Jan 01 00:00:00 1970 +0000
       
    30   summary:     add foo/file
       
    31   
       
    32   changeset:   1:cbba8ecc03b7
       
    33   user:        test
       
    34   date:        Thu Jan 01 00:00:00 1970 +0000
       
    35   summary:     remove foo
       
    36   
       
    37   changeset:   0:327daa9251fa
       
    38   user:        test
       
    39   date:        Thu Jan 01 00:00:00 1970 +0000
       
    40   summary:     add foo and bar
       
    41   
       
    42   $ cd ..
       
    43   $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
       
    44   initializing destination new repository
       
    45   scanning source...
       
    46   sorting...
       
    47   converting...
       
    48   3 add foo and bar
       
    49   2 remove foo
       
    50   1 add foo/file
       
    51   0 Added tag some-tag for changeset ad681a868e44
       
    52   $ cd new
       
    53   $ hg out ../orig
       
    54   comparing with ../orig
       
    55   searching for changes
       
    56   no changes found
       
    57   [1]
       
    58 
       
    59 dirstate should be empty:
       
    60 
       
    61   $ hg debugstate
       
    62   $ hg parents -q
       
    63   $ hg up -C
       
    64   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    65   $ hg copy bar baz
       
    66 
       
    67 put something in the dirstate:
       
    68 
       
    69   $ hg debugstate > debugstate
       
    70   $ grep baz debugstate
       
    71   a   0         -1 unset               baz
       
    72   copy: bar -> baz
       
    73 
       
    74 add a new revision in the original repo
       
    75 
       
    76   $ cd ../orig
       
    77   $ echo baz > baz
       
    78   $ hg ci -qAm 'add baz'
       
    79   $ cd ..
       
    80   $ hg convert orig new 2>&1 | grep -v 'subversion python bindings could not be loaded'
       
    81   scanning source...
       
    82   sorting...
       
    83   converting...
       
    84   0 add baz
       
    85   $ cd new
       
    86   $ hg out ../orig
       
    87   comparing with ../orig
       
    88   searching for changes
       
    89   no changes found
       
    90   [1]
       
    91 
       
    92 dirstate should be the same (no output below):
       
    93 
       
    94   $ hg debugstate > new-debugstate
       
    95   $ diff debugstate new-debugstate
       
    96 
       
    97 no copies
       
    98 
       
    99   $ hg up -C
       
   100   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   101   $ hg debugrename baz
       
   102   baz not renamed
       
   103   $ cd ..
       
   104 
       
   105 test tag rewriting
       
   106 
       
   107   $ cat > filemap <<EOF
       
   108   > exclude foo
       
   109   > EOF
       
   110   $ hg convert --filemap filemap orig new-filemap 2>&1 | grep -v 'subversion python bindings could not be loaded'
       
   111   initializing destination new-filemap repository
       
   112   scanning source...
       
   113   sorting...
       
   114   converting...
       
   115   4 add foo and bar
       
   116   3 remove foo
       
   117   2 add foo/file
       
   118   1 Added tag some-tag for changeset ad681a868e44
       
   119   0 add baz
       
   120   $ cd new-filemap
       
   121   $ hg tags
       
   122   tip                                2:6f4fd1df87fb
       
   123   some-tag                           0:ba8636729451
       
   124   $ cd ..