equal
deleted
inserted
replaced
|
1 $ hg init |
|
2 $ mkdir d1 d1/d11 d2 |
|
3 $ echo d1/a > d1/a |
|
4 $ echo d1/ba > d1/ba |
|
5 $ echo d1/a1 > d1/d11/a1 |
|
6 $ echo d1/b > d1/b |
|
7 $ echo d2/b > d2/b |
|
8 $ hg add d1/a d1/b d1/ba d1/d11/a1 d2/b |
|
9 $ hg commit -m "intial" |
|
10 |
|
11 |
|
12 Test single file |
|
13 |
|
14 # One recoded copy, one copy to record after commit |
|
15 $ hg cp d1/b d1/c |
|
16 $ cp d1/b d1/d |
|
17 $ hg add d1/d |
|
18 $ hg ci -m 'copy d1/b to d1/c and d1/d' |
|
19 $ hg st -C --change . |
|
20 A d1/c |
|
21 d1/b |
|
22 A d1/d |
|
23 # Errors out without --after for now |
|
24 $ hg cp --at-rev . d1/b d1/d |
|
25 abort: --at-rev requires --after |
|
26 [255] |
|
27 # Errors out with non-existent destination |
|
28 $ hg cp -A --at-rev . d1/b d1/non-existent |
|
29 abort: d1/non-existent: copy destination does not exist in 8a9d70fa20c9 |
|
30 [255] |
|
31 # Successful invocation |
|
32 $ hg cp -A --at-rev . d1/b d1/d |
|
33 saved backup bundle to $TESTTMP/.hg/strip-backup/8a9d70fa20c9-973ae357-copy.hg |
|
34 # New copy is recorded, and previously recorded copy is also still there |
|
35 $ hg st -C --change . |
|
36 A d1/c |
|
37 d1/b |
|
38 A d1/d |
|
39 d1/b |
|
40 |
|
41 Test using directory as destination |
|
42 |
|
43 $ hg co 0 |
|
44 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
45 $ cp -R d1 d3 |
|
46 $ hg add d3 |
|
47 adding d3/a |
|
48 adding d3/b |
|
49 adding d3/ba |
|
50 adding d3/d11/a1 |
|
51 $ hg ci -m 'copy d1/ to d3/' |
|
52 created new head |
|
53 $ hg cp -A --at-rev . d1 d3 |
|
54 abort: d3: --at-rev does not support a directory as destination |
|
55 [255] |
|
56 |