tests/test-confused-revert.t
changeset 12284 f7eb190310ef
parent 12156 4c94b6d0fb1c
child 12316 4134686b83e1
equal deleted inserted replaced
12283:850e089eb41c 12284:f7eb190310ef
       
     1   $ hg init
       
     2   $ echo foo > a
       
     3   $ hg add a
       
     4   $ hg commit -m "1"
       
     5 
       
     6   $ echo bar > b
       
     7   $ hg add b
       
     8   $ hg remove a
       
     9 
       
    10 Should show a removed and b added:
       
    11 
       
    12   $ hg status
       
    13   A b
       
    14   R a
       
    15 
       
    16   $ hg revert --all
       
    17   undeleting a
       
    18   forgetting b
       
    19 
       
    20 Should show b unknown and a back to normal:
       
    21 
       
    22   $ hg status
       
    23   ? b
       
    24 
       
    25   $ rm b
       
    26 
       
    27   $ hg co -C 0
       
    28   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    29   $ echo foo-a > a
       
    30   $ hg commit -m "2a"
       
    31 
       
    32   $ hg co -C 0
       
    33   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    34   $ echo foo-b > a
       
    35   $ hg commit -m "2b"
       
    36   created new head
       
    37 
       
    38   $ HGMERGE=true hg merge 1
       
    39   merging a
       
    40   0 files updated, 1 files merged, 0 files removed, 0 files unresolved
       
    41   (branch merge, don't forget to commit)
       
    42 
       
    43 Should show foo-b:
       
    44 
       
    45   $ cat a
       
    46   foo-b
       
    47 
       
    48   $ echo bar > b
       
    49   $ hg add b
       
    50   $ rm a
       
    51   $ hg remove a
       
    52 
       
    53 Should show a removed and b added:
       
    54 
       
    55   $ hg status
       
    56   A b
       
    57   R a
       
    58 
       
    59 Revert should fail:
       
    60 
       
    61   $ hg revert --all
       
    62   abort: uncommitted merge - please provide a specific revision
       
    63 
       
    64 Revert should be ok now:
       
    65 
       
    66   $ hg revert -r2 --all
       
    67   undeleting a
       
    68   forgetting b
       
    69 
       
    70 Should show b unknown and a marked modified (merged):
       
    71 
       
    72   $ hg status
       
    73   M a
       
    74   ? b
       
    75 
       
    76 Should show foo-b:
       
    77 
       
    78   $ cat a
       
    79   foo-b
       
    80