13 echo "# rename a single file" |
13 echo "# rename a single file" |
14 hg rename d1/d11/a1 d2/c |
14 hg rename d1/d11/a1 d2/c |
15 hg status |
15 hg status |
16 hg update -C |
16 hg update -C |
17 |
17 |
|
18 echo "# rename --after a single file" |
|
19 mv d1/d11/a1 d2/c |
|
20 hg rename --after d1/d11/a1 d2/c |
|
21 hg status |
|
22 hg update -C |
|
23 |
18 echo "# move a single file to an existing directory" |
24 echo "# move a single file to an existing directory" |
19 hg rename d1/d11/a1 d2 |
25 hg rename d1/d11/a1 d2 |
20 hg status |
26 hg status |
21 hg update -C |
27 hg update -C |
22 |
28 |
|
29 echo "# move --after a single file to an existing directory" |
|
30 mv d1/d11/a1 d2 |
|
31 hg rename --after d1/d11/a1 d2 |
|
32 hg status |
|
33 hg update -C |
|
34 |
|
35 echo "# rename a file using a relative path" |
|
36 (cd d1/d11; hg rename ../../d2/b e) |
|
37 hg status |
|
38 hg update -C |
|
39 |
|
40 echo "# rename --after a file using a relative path" |
|
41 (cd d1/d11; mv ../../d2/b e; hg rename --after ../../d2/b e) |
|
42 hg status |
|
43 hg update -C |
|
44 |
23 echo "# rename directory d1 as d3" |
45 echo "# rename directory d1 as d3" |
24 hg rename d1 d3 |
46 hg rename d1/ d3 |
|
47 hg status |
|
48 hg update -C |
|
49 |
|
50 echo "# rename --after directory d1 as d3" |
|
51 mv d1 d3 |
|
52 hg rename --after d1 d3 |
|
53 hg status |
|
54 hg update -C |
|
55 |
|
56 echo "# move a directory using a relative path" |
|
57 (cd d2; mkdir d3; hg rename ../d1/d11 d3) |
|
58 hg status |
|
59 hg update -C |
|
60 |
|
61 echo "# move --after a directory using a relative path" |
|
62 (cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3) |
25 hg status |
63 hg status |
26 hg update -C |
64 hg update -C |
27 |
65 |
28 echo "# move directory d1/d11 to an existing directory d2 (removes empty d1)" |
66 echo "# move directory d1/d11 to an existing directory d2 (removes empty d1)" |
29 hg rename d1/d11 d2 |
67 hg rename d1/d11/ d2 |
30 hg status |
68 hg status |
31 hg update -C |
69 hg update -C |
32 |
70 |
33 echo "# move directories d1 and d2 to a new directory d3" |
71 echo "# move directories d1 and d2 to a new directory d3" |
34 mkdir d3 |
72 mkdir d3 |
35 hg rename d1 d2 d3 |
73 hg rename d1 d2 d3 |
|
74 hg status |
|
75 hg update -C |
|
76 |
|
77 echo "# move --after directories d1 and d2 to a new directory d3" |
|
78 mkdir d3 |
|
79 mv d1 d2 d3 |
|
80 hg rename --after d1 d2 d3 |
36 hg status |
81 hg status |
37 hg update -C |
82 hg update -C |
38 |
83 |
39 echo "# move everything under directory d1 to existing directory d2, do not" |
84 echo "# move everything under directory d1 to existing directory d2, do not" |
40 echo "# overwrite existing files (d2/b)" |
85 echo "# overwrite existing files (d2/b)" |
48 hg rename 'glob:d1/**' dx |
93 hg rename 'glob:d1/**' dx |
49 |
94 |
50 echo "# move every file under d1 to d2/d21 (glob)" |
95 echo "# move every file under d1 to d2/d21 (glob)" |
51 mkdir d2/d21 |
96 mkdir d2/d21 |
52 hg rename 'glob:d1/**' d2/d21 |
97 hg rename 'glob:d1/**' d2/d21 |
|
98 hg status |
|
99 hg update -C |
|
100 |
|
101 echo "# move --after some files under d1 to d2/d21 (glob)" |
|
102 mkdir d2/d21 |
|
103 mv d1/a d1/d11/a1 d2/d21 |
|
104 hg rename --after 'glob:d1/**' d2/d21 |
53 hg status |
105 hg status |
54 hg update -C |
106 hg update -C |
55 |
107 |
56 echo "# move every file under d1 starting with an 'a' to d2/d21 (regexp)" |
108 echo "# move every file under d1 starting with an 'a' to d2/d21 (regexp)" |
57 mkdir d2/d21 |
109 mkdir d2/d21 |