##// END OF EJS Templates
tests: fix bashism to load helpers.sh...
Yuya Nishihara -
r11208:2313dc4d default
parent child Browse files
Show More
@@ -1,34 +1,34 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
7 echo "bookmarks=" >> $HGRCPATH
7 echo "bookmarks=" >> $HGRCPATH
8
8
9 echo % initialize repository
9 echo % initialize repository
10 hg init
10 hg init
11
11
12 echo 'a' > a
12 echo 'a' > a
13 hg ci -A -m "0"
13 hg ci -A -m "0"
14
14
15 echo 'b' > b
15 echo 'b' > b
16 hg ci -A -m "1"
16 hg ci -A -m "1"
17
17
18 hg up 0
18 hg up 0
19 echo 'c' > c
19 echo 'c' > c
20 hg ci -A -m "2"
20 hg ci -A -m "2"
21
21
22 echo 'd' > d
22 echo 'd' > d
23 hg ci -A -m "3"
23 hg ci -A -m "3"
24
24
25 hg bookmark -r 1 one
25 hg bookmark -r 1 one
26 hg bookmark -r 3 two
26 hg bookmark -r 3 two
27
27
28 echo % bookmark list
28 echo % bookmark list
29 hg bookmark
29 hg bookmark
30
30
31 echo % rebase
31 echo % rebase
32 hg rebase -s two -d one 2>&1 | cleanrebase
32 hg rebase -s two -d one 2>&1 | cleanrebase
33
33
34 hg log
34 hg log
@@ -1,45 +1,45 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4 echo "[extensions]" >> $HGRCPATH
4 echo "[extensions]" >> $HGRCPATH
5 echo "bookmarks=" >> $HGRCPATH
5 echo "bookmarks=" >> $HGRCPATH
6 echo "mq=" >> $HGRCPATH
6 echo "mq=" >> $HGRCPATH
7
7
8 hg init
8 hg init
9
9
10 echo qqq>qqq.txt
10 echo qqq>qqq.txt
11
11
12 echo % add file
12 echo % add file
13 hg add
13 hg add
14
14
15 echo % commit first revision
15 echo % commit first revision
16 hg ci -m 1 -u user -d "1 0"
16 hg ci -m 1 -u user -d "1 0"
17
17
18 echo % set bookmark
18 echo % set bookmark
19 hg book test
19 hg book test
20
20
21 echo www>>qqq.txt
21 echo www>>qqq.txt
22
22
23 echo % commit second revision
23 echo % commit second revision
24 hg ci -m 2 -u usr -d "1 0"
24 hg ci -m 2 -u usr -d "1 0"
25
25
26 echo % set bookmark
26 echo % set bookmark
27 hg book test2
27 hg book test2
28
28
29 echo % update to -2
29 echo % update to -2
30 hg update -r -2
30 hg update -r -2
31
31
32 echo eee>>qqq.txt
32 echo eee>>qqq.txt
33
33
34 echo % commit new head
34 echo % commit new head
35 hg ci -m 3 -u user -d "1 0"
35 hg ci -m 3 -u user -d "1 0"
36
36
37 echo % bookmarks updated?
37 echo % bookmarks updated?
38 hg book
38 hg book
39
39
40 echo % strip to revision 1
40 echo % strip to revision 1
41 hg strip 1 | hidebackup
41 hg strip 1 | hidebackup
42
42
43 echo % list bookmarks
43 echo % list bookmarks
44 hg book
44 hg book
45
45
@@ -1,622 +1,622 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 checkundo()
5 checkundo()
6 {
6 {
7 if [ -f .hg/store/undo ]; then
7 if [ -f .hg/store/undo ]; then
8 echo ".hg/store/undo still exists after $1"
8 echo ".hg/store/undo still exists after $1"
9 fi
9 fi
10 }
10 }
11
11
12 echo "[extensions]" >> $HGRCPATH
12 echo "[extensions]" >> $HGRCPATH
13 echo "mq=" >> $HGRCPATH
13 echo "mq=" >> $HGRCPATH
14
14
15 echo "[mq]" >> $HGRCPATH
15 echo "[mq]" >> $HGRCPATH
16 echo "plain=true" >> $HGRCPATH
16 echo "plain=true" >> $HGRCPATH
17
17
18 echo % help
18 echo % help
19 hg help mq
19 hg help mq
20
20
21 hg init a
21 hg init a
22 cd a
22 cd a
23 echo a > a
23 echo a > a
24 hg ci -Ama
24 hg ci -Ama
25
25
26 hg clone . ../k
26 hg clone . ../k
27
27
28 mkdir b
28 mkdir b
29 echo z > b/z
29 echo z > b/z
30 hg ci -Ama
30 hg ci -Ama
31
31
32 echo % qinit
32 echo % qinit
33
33
34 hg qinit
34 hg qinit
35
35
36 cd ..
36 cd ..
37 hg init b
37 hg init b
38
38
39 echo % -R qinit
39 echo % -R qinit
40
40
41 hg -R b qinit
41 hg -R b qinit
42
42
43 hg init c
43 hg init c
44
44
45 echo % qinit -c
45 echo % qinit -c
46
46
47 hg --cwd c qinit -c
47 hg --cwd c qinit -c
48 hg -R c/.hg/patches st
48 hg -R c/.hg/patches st
49
49
50 echo '% qinit; qinit -c'
50 echo '% qinit; qinit -c'
51 hg init d
51 hg init d
52 cd d
52 cd d
53 hg qinit
53 hg qinit
54 hg qinit -c
54 hg qinit -c
55 # qinit -c should create both files if they don't exist
55 # qinit -c should create both files if they don't exist
56 echo ' .hgignore:'
56 echo ' .hgignore:'
57 cat .hg/patches/.hgignore
57 cat .hg/patches/.hgignore
58 echo ' series:'
58 echo ' series:'
59 cat .hg/patches/series
59 cat .hg/patches/series
60 hg qinit -c 2>&1 | sed -e 's/repository.*already/repository already/'
60 hg qinit -c 2>&1 | sed -e 's/repository.*already/repository already/'
61 cd ..
61 cd ..
62
62
63 echo '% qinit; <stuff>; qinit -c'
63 echo '% qinit; <stuff>; qinit -c'
64 hg init e
64 hg init e
65 cd e
65 cd e
66 hg qnew A
66 hg qnew A
67 checkundo qnew
67 checkundo qnew
68 echo foo > foo
68 echo foo > foo
69 hg add foo
69 hg add foo
70 hg qrefresh
70 hg qrefresh
71 hg qnew B
71 hg qnew B
72 echo >> foo
72 echo >> foo
73 hg qrefresh
73 hg qrefresh
74 echo status >> .hg/patches/.hgignore
74 echo status >> .hg/patches/.hgignore
75 echo bleh >> .hg/patches/.hgignore
75 echo bleh >> .hg/patches/.hgignore
76 hg qinit -c
76 hg qinit -c
77 hg -R .hg/patches status
77 hg -R .hg/patches status
78 # qinit -c shouldn't touch these files if they already exist
78 # qinit -c shouldn't touch these files if they already exist
79 echo ' .hgignore:'
79 echo ' .hgignore:'
80 cat .hg/patches/.hgignore
80 cat .hg/patches/.hgignore
81 echo ' series:'
81 echo ' series:'
82 cat .hg/patches/series
82 cat .hg/patches/series
83 cd ..
83 cd ..
84
84
85 echo '% init --mq without repo'
85 echo '% init --mq without repo'
86 mkdir f
86 mkdir f
87 cd f
87 cd f
88 hg init --mq
88 hg init --mq
89 cd ..
89 cd ..
90
90
91 echo '% init --mq with repo path'
91 echo '% init --mq with repo path'
92 hg init g
92 hg init g
93 hg init --mq g
93 hg init --mq g
94 test -d g/.hg/patches/.hg && echo "ok" || echo "failed"
94 test -d g/.hg/patches/.hg && echo "ok" || echo "failed"
95
95
96 echo '% init --mq with nonexistent directory'
96 echo '% init --mq with nonexistent directory'
97 hg init --mq nonexistentdir
97 hg init --mq nonexistentdir
98
98
99 echo '% init --mq with bundle (non "local")'
99 echo '% init --mq with bundle (non "local")'
100 hg -R a bundle --all a.bundle >/dev/null
100 hg -R a bundle --all a.bundle >/dev/null
101 hg init --mq a.bundle
101 hg init --mq a.bundle
102
102
103 cd a
103 cd a
104
104
105 hg qnew -m 'foo bar' test.patch
105 hg qnew -m 'foo bar' test.patch
106
106
107 echo % qrefresh
107 echo % qrefresh
108
108
109 echo a >> a
109 echo a >> a
110 hg qrefresh
110 hg qrefresh
111 sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
111 sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
112 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
112 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
113 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
113 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
114
114
115 echo % empty qrefresh
115 echo % empty qrefresh
116
116
117 hg qrefresh -X a
117 hg qrefresh -X a
118 echo 'revision:'
118 echo 'revision:'
119 hg diff -r -2 -r -1
119 hg diff -r -2 -r -1
120 echo 'patch:'
120 echo 'patch:'
121 cat .hg/patches/test.patch
121 cat .hg/patches/test.patch
122 echo 'working dir diff:'
122 echo 'working dir diff:'
123 hg diff --nodates -q
123 hg diff --nodates -q
124 # restore things
124 # restore things
125 hg qrefresh
125 hg qrefresh
126 checkundo qrefresh
126 checkundo qrefresh
127
127
128 echo % qpop
128 echo % qpop
129
129
130 hg qpop
130 hg qpop
131 checkundo qpop
131 checkundo qpop
132
132
133 echo % qpush with dump of tag cache
133 echo % qpush with dump of tag cache
134
134
135 # Dump the tag cache to ensure that it has exactly one head after qpush.
135 # Dump the tag cache to ensure that it has exactly one head after qpush.
136 rm -f .hg/tags.cache
136 rm -f .hg/tags.cache
137 hg tags > /dev/null
137 hg tags > /dev/null
138 echo ".hg/tags.cache (pre qpush):"
138 echo ".hg/tags.cache (pre qpush):"
139 sed 's/ [0-9a-f]*//' .hg/tags.cache
139 sed 's/ [0-9a-f]*//' .hg/tags.cache
140 hg qpush
140 hg qpush
141 hg tags > /dev/null
141 hg tags > /dev/null
142 echo ".hg/tags.cache (post qpush):"
142 echo ".hg/tags.cache (post qpush):"
143 sed 's/ [0-9a-f]*//' .hg/tags.cache
143 sed 's/ [0-9a-f]*//' .hg/tags.cache
144
144
145 checkundo qpush
145 checkundo qpush
146
146
147 cd ..
147 cd ..
148
148
149 echo % pop/push outside repo
149 echo % pop/push outside repo
150
150
151 hg -R a qpop
151 hg -R a qpop
152 hg -R a qpush
152 hg -R a qpush
153
153
154 cd a
154 cd a
155 hg qnew test2.patch
155 hg qnew test2.patch
156
156
157 echo % qrefresh in subdir
157 echo % qrefresh in subdir
158
158
159 cd b
159 cd b
160 echo a > a
160 echo a > a
161 hg add a
161 hg add a
162 hg qrefresh
162 hg qrefresh
163
163
164 echo % pop/push -a in subdir
164 echo % pop/push -a in subdir
165
165
166 hg qpop -a
166 hg qpop -a
167 hg --traceback qpush -a
167 hg --traceback qpush -a
168
168
169 # setting columns & interactive tests truncating (issue1912)
169 # setting columns & interactive tests truncating (issue1912)
170 echo % qseries
170 echo % qseries
171 COLUMNS=4 hg qseries --config ui.interactive=true
171 COLUMNS=4 hg qseries --config ui.interactive=true
172 COLUMNS=20 hg qseries --config ui.interactive=true -vs
172 COLUMNS=20 hg qseries --config ui.interactive=true -vs
173 hg qpop
173 hg qpop
174 hg qseries -vs
174 hg qseries -vs
175 hg sum | grep mq
175 hg sum | grep mq
176 hg qpush
176 hg qpush
177 hg sum | grep mq
177 hg sum | grep mq
178
178
179 echo % qapplied
179 echo % qapplied
180 hg qapplied
180 hg qapplied
181
181
182 echo % qtop
182 echo % qtop
183 hg qtop
183 hg qtop
184
184
185 echo % prev
185 echo % prev
186 hg qapp -1
186 hg qapp -1
187
187
188 echo % next
188 echo % next
189 hg qunapp -1
189 hg qunapp -1
190
190
191 hg qpop
191 hg qpop
192 echo % commit should fail
192 echo % commit should fail
193 hg commit
193 hg commit
194
194
195 echo % push should fail
195 echo % push should fail
196 hg push ../../k
196 hg push ../../k
197
197
198 echo % import should fail
198 echo % import should fail
199 hg st .
199 hg st .
200 echo foo >> ../a
200 echo foo >> ../a
201 hg diff > ../../import.diff
201 hg diff > ../../import.diff
202 hg revert --no-backup ../a
202 hg revert --no-backup ../a
203 hg import ../../import.diff
203 hg import ../../import.diff
204 hg st
204 hg st
205 echo % import --no-commit should succeed
205 echo % import --no-commit should succeed
206 hg import --no-commit ../../import.diff
206 hg import --no-commit ../../import.diff
207 hg st
207 hg st
208 hg revert --no-backup ../a
208 hg revert --no-backup ../a
209
209
210 echo % qunapplied
210 echo % qunapplied
211 hg qunapplied
211 hg qunapplied
212
212
213 echo % qpush/qpop with index
213 echo % qpush/qpop with index
214 hg qnew test1b.patch
214 hg qnew test1b.patch
215 echo 1b > 1b
215 echo 1b > 1b
216 hg add 1b
216 hg add 1b
217 hg qrefresh
217 hg qrefresh
218 hg qpush 2
218 hg qpush 2
219 hg qpop 0
219 hg qpop 0
220 hg qpush test.patch+1
220 hg qpush test.patch+1
221 hg qpush test.patch+2
221 hg qpush test.patch+2
222 hg qpop test2.patch-1
222 hg qpop test2.patch-1
223 hg qpop test2.patch-2
223 hg qpop test2.patch-2
224 hg qpush test1b.patch+1
224 hg qpush test1b.patch+1
225
225
226 echo % qpush --move
226 echo % qpush --move
227 hg qpop -a
227 hg qpop -a
228 hg qpush --move test2.patch # move to front
228 hg qpush --move test2.patch # move to front
229 hg qpush --move test1b.patch
229 hg qpush --move test1b.patch
230 hg qpush --move test.patch # noop move
230 hg qpush --move test.patch # noop move
231 hg qseries -v
231 hg qseries -v
232 hg qpop -a
232 hg qpop -a
233 hg qpush --move test.patch # cleaning up
233 hg qpush --move test.patch # cleaning up
234 hg qpush --move test1b.patch
234 hg qpush --move test1b.patch
235 hg qpush --move bogus # nonexistent patch
235 hg qpush --move bogus # nonexistent patch
236 hg qpush --move test.patch # already applied
236 hg qpush --move test.patch # already applied
237 hg qpush
237 hg qpush
238
238
239 echo % pop, qapplied, qunapplied
239 echo % pop, qapplied, qunapplied
240 hg qseries -v
240 hg qseries -v
241 echo % qapplied -1 test.patch
241 echo % qapplied -1 test.patch
242 hg qapplied -1 test.patch
242 hg qapplied -1 test.patch
243 echo % qapplied -1 test1b.patch
243 echo % qapplied -1 test1b.patch
244 hg qapplied -1 test1b.patch
244 hg qapplied -1 test1b.patch
245 echo % qapplied -1 test2.patch
245 echo % qapplied -1 test2.patch
246 hg qapplied -1 test2.patch
246 hg qapplied -1 test2.patch
247 echo % qapplied -1
247 echo % qapplied -1
248 hg qapplied -1
248 hg qapplied -1
249 echo % qapplied
249 echo % qapplied
250 hg qapplied
250 hg qapplied
251 echo % qapplied test1b.patch
251 echo % qapplied test1b.patch
252 hg qapplied test1b.patch
252 hg qapplied test1b.patch
253 echo % qunapplied -1
253 echo % qunapplied -1
254 hg qunapplied -1
254 hg qunapplied -1
255 echo % qunapplied
255 echo % qunapplied
256 hg qunapplied
256 hg qunapplied
257 echo % popping
257 echo % popping
258 hg qpop
258 hg qpop
259 echo % qunapplied -1
259 echo % qunapplied -1
260 hg qunapplied -1
260 hg qunapplied -1
261 echo % qunapplied
261 echo % qunapplied
262 hg qunapplied
262 hg qunapplied
263 echo % qunapplied test2.patch
263 echo % qunapplied test2.patch
264 hg qunapplied test2.patch
264 hg qunapplied test2.patch
265 echo % qunapplied -1 test2.patch
265 echo % qunapplied -1 test2.patch
266 hg qunapplied -1 test2.patch
266 hg qunapplied -1 test2.patch
267 echo % popping -a
267 echo % popping -a
268 hg qpop -a
268 hg qpop -a
269 echo % qapplied
269 echo % qapplied
270 hg qapplied
270 hg qapplied
271 echo % qapplied -1
271 echo % qapplied -1
272 hg qapplied -1
272 hg qapplied -1
273 hg qpush
273 hg qpush
274
274
275 echo % push should succeed
275 echo % push should succeed
276 hg qpop -a
276 hg qpop -a
277 hg push ../../k
277 hg push ../../k
278
278
279 echo % qpush/qpop error codes
279 echo % qpush/qpop error codes
280 errorcode()
280 errorcode()
281 {
281 {
282 hg "$@" && echo " $@ succeeds" || echo " $@ fails"
282 hg "$@" && echo " $@ succeeds" || echo " $@ fails"
283 }
283 }
284
284
285 # we want to start with some patches applied
285 # we want to start with some patches applied
286 hg qpush -a
286 hg qpush -a
287 echo " % pops all patches and succeeds"
287 echo " % pops all patches and succeeds"
288 errorcode qpop -a
288 errorcode qpop -a
289 echo " % does nothing and succeeds"
289 echo " % does nothing and succeeds"
290 errorcode qpop -a
290 errorcode qpop -a
291 echo " % fails - nothing else to pop"
291 echo " % fails - nothing else to pop"
292 errorcode qpop
292 errorcode qpop
293 echo " % pushes a patch and succeeds"
293 echo " % pushes a patch and succeeds"
294 errorcode qpush
294 errorcode qpush
295 echo " % pops a patch and succeeds"
295 echo " % pops a patch and succeeds"
296 errorcode qpop
296 errorcode qpop
297 echo " % pushes up to test1b.patch and succeeds"
297 echo " % pushes up to test1b.patch and succeeds"
298 errorcode qpush test1b.patch
298 errorcode qpush test1b.patch
299 echo " % does nothing and succeeds"
299 echo " % does nothing and succeeds"
300 errorcode qpush test1b.patch
300 errorcode qpush test1b.patch
301 echo " % does nothing and succeeds"
301 echo " % does nothing and succeeds"
302 errorcode qpop test1b.patch
302 errorcode qpop test1b.patch
303 echo " % fails - can't push to this patch"
303 echo " % fails - can't push to this patch"
304 errorcode qpush test.patch
304 errorcode qpush test.patch
305 echo " % fails - can't pop to this patch"
305 echo " % fails - can't pop to this patch"
306 errorcode qpop test2.patch
306 errorcode qpop test2.patch
307 echo " % pops up to test.patch and succeeds"
307 echo " % pops up to test.patch and succeeds"
308 errorcode qpop test.patch
308 errorcode qpop test.patch
309 echo " % pushes all patches and succeeds"
309 echo " % pushes all patches and succeeds"
310 errorcode qpush -a
310 errorcode qpush -a
311 echo " % does nothing and succeeds"
311 echo " % does nothing and succeeds"
312 errorcode qpush -a
312 errorcode qpush -a
313 echo " % fails - nothing else to push"
313 echo " % fails - nothing else to push"
314 errorcode qpush
314 errorcode qpush
315 echo " % does nothing and succeeds"
315 echo " % does nothing and succeeds"
316 errorcode qpush test2.patch
316 errorcode qpush test2.patch
317
317
318
318
319 echo % strip
319 echo % strip
320 cd ../../b
320 cd ../../b
321 echo x>x
321 echo x>x
322 hg ci -Ama
322 hg ci -Ama
323 hg strip tip | hidebackup
323 hg strip tip | hidebackup
324 hg unbundle .hg/strip-backup/*
324 hg unbundle .hg/strip-backup/*
325
325
326 echo % strip with local changes, should complain
326 echo % strip with local changes, should complain
327 hg up
327 hg up
328 echo y>y
328 echo y>y
329 hg add y
329 hg add y
330 hg strip tip | hidebackup
330 hg strip tip | hidebackup
331 echo % --force strip with local changes
331 echo % --force strip with local changes
332 hg strip -f tip | hidebackup
332 hg strip -f tip | hidebackup
333
333
334 echo '% cd b; hg qrefresh'
334 echo '% cd b; hg qrefresh'
335 hg init refresh
335 hg init refresh
336 cd refresh
336 cd refresh
337 echo a > a
337 echo a > a
338 hg ci -Ama
338 hg ci -Ama
339 hg qnew -mfoo foo
339 hg qnew -mfoo foo
340 echo a >> a
340 echo a >> a
341 hg qrefresh
341 hg qrefresh
342 mkdir b
342 mkdir b
343 cd b
343 cd b
344 echo f > f
344 echo f > f
345 hg add f
345 hg add f
346 hg qrefresh
346 hg qrefresh
347 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
347 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
348 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
348 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
349 echo % hg qrefresh .
349 echo % hg qrefresh .
350 hg qrefresh .
350 hg qrefresh .
351 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
351 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
352 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
352 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
353 hg status
353 hg status
354
354
355 echo % qpush failure
355 echo % qpush failure
356 cd ..
356 cd ..
357 hg qrefresh
357 hg qrefresh
358 hg qnew -mbar bar
358 hg qnew -mbar bar
359 echo foo > foo
359 echo foo > foo
360 echo bar > bar
360 echo bar > bar
361 hg add foo bar
361 hg add foo bar
362 hg qrefresh
362 hg qrefresh
363 hg qpop -a
363 hg qpop -a
364 echo bar > foo
364 echo bar > foo
365 hg qpush -a
365 hg qpush -a
366 hg st
366 hg st
367
367
368 echo % mq tags
368 echo % mq tags
369 hg log --template '{rev} {tags}\n' -r qparent:qtip
369 hg log --template '{rev} {tags}\n' -r qparent:qtip
370
370
371 echo % bad node in status
371 echo % bad node in status
372 hg qpop
372 hg qpop
373 hg strip -qn tip
373 hg strip -qn tip
374 hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/'
374 hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/'
375 hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/'
375 hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/'
376 hg qpop 2>&1 | sed -e 's/unknown node .*/unknown node/'
376 hg qpop 2>&1 | sed -e 's/unknown node .*/unknown node/'
377
377
378 cat >>$HGRCPATH <<EOF
378 cat >>$HGRCPATH <<EOF
379 [diff]
379 [diff]
380 git = True
380 git = True
381 EOF
381 EOF
382 cd ..
382 cd ..
383 hg init git
383 hg init git
384 cd git
384 cd git
385 hg qinit
385 hg qinit
386
386
387 hg qnew -m'new file' new
387 hg qnew -m'new file' new
388 echo foo > new
388 echo foo > new
389 chmod +x new
389 chmod +x new
390 hg add new
390 hg add new
391 hg qrefresh
391 hg qrefresh
392 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
392 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
393 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
393 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
394
394
395 hg qnew -m'copy file' copy
395 hg qnew -m'copy file' copy
396 hg cp new copy
396 hg cp new copy
397 hg qrefresh
397 hg qrefresh
398 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
398 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
399 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
399 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
400
400
401 hg qpop
401 hg qpop
402 hg qpush
402 hg qpush
403 hg qdiff
403 hg qdiff
404 cat >>$HGRCPATH <<EOF
404 cat >>$HGRCPATH <<EOF
405 [diff]
405 [diff]
406 git = False
406 git = False
407 EOF
407 EOF
408 hg qdiff --git
408 hg qdiff --git
409 cd ..
409 cd ..
410
410
411 echo % test file addition in slow path
411 echo % test file addition in slow path
412 hg init slow
412 hg init slow
413 cd slow
413 cd slow
414 hg qinit
414 hg qinit
415 echo foo > foo
415 echo foo > foo
416 hg add foo
416 hg add foo
417 hg ci -m 'add foo'
417 hg ci -m 'add foo'
418 hg qnew bar
418 hg qnew bar
419 echo bar > bar
419 echo bar > bar
420 hg add bar
420 hg add bar
421 hg mv foo baz
421 hg mv foo baz
422 hg qrefresh --git
422 hg qrefresh --git
423 hg up -C 0
423 hg up -C 0
424 echo >> foo
424 echo >> foo
425 hg ci -m 'change foo'
425 hg ci -m 'change foo'
426 hg up -C 1
426 hg up -C 1
427 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
427 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
428 cat .hg/patches/bar
428 cat .hg/patches/bar
429 hg log -v --template '{rev} {file_copies}\n' -r .
429 hg log -v --template '{rev} {file_copies}\n' -r .
430 hg qrefresh --git
430 hg qrefresh --git
431 cat .hg/patches/bar
431 cat .hg/patches/bar
432 hg log -v --template '{rev} {file_copies}\n' -r .
432 hg log -v --template '{rev} {file_copies}\n' -r .
433 hg qrefresh
433 hg qrefresh
434 grep 'diff --git' .hg/patches/bar
434 grep 'diff --git' .hg/patches/bar
435
435
436 echo % test file move chains in the slow path
436 echo % test file move chains in the slow path
437 hg up -C 1
437 hg up -C 1
438 echo >> foo
438 echo >> foo
439 hg ci -m 'change foo again'
439 hg ci -m 'change foo again'
440 hg up -C 2
440 hg up -C 2
441 hg mv bar quux
441 hg mv bar quux
442 hg mv baz bleh
442 hg mv baz bleh
443 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
443 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
444 cat .hg/patches/bar
444 cat .hg/patches/bar
445 hg log -v --template '{rev} {file_copies}\n' -r .
445 hg log -v --template '{rev} {file_copies}\n' -r .
446 hg mv quux fred
446 hg mv quux fred
447 hg mv bleh barney
447 hg mv bleh barney
448 hg qrefresh --git
448 hg qrefresh --git
449 cat .hg/patches/bar
449 cat .hg/patches/bar
450 hg log -v --template '{rev} {file_copies}\n' -r .
450 hg log -v --template '{rev} {file_copies}\n' -r .
451
451
452 echo % refresh omitting an added file
452 echo % refresh omitting an added file
453 hg qnew baz
453 hg qnew baz
454 echo newfile > newfile
454 echo newfile > newfile
455 hg add newfile
455 hg add newfile
456 hg qrefresh
456 hg qrefresh
457 hg st -A newfile
457 hg st -A newfile
458 hg qrefresh -X newfile
458 hg qrefresh -X newfile
459 hg st -A newfile
459 hg st -A newfile
460 hg revert newfile
460 hg revert newfile
461 rm newfile
461 rm newfile
462 hg qpop
462 hg qpop
463 hg qdel baz
463 hg qdel baz
464
464
465 echo % create a git patch
465 echo % create a git patch
466 echo a > alexander
466 echo a > alexander
467 hg add alexander
467 hg add alexander
468 hg qnew -f --git addalexander
468 hg qnew -f --git addalexander
469 grep diff .hg/patches/addalexander
469 grep diff .hg/patches/addalexander
470
470
471 echo % create a git binary patch
471 echo % create a git binary patch
472 cat > writebin.py <<EOF
472 cat > writebin.py <<EOF
473 import sys
473 import sys
474 path = sys.argv[1]
474 path = sys.argv[1]
475 open(path, 'wb').write('BIN\x00ARY')
475 open(path, 'wb').write('BIN\x00ARY')
476 EOF
476 EOF
477 python writebin.py bucephalus
477 python writebin.py bucephalus
478
478
479 python "$TESTDIR/md5sum.py" bucephalus
479 python "$TESTDIR/md5sum.py" bucephalus
480 hg add bucephalus
480 hg add bucephalus
481 hg qnew -f --git addbucephalus
481 hg qnew -f --git addbucephalus
482 grep diff .hg/patches/addbucephalus
482 grep diff .hg/patches/addbucephalus
483
483
484 echo % check binary patches can be popped and pushed
484 echo % check binary patches can be popped and pushed
485 hg qpop
485 hg qpop
486 test -f bucephalus && echo % bucephalus should not be there
486 test -f bucephalus && echo % bucephalus should not be there
487 hg qpush
487 hg qpush
488 test -f bucephalus || echo % bucephalus should be there
488 test -f bucephalus || echo % bucephalus should be there
489 python "$TESTDIR/md5sum.py" bucephalus
489 python "$TESTDIR/md5sum.py" bucephalus
490
490
491
491
492 echo '% strip again'
492 echo '% strip again'
493 cd ..
493 cd ..
494 hg init strip
494 hg init strip
495 cd strip
495 cd strip
496 touch foo
496 touch foo
497 hg add foo
497 hg add foo
498 hg ci -m 'add foo'
498 hg ci -m 'add foo'
499 echo >> foo
499 echo >> foo
500 hg ci -m 'change foo 1'
500 hg ci -m 'change foo 1'
501 hg up -C 0
501 hg up -C 0
502 echo 1 >> foo
502 echo 1 >> foo
503 hg ci -m 'change foo 2'
503 hg ci -m 'change foo 2'
504 HGMERGE=true hg merge
504 HGMERGE=true hg merge
505 hg ci -m merge
505 hg ci -m merge
506 hg log
506 hg log
507 hg strip 1 | hidebackup
507 hg strip 1 | hidebackup
508 checkundo strip
508 checkundo strip
509 hg log
509 hg log
510 cd ..
510 cd ..
511
511
512 echo '% qclone'
512 echo '% qclone'
513 qlog()
513 qlog()
514 {
514 {
515 echo 'main repo:'
515 echo 'main repo:'
516 hg log --template ' rev {rev}: {desc}\n'
516 hg log --template ' rev {rev}: {desc}\n'
517 echo 'patch repo:'
517 echo 'patch repo:'
518 hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
518 hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
519 }
519 }
520 hg init qclonesource
520 hg init qclonesource
521 cd qclonesource
521 cd qclonesource
522 echo foo > foo
522 echo foo > foo
523 hg add foo
523 hg add foo
524 hg ci -m 'add foo'
524 hg ci -m 'add foo'
525 hg qinit
525 hg qinit
526 hg qnew patch1
526 hg qnew patch1
527 echo bar >> foo
527 echo bar >> foo
528 hg qrefresh -m 'change foo'
528 hg qrefresh -m 'change foo'
529 cd ..
529 cd ..
530
530
531 # repo with unversioned patch dir
531 # repo with unversioned patch dir
532 hg qclone qclonesource failure
532 hg qclone qclonesource failure
533
533
534 cd qclonesource
534 cd qclonesource
535 hg qinit -c
535 hg qinit -c
536 hg qci -m checkpoint
536 hg qci -m checkpoint
537 qlog
537 qlog
538 cd ..
538 cd ..
539
539
540 # repo with patches applied
540 # repo with patches applied
541 hg qclone qclonesource qclonedest
541 hg qclone qclonesource qclonedest
542 cd qclonedest
542 cd qclonedest
543 qlog
543 qlog
544 cd ..
544 cd ..
545
545
546 # repo with patches unapplied
546 # repo with patches unapplied
547 cd qclonesource
547 cd qclonesource
548 hg qpop -a
548 hg qpop -a
549 qlog
549 qlog
550 cd ..
550 cd ..
551 hg qclone qclonesource qclonedest2
551 hg qclone qclonesource qclonedest2
552 cd qclonedest2
552 cd qclonedest2
553 qlog
553 qlog
554 cd ..
554 cd ..
555
555
556 echo % 'test applying on an empty file (issue 1033)'
556 echo % 'test applying on an empty file (issue 1033)'
557 hg init empty
557 hg init empty
558 cd empty
558 cd empty
559 touch a
559 touch a
560 hg ci -Am addempty
560 hg ci -Am addempty
561 echo a > a
561 echo a > a
562 hg qnew -f -e changea
562 hg qnew -f -e changea
563 hg qpop
563 hg qpop
564 hg qpush
564 hg qpush
565 cd ..
565 cd ..
566
566
567 echo % test qpush with --force, issue1087
567 echo % test qpush with --force, issue1087
568 hg init forcepush
568 hg init forcepush
569 cd forcepush
569 cd forcepush
570 echo hello > hello.txt
570 echo hello > hello.txt
571 echo bye > bye.txt
571 echo bye > bye.txt
572 hg ci -Ama
572 hg ci -Ama
573 hg qnew -d '0 0' empty
573 hg qnew -d '0 0' empty
574 hg qpop
574 hg qpop
575 echo world >> hello.txt
575 echo world >> hello.txt
576
576
577 echo % qpush should fail, local changes
577 echo % qpush should fail, local changes
578 hg qpush
578 hg qpush
579
579
580 echo % apply force, should not discard changes with empty patch
580 echo % apply force, should not discard changes with empty patch
581 hg qpush -f 2>&1 | sed 's,^.*/patch,patch,g'
581 hg qpush -f 2>&1 | sed 's,^.*/patch,patch,g'
582 hg diff --config diff.nodates=True
582 hg diff --config diff.nodates=True
583 hg qdiff --config diff.nodates=True
583 hg qdiff --config diff.nodates=True
584 hg log -l1 -p
584 hg log -l1 -p
585 hg qref -d '0 0'
585 hg qref -d '0 0'
586 hg qpop
586 hg qpop
587 echo universe >> hello.txt
587 echo universe >> hello.txt
588 echo universe >> bye.txt
588 echo universe >> bye.txt
589
589
590 echo % qpush should fail, local changes
590 echo % qpush should fail, local changes
591 hg qpush
591 hg qpush
592
592
593 echo % apply force, should discard changes in hello, but not bye
593 echo % apply force, should discard changes in hello, but not bye
594 hg qpush -f
594 hg qpush -f
595 hg st
595 hg st
596 hg diff --config diff.nodates=True
596 hg diff --config diff.nodates=True
597 hg qdiff --config diff.nodates=True
597 hg qdiff --config diff.nodates=True
598
598
599 echo % test popping revisions not in working dir ancestry
599 echo % test popping revisions not in working dir ancestry
600 hg qseries -v
600 hg qseries -v
601 hg up qparent
601 hg up qparent
602 hg qpop
602 hg qpop
603
603
604 cd ..
604 cd ..
605 hg init deletion-order
605 hg init deletion-order
606 cd deletion-order
606 cd deletion-order
607
607
608 touch a
608 touch a
609 hg ci -Aqm0
609 hg ci -Aqm0
610
610
611 hg qnew rename-dir
611 hg qnew rename-dir
612 hg rm a
612 hg rm a
613 hg qrefresh
613 hg qrefresh
614
614
615 mkdir a b
615 mkdir a b
616 touch a/a b/b
616 touch a/a b/b
617 hg add -q a b
617 hg add -q a b
618 hg qrefresh
618 hg qrefresh
619
619
620 echo % test popping must remove files added in subdirectories first
620 echo % test popping must remove files added in subdirectories first
621 hg qpop
621 hg qpop
622 cd ..
622 cd ..
@@ -1,55 +1,55 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "mq=" >> $HGRCPATH
6 echo "mq=" >> $HGRCPATH
7
7
8 teststrip() {
8 teststrip() {
9 hg up -C $1
9 hg up -C $1
10 echo % before update $1, strip $2
10 echo % before update $1, strip $2
11 hg parents
11 hg parents
12 hg strip $2 | hidebackup
12 hg strip $2 | hidebackup
13 echo % after update $1, strip $2
13 echo % after update $1, strip $2
14 hg parents
14 hg parents
15 hg unbundle -q .hg/strip-backup/*
15 hg unbundle -q .hg/strip-backup/*
16 rm .hg/strip-backup/*
16 rm .hg/strip-backup/*
17 }
17 }
18
18
19 hg init test
19 hg init test
20 cd test
20 cd test
21
21
22 echo foo > bar
22 echo foo > bar
23 hg ci -Ama
23 hg ci -Ama
24
24
25 echo more >> bar
25 echo more >> bar
26 hg ci -Amb
26 hg ci -Amb
27
27
28 echo blah >> bar
28 echo blah >> bar
29 hg ci -Amc
29 hg ci -Amc
30
30
31 hg up 1
31 hg up 1
32 echo blah >> bar
32 echo blah >> bar
33 hg ci -Amd
33 hg ci -Amd
34
34
35 echo final >> bar
35 echo final >> bar
36 hg ci -Ame
36 hg ci -Ame
37
37
38 hg log
38 hg log
39
39
40 teststrip 4 4
40 teststrip 4 4
41 teststrip 4 3
41 teststrip 4 3
42 teststrip 1 4
42 teststrip 1 4
43 teststrip 4 2
43 teststrip 4 2
44 teststrip 4 1
44 teststrip 4 1
45 teststrip null 4
45 teststrip null 4
46
46
47 hg log
47 hg log
48
48
49 hg up -C 2
49 hg up -C 2
50 hg merge 4
50 hg merge 4
51 echo % before strip of merge parent
51 echo % before strip of merge parent
52 hg parents
52 hg parents
53 hg strip 4 2>&1 | hidebackup
53 hg strip 4 2>&1 | hidebackup
54 echo % after strip of merge parent
54 echo % after strip of merge parent
55 hg parents
55 hg parents
@@ -1,40 +1,40 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 hg init a
9 hg init a
10 cd a
10 cd a
11 echo 'c1' >common
11 echo 'c1' >common
12 hg add common
12 hg add common
13 hg commit -d '0 0' -m "C1"
13 hg commit -d '0 0' -m "C1"
14
14
15 echo 'c2' >>common
15 echo 'c2' >>common
16 hg commit -d '1 0' -m "C2"
16 hg commit -d '1 0' -m "C2"
17
17
18 echo 'c3' >>common
18 echo 'c3' >>common
19 hg commit -d '2 0' -m "C3"
19 hg commit -d '2 0' -m "C3"
20
20
21 hg update -C 1
21 hg update -C 1
22 echo 'l1' >>extra
22 echo 'l1' >>extra
23 hg add extra
23 hg add extra
24 hg commit -d '3 0' -m "L1"
24 hg commit -d '3 0' -m "L1"
25
25
26 sed -e 's/c2/l2/' common > common.new
26 sed -e 's/c2/l2/' common > common.new
27 mv common.new common
27 mv common.new common
28 hg commit -d '4 0' -m "L2"
28 hg commit -d '4 0' -m "L2"
29
29
30 hg glog --template '{rev}: {desc}\n'
30 hg glog --template '{rev}: {desc}\n'
31
31
32 echo
32 echo
33 echo '% Conflicting rebase'
33 echo '% Conflicting rebase'
34 hg rebase -s 3 -d 2 | cleanrebase
34 hg rebase -s 3 -d 2 | cleanrebase
35
35
36 echo
36 echo
37 echo '% Abort'
37 echo '% Abort'
38 hg rebase --abort | cleanrebase
38 hg rebase --abort | cleanrebase
39
39
40 hg glog --template '{rev}: {desc}\n'
40 hg glog --template '{rev}: {desc}\n'
@@ -1,106 +1,106 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 createrepo() {
5 createrepo() {
6 rm -rf repo
6 rm -rf repo
7 hg init repo
7 hg init repo
8 cd repo
8 cd repo
9
9
10 echo "a" > a
10 echo "a" > a
11 hg commit -d '0 0' -A -m 'A'
11 hg commit -d '0 0' -A -m 'A'
12
12
13 hg branch branch1
13 hg branch branch1
14 hg commit -d '1 0' -m 'Branch1'
14 hg commit -d '1 0' -m 'Branch1'
15
15
16 echo "b" > b
16 echo "b" > b
17 hg commit -A -d '2 0' -m 'B'
17 hg commit -A -d '2 0' -m 'B'
18
18
19 hg up 0
19 hg up 0
20 hg branch branch2
20 hg branch branch2
21 hg commit -d '3 0' -m 'Branch2'
21 hg commit -d '3 0' -m 'Branch2'
22
22
23 echo "c" > C
23 echo "c" > C
24 hg commit -A -d '4 0' -m 'C'
24 hg commit -A -d '4 0' -m 'C'
25
25
26 hg up 2
26 hg up 2
27 hg branch -f branch2
27 hg branch -f branch2
28 echo "d" > d
28 echo "d" > d
29 hg commit -A -d '5 0' -m 'D'
29 hg commit -A -d '5 0' -m 'D'
30
30
31 echo "e" > e
31 echo "e" > e
32 hg commit -A -d '6 0' -m 'E'
32 hg commit -A -d '6 0' -m 'E'
33
33
34 hg update default
34 hg update default
35
35
36 hg branch branch3
36 hg branch branch3
37 hg commit -d '7 0' -m 'Branch3'
37 hg commit -d '7 0' -m 'Branch3'
38
38
39 echo "f" > f
39 echo "f" > f
40 hg commit -A -d '8 0' -m 'F'
40 hg commit -A -d '8 0' -m 'F'
41 }
41 }
42
42
43 echo
43 echo
44 createrepo > /dev/null 2>&1
44 createrepo > /dev/null 2>&1
45 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
45 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
46
46
47 echo
47 echo
48 echo '% Branches'
48 echo '% Branches'
49 hg branches
49 hg branches
50
50
51 echo
51 echo
52 echo '% Heads'
52 echo '% Heads'
53 hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n'
53 hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n'
54
54
55 echo
55 echo
56 echo '% Rebase part of branch2 (5-6) onto branch3 (8)'
56 echo '% Rebase part of branch2 (5-6) onto branch3 (8)'
57 hg --config extensions.hgext.rebase= rebase --detach -s 5 -d 8 | hidebackup
57 hg --config extensions.hgext.rebase= rebase --detach -s 5 -d 8 | hidebackup
58
58
59 echo
59 echo
60 echo '% Branches'
60 echo '% Branches'
61 hg branches
61 hg branches
62
62
63 echo
63 echo
64 echo '% Heads'
64 echo '% Heads'
65 hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n'
65 hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n'
66
66
67 echo
67 echo
68 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
68 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
69
69
70 echo
70 echo
71 echo '% Rebase head of branch3 (8) onto branch2 (6)'
71 echo '% Rebase head of branch3 (8) onto branch2 (6)'
72 createrepo > /dev/null 2>&1
72 createrepo > /dev/null 2>&1
73 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
73 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
74
74
75 hg --config extensions.hgext.rebase= rebase --detach -s 8 -d 6 | hidebackup
75 hg --config extensions.hgext.rebase= rebase --detach -s 8 -d 6 | hidebackup
76
76
77 echo
77 echo
78 echo '% Branches'
78 echo '% Branches'
79 hg branches
79 hg branches
80
80
81 echo
81 echo
82 echo '% Heads'
82 echo '% Heads'
83 hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n'
83 hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n'
84
84
85 echo
85 echo
86 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
86 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
87 hg verify -q
87 hg verify -q
88
88
89 echo
89 echo
90 echo '% Rebase entire branch3 (7-8) onto branch2 (6)'
90 echo '% Rebase entire branch3 (7-8) onto branch2 (6)'
91 createrepo > /dev/null 2>&1
91 createrepo > /dev/null 2>&1
92 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
92 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
93
93
94 hg --config extensions.hgext.rebase= rebase --detach -s 7 -d 6 | hidebackup
94 hg --config extensions.hgext.rebase= rebase --detach -s 7 -d 6 | hidebackup
95
95
96 echo
96 echo
97 echo '% Branches'
97 echo '% Branches'
98 hg branches
98 hg branches
99
99
100 echo
100 echo
101 echo '% Heads'
101 echo '% Heads'
102 hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n'
102 hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n'
103
103
104 echo
104 echo
105 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
105 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
106 hg verify -q
106 hg verify -q
@@ -1,70 +1,70 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 BASE=`pwd`
9 BASE=`pwd`
10
10
11 addcommit () {
11 addcommit () {
12 echo $1 > $1
12 echo $1 > $1
13 hg add $1
13 hg add $1
14 hg commit -d "${2} 0" -m $1
14 hg commit -d "${2} 0" -m $1
15 }
15 }
16
16
17 commit () {
17 commit () {
18 hg commit -d "${2} 0" -m $1
18 hg commit -d "${2} 0" -m $1
19 }
19 }
20
20
21 createrepo () {
21 createrepo () {
22 cd $BASE
22 cd $BASE
23 rm -rf a
23 rm -rf a
24 hg init a
24 hg init a
25 cd a
25 cd a
26 addcommit "A" 0
26 addcommit "A" 0
27 addcommit "B" 1
27 addcommit "B" 1
28 echo "C" >> A
28 echo "C" >> A
29 commit "C" 2
29 commit "C" 2
30
30
31 hg update -C 0
31 hg update -C 0
32 echo "D" >> A
32 echo "D" >> A
33 commit "D" 3
33 commit "D" 3
34 addcommit "E" 4
34 addcommit "E" 4
35
35
36 hg update -C 0
36 hg update -C 0
37 hg branch 'notdefault'
37 hg branch 'notdefault'
38 echo "F" >> A
38 echo "F" >> A
39 commit "F" 5
39 commit "F" 5
40 }
40 }
41
41
42 echo
42 echo
43 echo "% - Rebasing B onto E - check keep"
43 echo "% - Rebasing B onto E - check keep"
44 createrepo > /dev/null 2>&1
44 createrepo > /dev/null 2>&1
45 hg glog --template '{rev}:{desc}:{branches}\n'
45 hg glog --template '{rev}:{desc}:{branches}\n'
46 hg rebase -s 1 -d 4 --keep | hidebackup
46 hg rebase -s 1 -d 4 --keep | hidebackup
47
47
48 echo
48 echo
49 echo "% - Solve the conflict and go on"
49 echo "% - Solve the conflict and go on"
50 echo 'conflict solved' > A
50 echo 'conflict solved' > A
51 rm A.orig
51 rm A.orig
52 hg resolve -m A
52 hg resolve -m A
53 hg rebase --continue | hidebackup
53 hg rebase --continue | hidebackup
54 hg glog --template '{rev}:{desc}:{branches}\n'
54 hg glog --template '{rev}:{desc}:{branches}\n'
55
55
56 echo
56 echo
57 echo "% - Rebase F onto E - check keepbranches"
57 echo "% - Rebase F onto E - check keepbranches"
58 createrepo > /dev/null 2>&1
58 createrepo > /dev/null 2>&1
59 hg glog --template '{rev}:{desc}:{branches}\n'
59 hg glog --template '{rev}:{desc}:{branches}\n'
60 hg rebase -s 5 -d 4 --keepbranches | hidebackup
60 hg rebase -s 5 -d 4 --keepbranches | hidebackup
61
61
62 echo
62 echo
63 echo "% - Solve the conflict and go on"
63 echo "% - Solve the conflict and go on"
64 echo 'conflict solved' > A
64 echo 'conflict solved' > A
65 rm A.orig
65 rm A.orig
66 hg resolve -m A
66 hg resolve -m A
67 hg rebase --continue 2>&1 | hidebackup
67 hg rebase --continue 2>&1 | hidebackup
68 hg glog --template '{rev}:{desc}:{branches}\n'
68 hg glog --template '{rev}:{desc}:{branches}\n'
69
69
70 exit 0
70 exit 0
@@ -1,177 +1,177 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 BASE=`pwd`
9 BASE=`pwd`
10
10
11 addcommit () {
11 addcommit () {
12 echo $1 > $1
12 echo $1 > $1
13 hg add $1
13 hg add $1
14 hg commit -d "${2} 0" -m $1
14 hg commit -d "${2} 0" -m $1
15 }
15 }
16
16
17 commit () {
17 commit () {
18 hg commit -d "${2} 0" -m $1
18 hg commit -d "${2} 0" -m $1
19 }
19 }
20
20
21 createrepo () {
21 createrepo () {
22 cd $BASE
22 cd $BASE
23 rm -rf a
23 rm -rf a
24 hg init a
24 hg init a
25 cd a
25 cd a
26 addcommit "A" 0
26 addcommit "A" 0
27 addcommit "B" 1
27 addcommit "B" 1
28 addcommit "C" 2
28 addcommit "C" 2
29 addcommit "D" 3
29 addcommit "D" 3
30
30
31 hg update -C 0
31 hg update -C 0
32 addcommit "E" 4
32 addcommit "E" 4
33
33
34 hg update -C 0
34 hg update -C 0
35 addcommit "F" 5
35 addcommit "F" 5
36
36
37 hg merge -r 4
37 hg merge -r 4
38 commit "G" 6
38 commit "G" 6
39
39
40 hg update -C 5
40 hg update -C 5
41 addcommit "H" 7
41 addcommit "H" 7
42 }
42 }
43
43
44 createrepo > /dev/null 2>&1
44 createrepo > /dev/null 2>&1
45 hg glog --template '{rev}: {desc}\n'
45 hg glog --template '{rev}: {desc}\n'
46 echo '% Rebasing B onto H'
46 echo '% Rebasing B onto H'
47 hg up -C 3
47 hg up -C 3
48 hg rebase --collapse --keepbranches | hidebackup
48 hg rebase --collapse --keepbranches | hidebackup
49 hg glog --template '{rev}: {desc}\n'
49 hg glog --template '{rev}: {desc}\n'
50 echo "Expected A, B, C, D, F, H"
50 echo "Expected A, B, C, D, F, H"
51 hg manifest
51 hg manifest
52
52
53 createrepo > /dev/null 2>&1
53 createrepo > /dev/null 2>&1
54 echo
54 echo
55 echo '% Rebasing G onto H'
55 echo '% Rebasing G onto H'
56 hg rebase --base 6 --collapse | hidebackup
56 hg rebase --base 6 --collapse | hidebackup
57 hg glog --template '{rev}: {desc}\n'
57 hg glog --template '{rev}: {desc}\n'
58 echo "Expected A, E, F, H"
58 echo "Expected A, E, F, H"
59 hg manifest
59 hg manifest
60
60
61 createrepocomplex () {
61 createrepocomplex () {
62 cd $BASE
62 cd $BASE
63 rm -rf a
63 rm -rf a
64 hg init a
64 hg init a
65 cd a
65 cd a
66 addcommit "A" 0
66 addcommit "A" 0
67 addcommit "B" 1
67 addcommit "B" 1
68
68
69 hg up 0
69 hg up 0
70 addcommit "C" 2
70 addcommit "C" 2
71 hg merge
71 hg merge
72 commit "D" 3
72 commit "D" 3
73
73
74 hg up 1
74 hg up 1
75 addcommit "E" 4
75 addcommit "E" 4
76
76
77 addcommit "F" 5
77 addcommit "F" 5
78
78
79 hg merge
79 hg merge
80 commit "G" 6
80 commit "G" 6
81
81
82 hg up 0
82 hg up 0
83 addcommit "H" 7
83 addcommit "H" 7
84 }
84 }
85
85
86 echo
86 echo
87 createrepocomplex > /dev/null 2>&1
87 createrepocomplex > /dev/null 2>&1
88 hg glog --template '{rev}: {desc}\n'
88 hg glog --template '{rev}: {desc}\n'
89
89
90 echo
90 echo
91 echo '% Rebase and collapse - more than one external (fail)'
91 echo '% Rebase and collapse - more than one external (fail)'
92 hg rebase -s 2 --collapse
92 hg rebase -s 2 --collapse
93
93
94 echo
94 echo
95 echo '% Rebase and collapse - E onto H'
95 echo '% Rebase and collapse - E onto H'
96 hg rebase -s 4 --collapse | hidebackup
96 hg rebase -s 4 --collapse | hidebackup
97 hg glog --template '{rev}: {desc}\n'
97 hg glog --template '{rev}: {desc}\n'
98 echo "Expected A, B, C, E, F, H"
98 echo "Expected A, B, C, E, F, H"
99 hg manifest
99 hg manifest
100
100
101 createrepocomplex () {
101 createrepocomplex () {
102 cd $BASE
102 cd $BASE
103 rm -rf a
103 rm -rf a
104 hg init a
104 hg init a
105 cd a
105 cd a
106 addcommit "A" 0
106 addcommit "A" 0
107 addcommit "B" 1
107 addcommit "B" 1
108
108
109 hg up 0
109 hg up 0
110 addcommit "C" 2
110 addcommit "C" 2
111 hg merge
111 hg merge
112 commit "D" 3
112 commit "D" 3
113
113
114 hg up 1
114 hg up 1
115 addcommit "E" 4
115 addcommit "E" 4
116
116
117 echo "F" > E
117 echo "F" > E
118 commit "F" 5
118 commit "F" 5
119
119
120 addcommit "G" 6
120 addcommit "G" 6
121
121
122 hg merge
122 hg merge
123 commit "H" 7
123 commit "H" 7
124
124
125 hg up 0
125 hg up 0
126 addcommit "I" 8
126 addcommit "I" 8
127 }
127 }
128
128
129 echo
129 echo
130 createrepocomplex > /dev/null 2>&1
130 createrepocomplex > /dev/null 2>&1
131 hg glog --template '{rev}: {desc}\n'
131 hg glog --template '{rev}: {desc}\n'
132
132
133 echo
133 echo
134 echo '% Rebase and collapse - E onto I'
134 echo '% Rebase and collapse - E onto I'
135 hg rebase -s 4 --collapse | hidebackup
135 hg rebase -s 4 --collapse | hidebackup
136
136
137 hg glog --template '{rev}: {desc}\n'
137 hg glog --template '{rev}: {desc}\n'
138
138
139 echo "Expected A, B, C, E, G, I"
139 echo "Expected A, B, C, E, G, I"
140 hg manifest
140 hg manifest
141
141
142 echo 'Cat E:'
142 echo 'Cat E:'
143 cat E
143 cat E
144
144
145 createrepocomplex () {
145 createrepocomplex () {
146 cd $BASE
146 cd $BASE
147 rm -rf a
147 rm -rf a
148 hg init a
148 hg init a
149 cd a
149 cd a
150 addcommit "A" 0
150 addcommit "A" 0
151 addcommit "B" 1
151 addcommit "B" 1
152
152
153 addcommit "C" 2
153 addcommit "C" 2
154 hg up 1
154 hg up 1
155
155
156 addcommit "D" 3
156 addcommit "D" 3
157
157
158 hg merge
158 hg merge
159 commit "E" 4
159 commit "E" 4
160
160
161 hg up 0
161 hg up 0
162 addcommit "F" 5
162 addcommit "F" 5
163 }
163 }
164
164
165 echo
165 echo
166 createrepocomplex > /dev/null 2>&1
166 createrepocomplex > /dev/null 2>&1
167 hg glog --template '{rev}: {desc}\n'
167 hg glog --template '{rev}: {desc}\n'
168
168
169 echo
169 echo
170 echo '% Rebase and collapse - B onto F'
170 echo '% Rebase and collapse - B onto F'
171 hg rebase -s 1 --collapse | hidebackup
171 hg rebase -s 1 --collapse | hidebackup
172
172
173 hg glog --template '{rev}: {desc}\n'
173 hg glog --template '{rev}: {desc}\n'
174
174
175 echo "Expected A, B, C, D, F"
175 echo "Expected A, B, C, D, F"
176 hg manifest
176 hg manifest
177 exit 0
177 exit 0
@@ -1,74 +1,74 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 hg init a
9 hg init a
10 cd a
10 cd a
11 echo 'c1' >common
11 echo 'c1' >common
12 hg add common
12 hg add common
13 hg commit -d '0 0' -m "C1"
13 hg commit -d '0 0' -m "C1"
14
14
15 echo 'c2' >>common
15 echo 'c2' >>common
16 hg commit -d '1 0' -m "C2"
16 hg commit -d '1 0' -m "C2"
17
17
18 echo 'c3' >>common
18 echo 'c3' >>common
19 hg commit -d '2 0' -m "C3"
19 hg commit -d '2 0' -m "C3"
20
20
21 hg update -C 1
21 hg update -C 1
22 echo 'l1' >>extra
22 echo 'l1' >>extra
23 hg add extra
23 hg add extra
24 hg commit -d '3 0' -m "L1"
24 hg commit -d '3 0' -m "L1"
25
25
26 sed -e 's/c2/l2/' common > common.new
26 sed -e 's/c2/l2/' common > common.new
27 mv common.new common
27 mv common.new common
28 hg commit -d '4 0' -m "L2"
28 hg commit -d '4 0' -m "L2"
29
29
30 echo 'l3' >> extra2
30 echo 'l3' >> extra2
31 hg add extra2
31 hg add extra2
32 hg commit -d '5 0' -m "L3"
32 hg commit -d '5 0' -m "L3"
33
33
34 hg glog --template '{rev}: {desc}\n'
34 hg glog --template '{rev}: {desc}\n'
35
35
36 echo
36 echo
37 echo '% Try to call --continue'
37 echo '% Try to call --continue'
38 hg rebase --continue
38 hg rebase --continue
39
39
40 echo
40 echo
41 echo '% Conflicting rebase'
41 echo '% Conflicting rebase'
42 hg rebase -s 3 -d 2
42 hg rebase -s 3 -d 2
43
43
44 echo
44 echo
45 echo '% Try to continue without solving the conflict'
45 echo '% Try to continue without solving the conflict'
46 hg rebase --continue
46 hg rebase --continue
47
47
48 echo
48 echo
49 echo '% Conclude rebase'
49 echo '% Conclude rebase'
50 echo 'resolved merge' >common
50 echo 'resolved merge' >common
51 hg resolve -m common
51 hg resolve -m common
52 hg rebase --continue | cleanrebase
52 hg rebase --continue | cleanrebase
53
53
54 hg glog --template '{rev}: {desc}\n'
54 hg glog --template '{rev}: {desc}\n'
55
55
56 echo
56 echo
57 echo '% Check correctness'
57 echo '% Check correctness'
58 echo ' - Rev. 0'
58 echo ' - Rev. 0'
59 hg cat -r 0 common
59 hg cat -r 0 common
60
60
61 echo ' - Rev. 1'
61 echo ' - Rev. 1'
62 hg cat -r 1 common
62 hg cat -r 1 common
63
63
64 echo ' - Rev. 2'
64 echo ' - Rev. 2'
65 hg cat -r 2 common
65 hg cat -r 2 common
66
66
67 echo ' - Rev. 3'
67 echo ' - Rev. 3'
68 hg cat -r 3 common
68 hg cat -r 3 common
69
69
70 echo ' - Rev. 4'
70 echo ' - Rev. 4'
71 hg cat -r 4 common
71 hg cat -r 4 common
72
72
73 echo ' - Rev. 5'
73 echo ' - Rev. 5'
74 hg cat -r 5 common
74 hg cat -r 5 common
@@ -1,70 +1,70 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 BASE=`pwd`
9 BASE=`pwd`
10
10
11 addcommit () {
11 addcommit () {
12 echo $1 > $1
12 echo $1 > $1
13 hg add $1
13 hg add $1
14 hg commit -d "${2} 0" -m $1
14 hg commit -d "${2} 0" -m $1
15 }
15 }
16
16
17 commit () {
17 commit () {
18 hg commit -d "${2} 0" -m $1
18 hg commit -d "${2} 0" -m $1
19 }
19 }
20
20
21 createrepo () {
21 createrepo () {
22 cd $BASE
22 cd $BASE
23 rm -rf a
23 rm -rf a
24 hg init a
24 hg init a
25 cd a
25 cd a
26 addcommit "A" 0
26 addcommit "A" 0
27 addcommit "B" 1
27 addcommit "B" 1
28 addcommit "C" 2
28 addcommit "C" 2
29 addcommit "D" 3
29 addcommit "D" 3
30
30
31 hg update -C 0
31 hg update -C 0
32 addcommit "E" 4
32 addcommit "E" 4
33 }
33 }
34
34
35 createrepo > /dev/null 2>&1
35 createrepo > /dev/null 2>&1
36 hg glog --template '{rev}: {desc}\n'
36 hg glog --template '{rev}: {desc}\n'
37 echo '% Rebasing D onto E detaching from C'
37 echo '% Rebasing D onto E detaching from C'
38 hg rebase --detach -s 3 -d 4 | hidebackup
38 hg rebase --detach -s 3 -d 4 | hidebackup
39 hg glog --template '{rev}: {desc}\n'
39 hg glog --template '{rev}: {desc}\n'
40 echo "Expected A, D, E"
40 echo "Expected A, D, E"
41 hg manifest
41 hg manifest
42
42
43 echo
43 echo
44 createrepo > /dev/null 2>&1
44 createrepo > /dev/null 2>&1
45 hg glog --template '{rev}: {desc}\n'
45 hg glog --template '{rev}: {desc}\n'
46 echo '% Rebasing C onto E detaching from B'
46 echo '% Rebasing C onto E detaching from B'
47 hg rebase --detach -s 2 -d 4 | hidebackup
47 hg rebase --detach -s 2 -d 4 | hidebackup
48 hg glog --template '{rev}: {desc}\n'
48 hg glog --template '{rev}: {desc}\n'
49 echo "Expected A, C, D, E"
49 echo "Expected A, C, D, E"
50 hg manifest
50 hg manifest
51
51
52 echo
52 echo
53 createrepo > /dev/null 2>&1
53 createrepo > /dev/null 2>&1
54 hg glog --template '{rev}: {desc}\n'
54 hg glog --template '{rev}: {desc}\n'
55 echo '% Rebasing B onto E using detach (same as not using it)'
55 echo '% Rebasing B onto E using detach (same as not using it)'
56 hg rebase --detach -s 1 -d 4 | hidebackup
56 hg rebase --detach -s 1 -d 4 | hidebackup
57 hg glog --template '{rev}: {desc}\n'
57 hg glog --template '{rev}: {desc}\n'
58 echo "Expected A, B, C, D, E"
58 echo "Expected A, B, C, D, E"
59 hg manifest
59 hg manifest
60
60
61 echo
61 echo
62 createrepo > /dev/null 2>&1
62 createrepo > /dev/null 2>&1
63 hg glog --template '{rev}: {desc}\n'
63 hg glog --template '{rev}: {desc}\n'
64 echo '% Rebasing C onto E detaching from B and collapsing'
64 echo '% Rebasing C onto E detaching from B and collapsing'
65 hg rebase --detach --collapse -s 2 -d 4 | hidebackup
65 hg rebase --detach --collapse -s 2 -d 4 | hidebackup
66 hg glog --template '{rev}: {desc}\n'
66 hg glog --template '{rev}: {desc}\n'
67 echo "Expected A, C, D, E"
67 echo "Expected A, C, D, E"
68 hg manifest
68 hg manifest
69
69
70 exit 0
70 exit 0
@@ -1,83 +1,83 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4 echo "[extensions]" >> $HGRCPATH
4 echo "[extensions]" >> $HGRCPATH
5 echo "graphlog=" >> $HGRCPATH
5 echo "graphlog=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
7
7
8 BASE=`pwd`
8 BASE=`pwd`
9
9
10 addcommit () {
10 addcommit () {
11 echo $1 > $1
11 echo $1 > $1
12 hg add $1
12 hg add $1
13 hg commit -d "${2} 0" -m $1
13 hg commit -d "${2} 0" -m $1
14 }
14 }
15
15
16 commit () {
16 commit () {
17 hg commit -d "${2} 0" -m $1
17 hg commit -d "${2} 0" -m $1
18 }
18 }
19
19
20 createrepo () {
20 createrepo () {
21 cd $BASE
21 cd $BASE
22 rm -rf a
22 rm -rf a
23 hg init a
23 hg init a
24 cd a
24 cd a
25 addcommit "A" 0
25 addcommit "A" 0
26 addcommit "B" 1
26 addcommit "B" 1
27 echo "C" >> A
27 echo "C" >> A
28 commit "C" 2
28 commit "C" 2
29
29
30 hg update -C 0
30 hg update -C 0
31 echo "D" >> A
31 echo "D" >> A
32 commit "D" 3
32 commit "D" 3
33 addcommit "E" 4
33 addcommit "E" 4
34 }
34 }
35
35
36 echo "% Changes during an interruption - continue"
36 echo "% Changes during an interruption - continue"
37 createrepo > /dev/null 2>&1
37 createrepo > /dev/null 2>&1
38 hg glog --template '{rev}: {desc}\n'
38 hg glog --template '{rev}: {desc}\n'
39
39
40 echo
40 echo
41 echo "% - Rebasing B onto E"
41 echo "% - Rebasing B onto E"
42 hg rebase -s 1 -d 4 | hidebackup
42 hg rebase -s 1 -d 4 | hidebackup
43
43
44 echo
44 echo
45 echo "% - Force a commit on C during the interruption"
45 echo "% - Force a commit on C during the interruption"
46 hg update -C 2
46 hg update -C 2
47 addcommit "Extra" 5
47 addcommit "Extra" 5
48 hg glog --template '{rev}: {desc}\n'
48 hg glog --template '{rev}: {desc}\n'
49
49
50 echo
50 echo
51 echo "% - Resume the rebasing"
51 echo "% - Resume the rebasing"
52 hg rebase --continue
52 hg rebase --continue
53
53
54 echo
54 echo
55 echo "% - Solve the conflict and go on"
55 echo "% - Solve the conflict and go on"
56 echo 'conflict solved' > A
56 echo 'conflict solved' > A
57 rm A.orig
57 rm A.orig
58 hg resolve -m A
58 hg resolve -m A
59 hg rebase --continue
59 hg rebase --continue
60 hg glog --template '{rev}: {desc}\n'
60 hg glog --template '{rev}: {desc}\n'
61
61
62 echo
62 echo
63 echo
63 echo
64 echo "% Changes during an interruption - abort"
64 echo "% Changes during an interruption - abort"
65 createrepo > /dev/null 2>&1
65 createrepo > /dev/null 2>&1
66 hg glog --template '{rev}: {desc}\n'
66 hg glog --template '{rev}: {desc}\n'
67
67
68 echo
68 echo
69 echo "% Rebasing B onto E"
69 echo "% Rebasing B onto E"
70 hg rebase -s 1 -d 4 | hidebackup
70 hg rebase -s 1 -d 4 | hidebackup
71
71
72 echo
72 echo
73 echo "% Force a commit on B' during the interruption"
73 echo "% Force a commit on B' during the interruption"
74 hg update -C 5
74 hg update -C 5
75 addcommit "Extra" 6
75 addcommit "Extra" 6
76 hg glog --template '{rev}: {desc}\n'
76 hg glog --template '{rev}: {desc}\n'
77
77
78 echo
78 echo
79 echo "% Abort the rebasing"
79 echo "% Abort the rebasing"
80 hg rebase --abort
80 hg rebase --abort
81 hg glog --template '{rev}: {desc}\n'
81 hg glog --template '{rev}: {desc}\n'
82
82
83 exit 0
83 exit 0
@@ -1,51 +1,51 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 addcommit () {
9 addcommit () {
10 echo $1 > $1
10 echo $1 > $1
11 hg add $1
11 hg add $1
12 hg commit -d "${2} 0" -m $1
12 hg commit -d "${2} 0" -m $1
13 }
13 }
14
14
15 hg init a
15 hg init a
16 cd a
16 cd a
17 addcommit "c1" 0
17 addcommit "c1" 0
18 addcommit "c2" 1
18 addcommit "c2" 1
19
19
20 addcommit "l1" 2
20 addcommit "l1" 2
21
21
22 hg update -C 1
22 hg update -C 1
23 addcommit "r1" 3
23 addcommit "r1" 3
24 addcommit "r2" 4
24 addcommit "r2" 4
25 hg glog --template '{rev}:{desc}\n'
25 hg glog --template '{rev}:{desc}\n'
26
26
27 echo
27 echo
28 echo '% Rebase with no arguments - single revision in source branch'
28 echo '% Rebase with no arguments - single revision in source branch'
29 hg update -C 2
29 hg update -C 2
30 hg rebase | hidebackup
30 hg rebase | hidebackup
31 hg glog --template '{rev}:{desc}\n'
31 hg glog --template '{rev}:{desc}\n'
32
32
33 cd ..
33 cd ..
34 rm -rf a
34 rm -rf a
35 hg init a
35 hg init a
36 cd a
36 cd a
37 addcommit "c1" 0
37 addcommit "c1" 0
38 addcommit "c2" 1
38 addcommit "c2" 1
39
39
40 addcommit "l1" 2
40 addcommit "l1" 2
41 addcommit "l2" 3
41 addcommit "l2" 3
42
42
43 hg update -C 1
43 hg update -C 1
44 addcommit "r1" 4
44 addcommit "r1" 4
45 hg glog --template '{rev}:{desc}\n'
45 hg glog --template '{rev}:{desc}\n'
46
46
47 echo
47 echo
48 echo '% Rebase with no arguments - single revision in target branch'
48 echo '% Rebase with no arguments - single revision in target branch'
49 hg update -C 3
49 hg update -C 3
50 hg rebase 2>&1 | hidebackup
50 hg rebase 2>&1 | hidebackup
51 hg glog --template '{rev}:{desc}\n'
51 hg glog --template '{rev}:{desc}\n'
@@ -1,123 +1,123 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8 echo "mq=" >> $HGRCPATH
8 echo "mq=" >> $HGRCPATH
9
9
10 echo "[mq]" >> $HGRCPATH
10 echo "[mq]" >> $HGRCPATH
11 echo "plain=true" >> $HGRCPATH
11 echo "plain=true" >> $HGRCPATH
12
12
13 filterpatch()
13 filterpatch()
14 {
14 {
15 sed -e "s/^\(# Date\).*/\1/" \
15 sed -e "s/^\(# Date\).*/\1/" \
16 -e "s/^\(# Node ID\).*/\1/" \
16 -e "s/^\(# Node ID\).*/\1/" \
17 -e "s/^\(# Parent\).*/\1/" \
17 -e "s/^\(# Parent\).*/\1/" \
18 -e "s/^\(diff -r \)\([a-f0-9]* \)\(-r \)\([a-f0-9]* \)/\1x \3y /" \
18 -e "s/^\(diff -r \)\([a-f0-9]* \)\(-r \)\([a-f0-9]* \)/\1x \3y /" \
19 -e "s/^\(diff -r \)\([a-f0-9]* \)/\1x /" \
19 -e "s/^\(diff -r \)\([a-f0-9]* \)/\1x /" \
20 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \
20 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \
21 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/"
21 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/"
22 }
22 }
23
23
24 hg init a
24 hg init a
25 cd a
25 cd a
26 hg qinit -c # This must work even with a managed mq queue
26 hg qinit -c # This must work even with a managed mq queue
27
27
28 echo 'c1' > f
28 echo 'c1' > f
29 hg add f
29 hg add f
30 hg commit -d '0 0' -m "C1"
30 hg commit -d '0 0' -m "C1"
31
31
32 echo 'r1' > f
32 echo 'r1' > f
33 hg commit -d '2 0' -m "R1"
33 hg commit -d '2 0' -m "R1"
34
34
35 hg up 0
35 hg up 0
36 hg qnew f.patch
36 hg qnew f.patch
37 echo 'mq1' > f
37 echo 'mq1' > f
38 hg qref -m 'P0'
38 hg qref -m 'P0'
39
39
40 hg qnew f2.patch
40 hg qnew f2.patch
41 echo 'mq2' > f
41 echo 'mq2' > f
42 hg qref -m 'P1'
42 hg qref -m 'P1'
43 hg glog --template '{rev} {desc} tags: {tags}\n'
43 hg glog --template '{rev} {desc} tags: {tags}\n'
44
44
45 echo
45 echo
46 echo '% Rebase - try to rebase on an applied mq patch'
46 echo '% Rebase - try to rebase on an applied mq patch'
47 hg rebase -s 1 -d 3
47 hg rebase -s 1 -d 3
48
48
49 echo
49 echo
50 echo '% Rebase - same thing, but mq patch is default dest'
50 echo '% Rebase - same thing, but mq patch is default dest'
51 hg update -q 1
51 hg update -q 1
52 hg rebase
52 hg rebase
53 hg update -q qtip
53 hg update -q qtip
54
54
55 echo
55 echo
56 echo '% Rebase - generate a conflict'
56 echo '% Rebase - generate a conflict'
57 hg rebase -s 2 -d 1
57 hg rebase -s 2 -d 1
58
58
59 echo
59 echo
60 echo '% Fix the 1st conflict'
60 echo '% Fix the 1st conflict'
61 echo 'mq1r1' > f
61 echo 'mq1r1' > f
62 hg resolve -m f
62 hg resolve -m f
63 hg rebase -c | hidebackup
63 hg rebase -c | hidebackup
64
64
65 echo
65 echo
66 echo '% Fix the 2nd conflict'
66 echo '% Fix the 2nd conflict'
67 echo 'mq1r1mq2' > f
67 echo 'mq1r1mq2' > f
68 hg resolve -m f
68 hg resolve -m f
69 hg rebase -c | hidebackup
69 hg rebase -c | hidebackup
70
70
71 hg glog --template '{rev} {desc} tags: {tags}\n'
71 hg glog --template '{rev} {desc} tags: {tags}\n'
72
72
73 echo
73 echo
74 echo '% Update to qbase'
74 echo '% Update to qbase'
75 hg up qbase
75 hg up qbase
76 echo '% f correctly reflects the merge result'
76 echo '% f correctly reflects the merge result'
77 cat f
77 cat f
78 echo '% And the patch is correct'
78 echo '% And the patch is correct'
79 cat .hg/patches/f.patch | filterpatch
79 cat .hg/patches/f.patch | filterpatch
80
80
81 echo
81 echo
82 echo '% Update to qtip'
82 echo '% Update to qtip'
83 hg up qtip
83 hg up qtip
84 echo '% f correctly reflects the merge result'
84 echo '% f correctly reflects the merge result'
85 cat f
85 cat f
86 echo '% And the patch is correct'
86 echo '% And the patch is correct'
87 cat .hg/patches/f2.patch | filterpatch
87 cat .hg/patches/f2.patch | filterpatch
88
88
89 echo
89 echo
90 echo '% Adding one git-style patch and one normal'
90 echo '% Adding one git-style patch and one normal'
91 hg qpop -a
91 hg qpop -a
92 rm -fr .hg/patches
92 rm -fr .hg/patches
93 hg qinit -c
93 hg qinit -c
94
94
95 hg up 0
95 hg up 0
96 hg qnew --git f_git.patch
96 hg qnew --git f_git.patch
97 echo 'mq1' > p
97 echo 'mq1' > p
98 hg add p
98 hg add p
99 hg qref --git -m 'P0 (git)'
99 hg qref --git -m 'P0 (git)'
100
100
101 hg qnew f.patch
101 hg qnew f.patch
102 echo 'mq2' > p
102 echo 'mq2' > p
103 hg qref -m 'P1'
103 hg qref -m 'P1'
104
104
105 echo '% Git patch'
105 echo '% Git patch'
106 cat .hg/patches/f_git.patch | filterpatch
106 cat .hg/patches/f_git.patch | filterpatch
107
107
108 echo
108 echo
109 echo '% Normal patch'
109 echo '% Normal patch'
110 cat .hg/patches/f.patch | filterpatch
110 cat .hg/patches/f.patch | filterpatch
111
111
112 echo
112 echo
113 echo '% Rebase the applied mq patches'
113 echo '% Rebase the applied mq patches'
114 hg rebase -s 2 -d 1 --quiet
114 hg rebase -s 2 -d 1 --quiet
115
115
116 echo '% And the patches are correct'
116 echo '% And the patches are correct'
117 echo '% Git patch'
117 echo '% Git patch'
118 cat .hg/patches/f_git.patch | filterpatch
118 cat .hg/patches/f_git.patch | filterpatch
119
119
120 echo
120 echo
121 echo '% Normal patch'
121 echo '% Normal patch'
122 cat .hg/patches/f.patch | filterpatch
122 cat .hg/patches/f.patch | filterpatch
123
123
@@ -1,46 +1,46 b''
1 #!/bin/sh
1 #!/bin/sh
2 # This emulates the effects of an hg pull --rebase in which the remote repo
2 # This emulates the effects of an hg pull --rebase in which the remote repo
3 # already has one local mq patch
3 # already has one local mq patch
4
4
5 source $TESTDIR/helpers.sh
5 . $TESTDIR/helpers.sh
6
6
7 echo "[extensions]" >> $HGRCPATH
7 echo "[extensions]" >> $HGRCPATH
8 echo "graphlog=" >> $HGRCPATH
8 echo "graphlog=" >> $HGRCPATH
9 echo "rebase=" >> $HGRCPATH
9 echo "rebase=" >> $HGRCPATH
10 echo "mq=" >> $HGRCPATH
10 echo "mq=" >> $HGRCPATH
11
11
12 hg init a
12 hg init a
13 cd a
13 cd a
14 hg qinit -c # This must work even with a managed mq queue
14 hg qinit -c # This must work even with a managed mq queue
15
15
16 echo 'c1' > c1
16 echo 'c1' > c1
17 hg add c1
17 hg add c1
18 hg commit -d '0 0' -m "C1"
18 hg commit -d '0 0' -m "C1"
19
19
20 echo 'r1' > r1
20 echo 'r1' > r1
21 hg add r1
21 hg add r1
22 hg commit -d '1 0' -m "R1"
22 hg commit -d '1 0' -m "R1"
23
23
24 hg up 0
24 hg up 0
25 hg qnew p0.patch
25 hg qnew p0.patch
26 echo 'p0' > p0
26 echo 'p0' > p0
27 hg add p0
27 hg add p0
28 hg qref -m 'P0'
28 hg qref -m 'P0'
29
29
30 hg qnew p1.patch
30 hg qnew p1.patch
31 echo 'p1' > p1
31 echo 'p1' > p1
32 hg add p1
32 hg add p1
33 hg qref -m 'P1'
33 hg qref -m 'P1'
34 hg export qtip > p1.patch
34 hg export qtip > p1.patch
35
35
36 echo
36 echo
37 echo '% "Mainstream" import p1.patch'
37 echo '% "Mainstream" import p1.patch'
38 hg up -C 1
38 hg up -C 1
39 hg import p1.patch
39 hg import p1.patch
40 rm p1.patch
40 rm p1.patch
41
41
42 echo
42 echo
43 echo '% Rebase'
43 echo '% Rebase'
44 hg up -C qtip
44 hg up -C qtip
45 hg rebase | hidebackup
45 hg rebase | hidebackup
46 hg glog --template '{rev} {desc} tags: {tags}\n'
46 hg glog --template '{rev} {desc} tags: {tags}\n'
@@ -1,33 +1,33 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 rm -rf repo
9 rm -rf repo
10 hg init repo
10 hg init repo
11 cd repo
11 cd repo
12
12
13 echo A > a
13 echo A > a
14 echo >> a
14 echo >> a
15 hg commit -AmA -u test -d '0 0'
15 hg commit -AmA -u test -d '0 0'
16
16
17 echo B > a
17 echo B > a
18 echo >> a
18 echo >> a
19 hg commit -mB -u test -d '1 0'
19 hg commit -mB -u test -d '1 0'
20
20
21 echo C > a
21 echo C > a
22 echo >> a
22 echo >> a
23 hg commit -mC -u test -d '2 0'
23 hg commit -mC -u test -d '2 0'
24
24
25 hg up -C 0
25 hg up -C 0
26 echo D >> a
26 echo D >> a
27 hg commit -AmAD -u test -d '3 0'
27 hg commit -AmAD -u test -d '3 0'
28
28
29 hg glog --template '{rev}:{desc} {node|short}\n'
29 hg glog --template '{rev}:{desc} {node|short}\n'
30 hg rebase -q -s 1 -d 3 | hidebackup
30 hg rebase -q -s 1 -d 3 | hidebackup
31 hg glog --template '{rev}:{desc} {node|short}\n'
31 hg glog --template '{rev}:{desc} {node|short}\n'
32
32
33 exit 0
33 exit 0
@@ -1,110 +1,110 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
7
7
8 addcommit () {
8 addcommit () {
9 echo $1 > $1
9 echo $1 > $1
10 hg add $1
10 hg add $1
11 hg commit -d "${2} 0" -m $1
11 hg commit -d "${2} 0" -m $1
12 }
12 }
13
13
14 commit () {
14 commit () {
15 hg commit -d "${2} 0" -m $1
15 hg commit -d "${2} 0" -m $1
16 }
16 }
17
17
18 createrepo () {
18 createrepo () {
19 hg init a
19 hg init a
20 cd a
20 cd a
21 addcommit "c1" 0
21 addcommit "c1" 0
22 addcommit "c2" 1
22 addcommit "c2" 1
23 addcommit "c3" 2
23 addcommit "c3" 2
24
24
25 hg update -C 1
25 hg update -C 1
26 addcommit "l1" 3
26 addcommit "l1" 3
27 addcommit "l2" 4
27 addcommit "l2" 4
28 addcommit "l3" 5
28 addcommit "l3" 5
29
29
30 hg update -C 2
30 hg update -C 2
31 addcommit "r1" 6
31 addcommit "r1" 6
32 addcommit "r2" 7
32 addcommit "r2" 7
33 }
33 }
34
34
35 createrepo > /dev/null 2>&1
35 createrepo > /dev/null 2>&1
36 echo "% These fail"
36 echo "% These fail"
37 echo
37 echo
38 echo "% Use continue and abort"
38 echo "% Use continue and abort"
39 hg rebase --continue --abort
39 hg rebase --continue --abort
40
40
41 echo
41 echo
42 echo "% Use continue and collapse"
42 echo "% Use continue and collapse"
43 hg rebase --continue --collapse
43 hg rebase --continue --collapse
44
44
45 echo
45 echo
46 echo "% Use continue/abort and dest/source"
46 echo "% Use continue/abort and dest/source"
47 hg rebase --continue --dest 4
47 hg rebase --continue --dest 4
48
48
49 echo
49 echo
50 echo "% Use source and base"
50 echo "% Use source and base"
51 hg rebase --base 5 --source 4
51 hg rebase --base 5 --source 4
52
52
53 echo
53 echo
54 echo "% Rebase with no arguments - from current"
54 echo "% Rebase with no arguments - from current"
55 hg rebase
55 hg rebase
56
56
57 echo
57 echo
58 echo "% Rebase with no arguments - from the current branch"
58 echo "% Rebase with no arguments - from the current branch"
59 hg update 6
59 hg update 6
60 hg rebase
60 hg rebase
61
61
62 echo "% ----------"
62 echo "% ----------"
63 echo "% These work"
63 echo "% These work"
64 echo
64 echo
65 echo "% Rebase with no arguments (from 3 onto 7)"
65 echo "% Rebase with no arguments (from 3 onto 7)"
66 hg update -C 5
66 hg update -C 5
67 hg rebase 2>&1 | hidebackup
67 hg rebase 2>&1 | hidebackup
68
68
69 echo "% Try to rollback after a rebase (fail)"
69 echo "% Try to rollback after a rebase (fail)"
70 hg rollback
70 hg rollback
71
71
72 createrepo > /dev/null 2>&1
72 createrepo > /dev/null 2>&1
73 echo
73 echo
74 echo "% Rebase with base == '.' => same as no arguments (from 3 onto 7)"
74 echo "% Rebase with base == '.' => same as no arguments (from 3 onto 7)"
75 hg update -C 5
75 hg update -C 5
76 hg rebase --base . | hidebackup
76 hg rebase --base . | hidebackup
77
77
78 createrepo > /dev/null 2>&1
78 createrepo > /dev/null 2>&1
79 echo
79 echo
80 echo "% Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7)"
80 echo "% Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7)"
81 hg update -C 5
81 hg update -C 5
82 hg rebase --dest `hg branch` | hidebackup
82 hg rebase --dest `hg branch` | hidebackup
83
83
84 createrepo > /dev/null 2>&1
84 createrepo > /dev/null 2>&1
85 echo
85 echo
86 echo "% Specify only source (from 4 onto 7)"
86 echo "% Specify only source (from 4 onto 7)"
87 hg rebase --source 4 | hidebackup
87 hg rebase --source 4 | hidebackup
88
88
89 createrepo > /dev/null 2>&1
89 createrepo > /dev/null 2>&1
90 echo
90 echo
91 echo "% Specify only dest (from 3 onto 6)"
91 echo "% Specify only dest (from 3 onto 6)"
92 hg update -C 5
92 hg update -C 5
93 hg rebase --dest 6 | hidebackup
93 hg rebase --dest 6 | hidebackup
94
94
95 createrepo > /dev/null 2>&1
95 createrepo > /dev/null 2>&1
96 echo
96 echo
97 echo "% Specify only base (from 3 onto 7)"
97 echo "% Specify only base (from 3 onto 7)"
98 hg rebase --base 5 | hidebackup
98 hg rebase --base 5 | hidebackup
99
99
100 createrepo > /dev/null 2>&1
100 createrepo > /dev/null 2>&1
101 echo
101 echo
102 echo "% Specify source and dest (from 4 onto 6)"
102 echo "% Specify source and dest (from 4 onto 6)"
103 hg rebase --source 4 --dest 6 | hidebackup
103 hg rebase --source 4 --dest 6 | hidebackup
104
104
105 createrepo > /dev/null 2>&1
105 createrepo > /dev/null 2>&1
106 echo
106 echo
107 echo "% Specify base and dest (from 3 onto 6)"
107 echo "% Specify base and dest (from 3 onto 6)"
108 hg rebase --base 4 --dest 6 | hidebackup
108 hg rebase --base 4 --dest 6 | hidebackup
109
109
110 exit 0
110 exit 0
@@ -1,63 +1,63 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 addcommit () {
9 addcommit () {
10 echo $1 > $1
10 echo $1 > $1
11 hg add $1
11 hg add $1
12 hg commit -d "${2} 0" -m $1
12 hg commit -d "${2} 0" -m $1
13 }
13 }
14
14
15 commit () {
15 commit () {
16 hg commit -d "${2} 0" -m $1
16 hg commit -d "${2} 0" -m $1
17 }
17 }
18
18
19 rm -rf a
19 rm -rf a
20 hg init a
20 hg init a
21 cd a
21 cd a
22 addcommit "C1" 0
22 addcommit "C1" 0
23 addcommit "C2" 1
23 addcommit "C2" 1
24
24
25 cd ..
25 cd ..
26 hg clone a b
26 hg clone a b
27 # This is needed to test pull --rebase
27 # This is needed to test pull --rebase
28 hg clone a c
28 hg clone a c
29
29
30 cd b
30 cd b
31 addcommit "L1" 2
31 addcommit "L1" 2
32
32
33 cd ../a
33 cd ../a
34 addcommit "R1" 3
34 addcommit "R1" 3
35
35
36 cd ../b
36 cd ../b
37 echo
37 echo
38 echo "% Now b has one revision to be pulled from a"
38 echo "% Now b has one revision to be pulled from a"
39 hg pull --rebase | hidebackup | sed -e 's/\(pulling from \).*/\1/'
39 hg pull --rebase | hidebackup | sed -e 's/\(pulling from \).*/\1/'
40
40
41 hg glog --template '{rev}:{desc}\n'
41 hg glog --template '{rev}:{desc}\n'
42
42
43 echo
43 echo
44 echo "% Re-run pull --rebase"
44 echo "% Re-run pull --rebase"
45 hg pull --rebase | sed 's/\(pulling from \).*/\1/'
45 hg pull --rebase | sed 's/\(pulling from \).*/\1/'
46
46
47 echo
47 echo
48 echo "% Invoke pull --rebase and nothing to rebase"
48 echo "% Invoke pull --rebase and nothing to rebase"
49 cd ../c
49 cd ../c
50 hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
50 hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
51 hg glog --template '{rev}\n' -l 1
51 hg glog --template '{rev}\n' -l 1
52
52
53 echo
53 echo
54 echo "% pull --rebase --update should ignore --update"
54 echo "% pull --rebase --update should ignore --update"
55 hg pull --rebase --update 2>&1 | sed 's/\(pulling from \).*/\1/'
55 hg pull --rebase --update 2>&1 | sed 's/\(pulling from \).*/\1/'
56
56
57 echo
57 echo
58 echo "% pull --rebase doesn't update if nothing has been pulled"
58 echo "% pull --rebase doesn't update if nothing has been pulled"
59 hg up 1
59 hg up 1
60 hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
60 hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
61 hg glog --template '{rev}\n' -l 1
61 hg glog --template '{rev}\n' -l 1
62
62
63 exit 0
63 exit 0
@@ -1,55 +1,55 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
7 echo "[diff]" >> $HGRCPATH
7 echo "[diff]" >> $HGRCPATH
8 echo "git=1" >> $HGRCPATH
8 echo "git=1" >> $HGRCPATH
9
9
10 BASE=`pwd`
10 BASE=`pwd`
11
11
12 hg init repo1
12 hg init repo1
13 cd repo1
13 cd repo1
14 echo "a">a
14 echo "a">a
15 hg commit -Am "A" --date '0 0'
15 hg commit -Am "A" --date '0 0'
16 echo "b"> b
16 echo "b"> b
17 hg commit -Am "B" --date '1 0'
17 hg commit -Am "B" --date '1 0'
18 hg up -C 0
18 hg up -C 0
19 hg mv a a-renamed
19 hg mv a a-renamed
20 hg commit -m 'rename A' --date '2 0'
20 hg commit -m 'rename A' --date '2 0'
21
21
22 echo
22 echo
23 echo '% Rename is tracked'
23 echo '% Rename is tracked'
24 hg log -p -r tip --template '{rev}:{desc}\n'
24 hg log -p -r tip --template '{rev}:{desc}\n'
25
25
26 echo '% Rebase the revision containing the rename'
26 echo '% Rebase the revision containing the rename'
27 hg rebase -s 2 -d 1 --quiet | cleanrebase
27 hg rebase -s 2 -d 1 --quiet | cleanrebase
28
28
29 echo
29 echo
30 echo '% Rename is not lost'
30 echo '% Rename is not lost'
31 hg log -p -r tip --template '{rev}:{desc}\n'
31 hg log -p -r tip --template '{rev}:{desc}\n'
32
32
33 cd $BASE
33 cd $BASE
34 rm -rf repo1
34 rm -rf repo1
35 hg init repo1
35 hg init repo1
36 cd repo1
36 cd repo1
37 echo "a">a
37 echo "a">a
38 hg commit -Am "A" --date '0 0'
38 hg commit -Am "A" --date '0 0'
39 echo "b"> b
39 echo "b"> b
40 hg commit -Am "B" --date '1 0'
40 hg commit -Am "B" --date '1 0'
41 hg up -C 0
41 hg up -C 0
42 hg cp a a-copied
42 hg cp a a-copied
43 hg commit -m 'copy A' --date '2 0'
43 hg commit -m 'copy A' --date '2 0'
44
44
45 echo
45 echo
46 echo '% Copy is tracked'
46 echo '% Copy is tracked'
47 hg log -p -r tip --template '{rev}:{desc}\n'
47 hg log -p -r tip --template '{rev}:{desc}\n'
48
48
49 echo '% Rebase the revision containing the copy'
49 echo '% Rebase the revision containing the copy'
50 hg rebase -s 2 -d 1 --quiet | cleanrebase
50 hg rebase -s 2 -d 1 --quiet | cleanrebase
51
51
52 echo
52 echo
53 echo '% Copy is not lost'
53 echo '% Copy is not lost'
54 hg log -p -r tip --template '{rev}:{desc}\n'
54 hg log -p -r tip --template '{rev}:{desc}\n'
55
55
@@ -1,93 +1,93 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 . $TESTDIR/helpers.sh
4
4
5 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
8
8
9 BASE=`pwd`
9 BASE=`pwd`
10
10
11 addcommit () {
11 addcommit () {
12 echo $1 > $1
12 echo $1 > $1
13 hg add $1
13 hg add $1
14 hg commit -d "${2} 0" -m $1
14 hg commit -d "${2} 0" -m $1
15 }
15 }
16
16
17 commit () {
17 commit () {
18 hg commit -d "${2} 0" -m $1
18 hg commit -d "${2} 0" -m $1
19 }
19 }
20
20
21 createrepo () {
21 createrepo () {
22 cd $BASE
22 cd $BASE
23 rm -rf a
23 rm -rf a
24 hg init a
24 hg init a
25 cd a
25 cd a
26 addcommit "A" 0
26 addcommit "A" 0
27 addcommit "B" 1
27 addcommit "B" 1
28
28
29 hg update -C 0
29 hg update -C 0
30 addcommit "C" 2
30 addcommit "C" 2
31
31
32 hg update -C 0
32 hg update -C 0
33 addcommit "D" 3
33 addcommit "D" 3
34
34
35 hg merge -r 2
35 hg merge -r 2
36 commit "E" 4
36 commit "E" 4
37
37
38 hg update -C 3
38 hg update -C 3
39 addcommit "F" 5
39 addcommit "F" 5
40 }
40 }
41
41
42 createrepo > /dev/null 2>&1
42 createrepo > /dev/null 2>&1
43 hg glog --template '{rev}: {desc}\n'
43 hg glog --template '{rev}: {desc}\n'
44
44
45 echo '% Rebasing'
45 echo '% Rebasing'
46 echo '% B onto F - simple rebase'
46 echo '% B onto F - simple rebase'
47 hg rebase -s 1 -d 5 | hidebackup
47 hg rebase -s 1 -d 5 | hidebackup
48 hg glog --template '{rev}: {desc}\n'
48 hg glog --template '{rev}: {desc}\n'
49
49
50 createrepo > /dev/null 2>&1
50 createrepo > /dev/null 2>&1
51 echo '% B onto D - intermediate point'
51 echo '% B onto D - intermediate point'
52 hg rebase -s 1 -d 3 | hidebackup
52 hg rebase -s 1 -d 3 | hidebackup
53 hg glog --template '{rev}: {desc}\n'
53 hg glog --template '{rev}: {desc}\n'
54
54
55 createrepo > /dev/null 2>&1
55 createrepo > /dev/null 2>&1
56 echo '% C onto F - skip of E'
56 echo '% C onto F - skip of E'
57 hg rebase -s 2 -d 5 | hidebackup
57 hg rebase -s 2 -d 5 | hidebackup
58 hg glog --template '{rev}: {desc}\n'
58 hg glog --template '{rev}: {desc}\n'
59
59
60 createrepo > /dev/null 2>&1
60 createrepo > /dev/null 2>&1
61 echo '% D onto C - rebase of a branching point (skip E)'
61 echo '% D onto C - rebase of a branching point (skip E)'
62 hg rebase -s 3 -d 2 | hidebackup
62 hg rebase -s 3 -d 2 | hidebackup
63 hg glog --template '{rev}: {desc}\n'
63 hg glog --template '{rev}: {desc}\n'
64
64
65 createrepo > /dev/null 2>&1
65 createrepo > /dev/null 2>&1
66 echo '% E onto F - merged revision having a parent in ancestors of target'
66 echo '% E onto F - merged revision having a parent in ancestors of target'
67 hg rebase -s 4 -d 5 | hidebackup
67 hg rebase -s 4 -d 5 | hidebackup
68 hg glog --template '{rev}: {desc}\n'
68 hg glog --template '{rev}: {desc}\n'
69
69
70 createrepo > /dev/null 2>&1
70 createrepo > /dev/null 2>&1
71 echo '% D onto B - E maintains C as parent'
71 echo '% D onto B - E maintains C as parent'
72 hg rebase -s 3 -d 1 | hidebackup
72 hg rebase -s 3 -d 1 | hidebackup
73 hg glog --template '{rev}: {desc}\n'
73 hg glog --template '{rev}: {desc}\n'
74
74
75 echo '% These will fail (using --source)'
75 echo '% These will fail (using --source)'
76 createrepo > /dev/null 2>&1
76 createrepo > /dev/null 2>&1
77 echo '% E onto D - rebase onto an ancestor'
77 echo '% E onto D - rebase onto an ancestor'
78 hg rebase -s 4 -d 3
78 hg rebase -s 4 -d 3
79 echo '% D onto E - rebase onto a descendant'
79 echo '% D onto E - rebase onto a descendant'
80 hg rebase -s 3 -d 4
80 hg rebase -s 3 -d 4
81 echo '% E onto B - merge revision with both parents not in ancestors of target'
81 echo '% E onto B - merge revision with both parents not in ancestors of target'
82 hg rebase -s 4 -d 1
82 hg rebase -s 4 -d 1
83
83
84 echo
84 echo
85 echo '% These will abort gracefully (using --base)'
85 echo '% These will abort gracefully (using --base)'
86 echo '% E onto E - rebase onto same changeset'
86 echo '% E onto E - rebase onto same changeset'
87 hg rebase -b 4 -d 4
87 hg rebase -b 4 -d 4
88 echo '% E onto D - rebase onto an ancestor'
88 echo '% E onto D - rebase onto an ancestor'
89 hg rebase -b 4 -d 3
89 hg rebase -b 4 -d 3
90 echo '% D onto E - rebase onto a descendant'
90 echo '% D onto E - rebase onto a descendant'
91 hg rebase -b 3 -d 4
91 hg rebase -b 3 -d 4
92
92
93 exit 0
93 exit 0
@@ -1,64 +1,64 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 # test stripping of filelogs where the linkrev doesn't always increase
3 # test stripping of filelogs where the linkrev doesn't always increase
4
4
5 source $TESTDIR/helpers.sh
5 . $TESTDIR/helpers.sh
6 echo '[extensions]' >> $HGRCPATH
6 echo '[extensions]' >> $HGRCPATH
7 echo 'hgext.mq =' >> $HGRCPATH
7 echo 'hgext.mq =' >> $HGRCPATH
8
8
9 hg init orig
9 hg init orig
10 cd orig
10 cd orig
11
11
12 commit()
12 commit()
13 {
13 {
14 hg up -qC null
14 hg up -qC null
15 count=1
15 count=1
16 for i in "$@"; do
16 for i in "$@"; do
17 for f in $i; do
17 for f in $i; do
18 echo $count > $f
18 echo $count > $f
19 done
19 done
20 count=`expr $count + 1`
20 count=`expr $count + 1`
21 done
21 done
22 hg commit -qAm "$*"
22 hg commit -qAm "$*"
23 }
23 }
24
24
25 # 2 1 0 2 0 1 2
25 # 2 1 0 2 0 1 2
26 commit '201 210'
26 commit '201 210'
27
27
28 commit '102 120' '210'
28 commit '102 120' '210'
29
29
30 commit '021'
30 commit '021'
31
31
32 commit '201' '021 120'
32 commit '201' '021 120'
33
33
34 commit '012 021' '102 201' '120 210'
34 commit '012 021' '102 201' '120 210'
35
35
36 commit 'manifest-file'
36 commit 'manifest-file'
37
37
38 commit '102 120' '012 210' '021 201'
38 commit '102 120' '012 210' '021 201'
39
39
40 commit '201 210' '021 120' '012 102'
40 commit '201 210' '021 120' '012 102'
41
41
42 HGUSER=another-user; export HGUSER
42 HGUSER=another-user; export HGUSER
43 commit 'manifest-file'
43 commit 'manifest-file'
44
44
45 commit '012' 'manifest-file'
45 commit '012' 'manifest-file'
46
46
47 cd ..
47 cd ..
48 hg clone -q -U -r -1 -r -2 -r -3 -r -4 -r -6 orig crossed
48 hg clone -q -U -r -1 -r -2 -r -3 -r -4 -r -6 orig crossed
49
49
50 for i in crossed/.hg/store/00manifest.i crossed/.hg/store/data/*.i; do
50 for i in crossed/.hg/store/00manifest.i crossed/.hg/store/data/*.i; do
51 echo $i
51 echo $i
52 hg debugindex $i
52 hg debugindex $i
53 echo
53 echo
54 done
54 done
55
55
56 for i in 0 1 2 3 4; do
56 for i in 0 1 2 3 4; do
57 hg clone -q -U --pull crossed $i
57 hg clone -q -U --pull crossed $i
58 echo "% Trying to strip revision $i"
58 echo "% Trying to strip revision $i"
59 hg --cwd $i strip $i | hidebackup
59 hg --cwd $i strip $i | hidebackup
60 echo "% Verifying"
60 echo "% Verifying"
61 hg --cwd $i verify
61 hg --cwd $i verify
62 echo
62 echo
63 done
63 done
64
64
General Comments 0
You need to be logged in to leave comments. Login now