author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
Fri, 09 Nov 2007 20:21:35 -0200 | |
changeset 5527 | 0b3f910dfd17 |
parent 5294 | e14118f92730 |
child 5534 | 61c230f81068 |
permissions | -rwxr-xr-x |
2729 | 1 |
#!/bin/sh |
2 |
||
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
3 |
checkundo() |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
4 |
{ |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
5 |
if [ -f .hg/store/undo ]; then |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
6 |
echo ".hg/store/undo still exists after $1" |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
7 |
fi |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
8 |
} |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
9 |
|
2990
61fcd9fac434
Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2935
diff
changeset
|
10 |
echo "[extensions]" >> $HGRCPATH |
61fcd9fac434
Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2935
diff
changeset
|
11 |
echo "mq=" >> $HGRCPATH |
2729 | 12 |
|
13 |
echo % help |
|
14 |
hg help mq |
|
15 |
||
16 |
hg init a |
|
17 |
cd a |
|
18 |
echo a > a |
|
2848
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
19 |
hg ci -Ama |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
20 |
|
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
21 |
hg clone . ../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
22 |
|
2729 | 23 |
mkdir b |
24 |
echo z > b/z |
|
25 |
hg ci -Ama |
|
26 |
||
27 |
echo % qinit |
|
28 |
||
29 |
hg qinit |
|
30 |
||
31 |
cd .. |
|
32 |
hg init b |
|
33 |
||
34 |
echo % -R qinit |
|
35 |
||
36 |
hg -R b qinit |
|
37 |
||
38 |
hg init c |
|
39 |
||
40 |
echo % qinit -c |
|
41 |
||
42 |
hg --cwd c qinit -c |
|
43 |
hg -R c/.hg/patches st |
|
44 |
||
45 |
echo % qnew implies add |
|
46 |
||
47 |
hg -R c qnew test.patch |
|
48 |
hg -R c/.hg/patches st |
|
49 |
||
4071
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
50 |
echo '% qinit; qinit -c' |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
51 |
hg init d |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
52 |
cd d |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
53 |
hg qinit |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
54 |
hg qinit -c |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
55 |
# qinit -c should create both files if they don't exist |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
56 |
echo ' .hgignore:' |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
57 |
cat .hg/patches/.hgignore |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
58 |
echo ' series:' |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
59 |
cat .hg/patches/series |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
60 |
hg qinit -c 2>&1 | sed -e 's/repository.*already/repository already/' |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
61 |
cd .. |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
62 |
|
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
63 |
echo '% qinit; <stuff>; qinit -c' |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
64 |
hg init e |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
65 |
cd e |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
66 |
hg qnew A |
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
67 |
checkundo qnew |
4071
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
68 |
echo foo > foo |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
69 |
hg add foo |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
70 |
hg qrefresh |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
71 |
hg qnew B |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
72 |
echo >> foo |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
73 |
hg qrefresh |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
74 |
echo status >> .hg/patches/.hgignore |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
75 |
echo bleh >> .hg/patches/.hgignore |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
76 |
hg qinit -c |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
77 |
hg -R .hg/patches status |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
78 |
# qinit -c shouldn't touch these files if they already exist |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
79 |
echo ' .hgignore:' |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
80 |
cat .hg/patches/.hgignore |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
81 |
echo ' series:' |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
82 |
cat .hg/patches/series |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
83 |
cd .. |
165abe554c80
mq: qinit -c creates a repo even after a regular qinit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
84 |
|
2729 | 85 |
cd a |
86 |
||
87 |
echo % qnew -m |
|
88 |
||
89 |
hg qnew -m 'foo bar' test.patch |
|
90 |
cat .hg/patches/test.patch |
|
91 |
||
92 |
echo % qrefresh |
|
93 |
||
94 |
echo a >> a |
|
95 |
hg qrefresh |
|
2843
0b9ac7dfcf56
Fix some tests for portability.
Danek Duvall <danek.duvall@sun.com>
parents:
2729
diff
changeset
|
96 |
sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \ |
2729 | 97 |
-e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
98 |
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch |
|
99 |
||
4173
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
100 |
echo % empty qrefresh |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
101 |
|
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
102 |
hg qrefresh -X a |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
103 |
echo 'revision:' |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
104 |
hg diff -r -2 -r -1 |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
105 |
echo 'patch:' |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
106 |
cat .hg/patches/test.patch |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
107 |
echo 'working dir diff:' |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
108 |
hg diff --nodates -q |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
109 |
# restore things |
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
110 |
hg qrefresh |
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
111 |
checkundo qrefresh |
4173
7307d2e98b32
fix qrefresh'ing an empty patch
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4090
diff
changeset
|
112 |
|
2729 | 113 |
echo % qpop |
114 |
||
115 |
hg qpop |
|
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
116 |
checkundo qpop |
2729 | 117 |
|
118 |
echo % qpush |
|
119 |
||
120 |
hg qpush |
|
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
121 |
checkundo qpush |
2729 | 122 |
|
123 |
cd .. |
|
124 |
||
125 |
echo % pop/push outside repo |
|
126 |
||
127 |
hg -R a qpop |
|
128 |
hg -R a qpush |
|
129 |
||
130 |
cd a |
|
131 |
hg qnew test2.patch |
|
132 |
||
133 |
echo % qrefresh in subdir |
|
134 |
||
135 |
cd b |
|
136 |
echo a > a |
|
137 |
hg add a |
|
138 |
hg qrefresh |
|
139 |
||
140 |
echo % pop/push -a in subdir |
|
141 |
||
142 |
hg qpop -a |
|
143 |
hg --traceback qpush -a |
|
144 |
||
145 |
echo % qseries |
|
146 |
hg qseries |
|
3681
05d877dfd33d
fix qseries -v when there are unapplied patches
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3464
diff
changeset
|
147 |
hg qpop |
05d877dfd33d
fix qseries -v when there are unapplied patches
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3464
diff
changeset
|
148 |
hg qseries -vs |
05d877dfd33d
fix qseries -v when there are unapplied patches
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3464
diff
changeset
|
149 |
hg qpush |
2729 | 150 |
|
151 |
echo % qapplied |
|
152 |
hg qapplied |
|
153 |
||
154 |
echo % qtop |
|
155 |
hg qtop |
|
156 |
||
157 |
echo % qprev |
|
158 |
hg qprev |
|
159 |
||
160 |
echo % qnext |
|
161 |
hg qnext |
|
162 |
||
163 |
echo % pop, qnext, qprev, qapplied |
|
164 |
hg qpop |
|
165 |
hg qnext |
|
166 |
hg qprev |
|
167 |
hg qapplied |
|
168 |
||
2846
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2843
diff
changeset
|
169 |
echo % commit should fail |
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2843
diff
changeset
|
170 |
hg commit |
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2843
diff
changeset
|
171 |
|
2848
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
172 |
echo % push should fail |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
173 |
hg push ../../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
174 |
|
2729 | 175 |
echo % qunapplied |
176 |
hg qunapplied |
|
177 |
||
3081
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
178 |
echo % qpush/qpop with index |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
179 |
hg qnew test1b.patch |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
180 |
echo 1b > 1b |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
181 |
hg add 1b |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
182 |
hg qrefresh |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
183 |
hg qpush 2 |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
184 |
hg qpop 0 |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
185 |
hg qpush test.patch+1 |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
186 |
hg qpush test.patch+2 |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
187 |
hg qpop test2.patch-1 |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
188 |
hg qpop test2.patch-2 |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
189 |
hg qpush test1b.patch+1 |
760414dc7ac6
Added tests for qpush/qpop with index.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3027
diff
changeset
|
190 |
|
2848
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
191 |
echo % push should succeed |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
192 |
hg qpop -a |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
193 |
hg push ../../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
194 |
|
4101
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
195 |
echo % qpush/qpop error codes |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
196 |
errorcode() |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
197 |
{ |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
198 |
hg "$@" && echo " $@ succeeds" || echo " $@ fails" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
199 |
} |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
200 |
|
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
201 |
# we want to start with some patches applied |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
202 |
hg qpush -a |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
203 |
echo " % pops all patches and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
204 |
errorcode qpop -a |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
205 |
echo " % does nothing and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
206 |
errorcode qpop -a |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
207 |
echo " % fails - nothing else to pop" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
208 |
errorcode qpop |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
209 |
echo " % pushes a patch and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
210 |
errorcode qpush |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
211 |
echo " % pops a patch and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
212 |
errorcode qpop |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
213 |
echo " % pushes up to test1b.patch and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
214 |
errorcode qpush test1b.patch |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
215 |
echo " % does nothing and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
216 |
errorcode qpush test1b.patch |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
217 |
echo " % does nothing and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
218 |
errorcode qpop test1b.patch |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
219 |
echo " % fails - can't push to this patch" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
220 |
errorcode qpush test.patch |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
221 |
echo " % fails - can't pop to this patch" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
222 |
errorcode qpop test2.patch |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
223 |
echo " % pops up to test.patch and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
224 |
errorcode qpop test.patch |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
225 |
echo " % pushes all patches and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
226 |
errorcode qpush -a |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
227 |
echo " % does nothing and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
228 |
errorcode qpush -a |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
229 |
echo " % fails - nothing else to push" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
230 |
errorcode qpush |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
231 |
echo " % does nothing and succeeds" |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
232 |
errorcode qpush test2.patch |
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
233 |
|
e2ed92f4c0f7
add some tests for qpush/qpop error codes
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4096
diff
changeset
|
234 |
|
2729 | 235 |
echo % strip |
236 |
cd ../../b |
|
237 |
echo x>x |
|
238 |
hg ci -Ama |
|
239 |
hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
|
240 |
hg unbundle .hg/strip-backup/* |
|
2934
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
241 |
|
3027
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
242 |
echo '% cd b; hg qrefresh' |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
243 |
hg init refresh |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
244 |
cd refresh |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
245 |
echo a > a |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
246 |
hg ci -Ama -d'0 0' |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
247 |
hg qnew -mfoo foo |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
248 |
echo a >> a |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
249 |
hg qrefresh |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
250 |
mkdir b |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
251 |
cd b |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
252 |
echo f > f |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
253 |
hg add f |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
254 |
hg qrefresh |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
255 |
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
256 |
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
257 |
echo % hg qrefresh . |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
258 |
hg qrefresh . |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
259 |
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
260 |
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
261 |
hg status |
a4374f7331e4
Call patch.diff directly instead of printdiff - this also saves an
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
262 |
|
3334
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
263 |
echo % qpush failure |
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
264 |
cd .. |
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
265 |
hg qrefresh |
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
266 |
hg qnew -mbar bar |
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
267 |
echo foo > foo |
3464
ba3a96750de0
mq: test case for issue399
Brendan Cully <brendan@kublai.com>
parents:
3334
diff
changeset
|
268 |
echo bar > bar |
ba3a96750de0
mq: test case for issue399
Brendan Cully <brendan@kublai.com>
parents:
3334
diff
changeset
|
269 |
hg add foo bar |
3334
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
270 |
hg qrefresh |
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
271 |
hg qpop -a |
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
272 |
echo bar > foo |
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
273 |
hg qpush -a |
3464
ba3a96750de0
mq: test case for issue399
Brendan Cully <brendan@kublai.com>
parents:
3334
diff
changeset
|
274 |
hg st |
3334
534806df5b5a
Test case for bdiff on buffer objects
Brendan Cully <brendan@kublai.com>
parents:
3081
diff
changeset
|
275 |
|
4219
6cb5be6bd70f
mq: add qparent tag (first parent of qbase)
Brendan Cully <brendan@kublai.com>
parents:
4182
diff
changeset
|
276 |
echo % mq tags |
6cb5be6bd70f
mq: add qparent tag (first parent of qbase)
Brendan Cully <brendan@kublai.com>
parents:
4182
diff
changeset
|
277 |
hg log --template '{rev} {tags}\n' -r qparent:qtip |
6cb5be6bd70f
mq: add qparent tag (first parent of qbase)
Brendan Cully <brendan@kublai.com>
parents:
4182
diff
changeset
|
278 |
|
2990
61fcd9fac434
Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2935
diff
changeset
|
279 |
cat >>$HGRCPATH <<EOF |
2934
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
280 |
[diff] |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
281 |
git = True |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
282 |
EOF |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
283 |
cd .. |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
284 |
hg init git |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
285 |
cd git |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
286 |
hg qinit |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
287 |
|
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
288 |
hg qnew -m'new file' new |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
289 |
echo foo > new |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
290 |
chmod +x new |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
291 |
hg add new |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
292 |
hg qrefresh |
2935 | 293 |
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
294 |
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new |
|
2934
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
295 |
|
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
296 |
hg qnew -m'copy file' copy |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
297 |
hg cp new copy |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
298 |
hg qrefresh |
2935 | 299 |
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
300 |
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy |
|
2934
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
301 |
|
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
302 |
hg qpop |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
303 |
hg qpush |
2f190e998eb3
Teach mq about git patches
Brendan Cully <brendan@kublai.com>
parents:
2848
diff
changeset
|
304 |
hg qdiff |
3697
da262f35fbc8
add --git option to qdiff
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3681
diff
changeset
|
305 |
cat >>$HGRCPATH <<EOF |
da262f35fbc8
add --git option to qdiff
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3681
diff
changeset
|
306 |
[diff] |
da262f35fbc8
add --git option to qdiff
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3681
diff
changeset
|
307 |
git = False |
da262f35fbc8
add --git option to qdiff
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3681
diff
changeset
|
308 |
EOF |
da262f35fbc8
add --git option to qdiff
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3681
diff
changeset
|
309 |
hg qdiff --git |
3699
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
310 |
|
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
311 |
cd .. |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
312 |
hg init slow |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
313 |
cd slow |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
314 |
hg qinit |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
315 |
echo foo > foo |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
316 |
hg add foo |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
317 |
hg ci -m 'add foo' |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
318 |
hg qnew bar |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
319 |
echo bar > bar |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
320 |
hg add bar |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
321 |
hg mv foo baz |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
322 |
hg qrefresh --git |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
323 |
hg up -C 0 |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
324 |
echo >> foo |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
325 |
hg ci -m 'change foo' |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
326 |
hg up -C 1 |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
327 |
hg qrefresh --git 2>&1 | grep -v 'saving bundle' |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
328 |
cat .hg/patches/bar |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
329 |
hg log -vC --template '{rev} {file_copies%filecopy}\n' -r . |
3700
4c158de5f245
qrefresh: fix handling of copies in the fast path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3699
diff
changeset
|
330 |
hg qrefresh --git |
4c158de5f245
qrefresh: fix handling of copies in the fast path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3699
diff
changeset
|
331 |
cat .hg/patches/bar |
4c158de5f245
qrefresh: fix handling of copies in the fast path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3699
diff
changeset
|
332 |
hg log -vC --template '{rev} {file_copies%filecopy}\n' -r . |
4890
bbdcacf7cef8
mq: autodetect an existing git patch during qrefresh (issue 491)
Bryan O'Sullivan <bos@serpentine.com>
parents:
4862
diff
changeset
|
333 |
hg qrefresh |
bbdcacf7cef8
mq: autodetect an existing git patch during qrefresh (issue 491)
Bryan O'Sullivan <bos@serpentine.com>
parents:
4862
diff
changeset
|
334 |
grep 'diff --git' .hg/patches/bar |
3699
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
335 |
|
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
336 |
echo |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
337 |
hg up -C 1 |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
338 |
echo >> foo |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
339 |
hg ci -m 'change foo again' |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
340 |
hg up -C 2 |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
341 |
hg mv bar quux |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
342 |
hg mv baz bleh |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
343 |
hg qrefresh --git 2>&1 | grep -v 'saving bundle' |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
344 |
cat .hg/patches/bar |
4bafcf7aeb32
qrefresh: fix handling of added files (including copies) in the slow path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3697
diff
changeset
|
345 |
hg log -vC --template '{rev} {file_copies%filecopy}\n' -r . |
3700
4c158de5f245
qrefresh: fix handling of copies in the fast path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3699
diff
changeset
|
346 |
hg mv quux fred |
4c158de5f245
qrefresh: fix handling of copies in the fast path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3699
diff
changeset
|
347 |
hg mv bleh barney |
4c158de5f245
qrefresh: fix handling of copies in the fast path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3699
diff
changeset
|
348 |
hg qrefresh --git |
4c158de5f245
qrefresh: fix handling of copies in the fast path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3699
diff
changeset
|
349 |
cat .hg/patches/bar |
4c158de5f245
qrefresh: fix handling of copies in the fast path
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3699
diff
changeset
|
350 |
hg log -vC --template '{rev} {file_copies%filecopy}\n' -r . |
4065
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
351 |
|
5294
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
352 |
echo % refresh omitting an added file |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
353 |
hg qnew baz |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
354 |
echo newfile > newfile |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
355 |
hg add newfile |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
356 |
hg qrefresh |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
357 |
hg st -A newfile |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
358 |
hg qrefresh -X newfile |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
359 |
hg st -A newfile |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
360 |
hg revert newfile |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
361 |
rm newfile |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
362 |
hg qpop |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
363 |
hg qdel baz |
e14118f92730
mq: fix regression in 6fd953d5faea
Brendan Cully <brendan@kublai.com>
parents:
5148
diff
changeset
|
364 |
|
5026 | 365 |
echo % create a git patch |
366 |
echo a > alexander |
|
367 |
hg add alexander |
|
368 |
hg qnew -f --git addalexander |
|
5027
17d71a79a257
Fix bashism and remove useless use of cat.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5026
diff
changeset
|
369 |
grep diff .hg/patches/addalexander |
5026 | 370 |
|
371 |
echo % create a git binary patch |
|
372 |
cat > writebin.py <<EOF |
|
373 |
import sys |
|
374 |
path = sys.argv[1] |
|
375 |
open(path, 'wb').write('BIN\x00ARY') |
|
376 |
EOF |
|
377 |
python writebin.py bucephalus |
|
378 |
||
379 |
python "$TESTDIR/md5sum.py" bucephalus |
|
380 |
hg add bucephalus |
|
381 |
hg qnew -f --git addbucephalus |
|
5027
17d71a79a257
Fix bashism and remove useless use of cat.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5026
diff
changeset
|
382 |
grep diff .hg/patches/addbucephalus |
5026 | 383 |
|
384 |
echo % check binary patches can be popped and pushed |
|
385 |
hg qpop |
|
5027
17d71a79a257
Fix bashism and remove useless use of cat.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
5026
diff
changeset
|
386 |
test -f bucephalus && echo % bucephalus should not be there |
5026 | 387 |
hg qpush |
388 |
test -f bucephalus || echo % bucephalus should be there |
|
389 |
python "$TESTDIR/md5sum.py" bucephalus |
|
390 |
||
391 |
||
4065
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
392 |
echo '% strip again' |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
393 |
cd .. |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
394 |
hg init strip |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
395 |
cd strip |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
396 |
touch foo |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
397 |
hg add foo |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
398 |
hg ci -m 'add foo' -d '0 0' |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
399 |
echo >> foo |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
400 |
hg ci -m 'change foo 1' -d '0 0' |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
401 |
hg up -C 0 |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
402 |
echo 1 >> foo |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
403 |
hg ci -m 'change foo 2' -d '0 0' |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
404 |
HGMERGE=true hg merge |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
405 |
hg ci -m merge -d '0 0' |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
406 |
hg log |
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
407 |
hg strip 1 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
5294
diff
changeset
|
408 |
checkundo strip |
4065
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
409 |
hg log |
4090
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
410 |
cd .. |
4065
8ee983e3d461
fix strip'ping the second parent of a merge
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3700
diff
changeset
|
411 |
|
4090
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
412 |
echo '% qclone' |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
413 |
qlog() |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
414 |
{ |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
415 |
echo 'main repo:' |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
416 |
hg log --template ' rev {rev}: {desc}\n' |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
417 |
echo 'patch repo:' |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
418 |
hg -R .hg/patches log --template ' rev {rev}: {desc}\n' |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
419 |
} |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
420 |
hg init qclonesource |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
421 |
cd qclonesource |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
422 |
echo foo > foo |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
423 |
hg add foo |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
424 |
hg ci -m 'add foo' |
4862
cba10652a901
mq: improve qclone error handling when patch directory is not a repository.
Brendan Cully <brendan@kublai.com>
parents:
4219
diff
changeset
|
425 |
hg qinit |
4090
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
426 |
hg qnew patch1 |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
427 |
echo bar >> foo |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
428 |
hg qrefresh -m 'change foo' |
4862
cba10652a901
mq: improve qclone error handling when patch directory is not a repository.
Brendan Cully <brendan@kublai.com>
parents:
4219
diff
changeset
|
429 |
cd .. |
cba10652a901
mq: improve qclone error handling when patch directory is not a repository.
Brendan Cully <brendan@kublai.com>
parents:
4219
diff
changeset
|
430 |
|
cba10652a901
mq: improve qclone error handling when patch directory is not a repository.
Brendan Cully <brendan@kublai.com>
parents:
4219
diff
changeset
|
431 |
# repo with unversioned patch dir |
cba10652a901
mq: improve qclone error handling when patch directory is not a repository.
Brendan Cully <brendan@kublai.com>
parents:
4219
diff
changeset
|
432 |
hg qclone qclonesource failure |
cba10652a901
mq: improve qclone error handling when patch directory is not a repository.
Brendan Cully <brendan@kublai.com>
parents:
4219
diff
changeset
|
433 |
|
cba10652a901
mq: improve qclone error handling when patch directory is not a repository.
Brendan Cully <brendan@kublai.com>
parents:
4219
diff
changeset
|
434 |
cd qclonesource |
cba10652a901
mq: improve qclone error handling when patch directory is not a repository.
Brendan Cully <brendan@kublai.com>
parents:
4219
diff
changeset
|
435 |
hg qinit -c |
4090
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
436 |
hg qci -m checkpoint |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
437 |
qlog |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
438 |
cd .. |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
439 |
|
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
440 |
# repo with patches applied |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
441 |
hg qclone qclonesource qclonedest |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
442 |
cd qclonedest |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
443 |
qlog |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
444 |
cd .. |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
445 |
|
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
446 |
# repo with patches unapplied |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
447 |
cd qclonesource |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
448 |
hg qpop -a |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
449 |
qlog |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
450 |
cd .. |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
451 |
hg qclone qclonesource qclonedest2 |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
452 |
cd qclonedest2 |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
453 |
qlog |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
454 |
cd .. |
785ad8cd1d31
qclone: don't call reposetup manually
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4065
diff
changeset
|
455 |