| 1 |
|
| 2 |
$ echo "[extensions]" >> $HGRCPATH |
| 3 |
$ echo "mq=" >> $HGRCPATH |
| 4 |
|
| 5 |
$ hg init a |
| 6 |
$ cd a |
| 7 |
|
| 8 |
$ echo 'base' > base |
| 9 |
$ hg ci -Ambase |
| 10 |
adding base |
| 11 |
|
| 12 |
$ hg qnew -mmqbase mqbase |
| 13 |
|
| 14 |
$ hg qrename mqbase renamed |
| 15 |
$ mkdir .hg/patches/foo |
| 16 |
$ hg qrename renamed foo |
| 17 |
|
| 18 |
$ hg qseries |
| 19 |
foo/renamed |
| 20 |
|
| 21 |
$ ls .hg/patches/foo |
| 22 |
renamed |
| 23 |
|
| 24 |
$ mkdir .hg/patches/bar |
| 25 |
$ hg qrename foo/renamed bar |
| 26 |
|
| 27 |
$ hg qseries |
| 28 |
bar/renamed |
| 29 |
|
| 30 |
$ ls .hg/patches/bar |
| 31 |
renamed |
| 32 |
|
| 33 |
$ hg qrename bar/renamed baz |
| 34 |
|
| 35 |
$ hg qseries |
| 36 |
baz |
| 37 |
|
| 38 |
$ ls .hg/patches/baz |
| 39 |
.hg/patches/baz |
| 40 |
|
| 41 |
$ hg qrename baz new/dir |
| 42 |
|
| 43 |
$ hg qseries |
| 44 |
new/dir |
| 45 |
|
| 46 |
$ ls .hg/patches/new/dir |
| 47 |
.hg/patches/new/dir |
| 48 |
|
| 49 |
$ cd .. |
| 50 |
|
| 51 |
Test patch being renamed before committed: |
| 52 |
|
| 53 |
$ hg init b |
| 54 |
$ cd b |
| 55 |
$ hg qinit -c |
| 56 |
$ hg qnew x |
| 57 |
$ hg qrename y |
| 58 |
$ hg qcommit -m rename |
| 59 |
|
| 60 |
$ cd .. |
| 61 |
|
| 62 |
Test overlapping renames (issue2388) |
| 63 |
|
| 64 |
$ hg init c |
| 65 |
$ cd c |
| 66 |
$ hg qinit -c |
| 67 |
$ echo a > a |
| 68 |
$ hg add |
| 69 |
adding a |
| 70 |
$ hg qnew patcha |
| 71 |
$ echo b > b |
| 72 |
$ hg add |
| 73 |
adding b |
| 74 |
$ hg qnew patchb |
| 75 |
$ hg ci --mq -m c1 |
| 76 |
$ hg qrename patchb patchc |
| 77 |
$ hg qrename patcha patchb |
| 78 |
$ hg st --mq |
| 79 |
M patchb |
| 80 |
M series |
| 81 |
A patchc |
| 82 |
R patcha |
| 83 |
$ cd .. |
| 84 |
|
| 85 |
Test renames with mq repo (issue2097) |
| 86 |
|
| 87 |
$ hg init issue2097 |
| 88 |
$ cd issue2097 |
| 89 |
$ hg qnew p0 |
| 90 |
$ (cd .hg/patches && hg init) |
| 91 |
$ hg qren p0 p1 |
| 92 |
$ hg debugstate --mq |
| 93 |
$ hg ci --mq -mq0 |
| 94 |
nothing changed |
| 95 |
[1] |
| 96 |
$ cd .. |
| 97 |
|
| 98 |
Test renaming to a folded patch (issue3058) |
| 99 |
|
| 100 |
$ hg init issue3058 |
| 101 |
$ cd issue3058 |
| 102 |
$ hg init --mq |
| 103 |
$ echo a > a |
| 104 |
$ hg add a |
| 105 |
$ hg qnew adda |
| 106 |
$ echo b >> a |
| 107 |
$ hg qnew addb |
| 108 |
$ hg qpop |
| 109 |
popping addb |
| 110 |
now at: adda |
| 111 |
$ hg ci --mq -m "save mq" |
| 112 |
$ hg qfold addb |
| 113 |
$ hg qmv addb |
| 114 |
$ cat .hg/patches/addb |
| 115 |
# HG changeset patch |
| 116 |
# Parent 0000000000000000000000000000000000000000 |
| 117 |
|
| 118 |
diff -r 000000000000 a |
| 119 |
--- /dev/null * (glob) |
| 120 |
+++ b/a * (glob) |
| 121 |
@@ -0,0 +1,2 @@ |
| 122 |
+a |
| 123 |
+b |
| 124 |
$ cd .. |
| 125 |
|