tests/test-copy2.t
changeset 16856 241a32942c7a
parent 16855 57a5ac98f9b7
child 16857 1415edd88c56
equal deleted inserted replaced
16855:57a5ac98f9b7 16856:241a32942c7a
     1   $ hg init
       
     2   $ echo foo > foo
       
     3 should fail - foo is not managed
       
     4   $ hg mv foo bar
       
     5   foo: not copying - file is not managed
       
     6   abort: no files to copy
       
     7   [255]
       
     8   $ hg st -A
       
     9   ? foo
       
    10   $ hg add foo
       
    11 dry-run; print a warning that this is not a real copy; foo is added
       
    12   $ hg mv --dry-run foo bar
       
    13   foo has not been committed yet, so no copy data will be stored for bar.
       
    14   $ hg st -A
       
    15   A foo
       
    16 should print a warning that this is not a real copy; bar is added
       
    17   $ hg mv foo bar
       
    18   foo has not been committed yet, so no copy data will be stored for bar.
       
    19   $ hg st -A
       
    20   A bar
       
    21 should print a warning that this is not a real copy; foo is added
       
    22   $ hg cp bar foo
       
    23   bar has not been committed yet, so no copy data will be stored for foo.
       
    24   $ hg rm -f bar
       
    25   $ rm bar
       
    26   $ hg st -A
       
    27   A foo
       
    28   $ hg commit -m1
       
    29 
       
    30 moving a missing file
       
    31   $ rm foo
       
    32   $ hg mv foo foo3
       
    33   foo: deleted in working copy
       
    34   foo3 does not exist!
       
    35   $ hg up -qC .
       
    36 
       
    37 copy --after to a nonexistant target filename
       
    38   $ hg cp -A foo dummy
       
    39   foo: not recording copy - dummy does not exist
       
    40 
       
    41 dry-run; should show that foo is clean
       
    42   $ hg copy --dry-run foo bar
       
    43   $ hg st -A
       
    44   C foo
       
    45 should show copy
       
    46   $ hg copy foo bar
       
    47   $ hg st -C
       
    48   A bar
       
    49     foo
       
    50 
       
    51 shouldn't show copy
       
    52   $ hg commit -m2
       
    53   $ hg st -C
       
    54 
       
    55 should match
       
    56   $ hg debugindex foo
       
    57      rev    offset  length   base linkrev nodeid       p1           p2
       
    58        0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
       
    59   $ hg debugrename bar
       
    60   bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
       
    61 
       
    62   $ echo bleah > foo
       
    63   $ echo quux > bar
       
    64   $ hg commit -m3
       
    65 
       
    66 should not be renamed
       
    67   $ hg debugrename bar
       
    68   bar not renamed
       
    69 
       
    70   $ hg copy -f foo bar
       
    71 should show copy
       
    72   $ hg st -C
       
    73   M bar
       
    74     foo
       
    75   $ hg commit -m3
       
    76 
       
    77 should show no parents for tip
       
    78   $ hg debugindex bar
       
    79      rev    offset  length   base linkrev nodeid       p1           p2
       
    80        0         0      69      0       1 7711d36246cc 000000000000 000000000000
       
    81        1        69       6      1       2 bdf70a2b8d03 7711d36246cc 000000000000
       
    82        2        75      81      1       3 b2558327ea8d 000000000000 000000000000
       
    83 should match
       
    84   $ hg debugindex foo
       
    85      rev    offset  length   base linkrev nodeid       p1           p2
       
    86        0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
       
    87        1         5       7      1       2 dd12c926cf16 2ed2a3912a0b 000000000000
       
    88   $ hg debugrename bar
       
    89   bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
       
    90 
       
    91 should show no copies
       
    92   $ hg st -C
       
    93 
       
    94 copy --after on an added file
       
    95   $ cp bar baz
       
    96   $ hg add baz
       
    97   $ hg cp -A bar baz
       
    98   $ hg st -C
       
    99   A baz
       
   100     bar
       
   101 
       
   102 foo was clean:
       
   103   $ hg st -AC foo
       
   104   C foo
       
   105 but it's considered modified after a copy --after --force
       
   106   $ hg copy -Af bar foo
       
   107   $ hg st -AC foo
       
   108   M foo
       
   109     bar