##// END OF EJS Templates
tests: replace uses of 'seq' with portable 'seq.py'
Matt Harbison -
r24361:8de8cd34 default
parent child Browse files
Show More
@@ -1,601 +1,596 b''
1 #require serve
1 #require serve
2
2
3 $ cat << EOF >> $HGRCPATH
3 $ cat << EOF >> $HGRCPATH
4 > [ui]
4 > [ui]
5 > logtemplate={rev}:{node|short} {desc|firstline}
5 > logtemplate={rev}:{node|short} {desc|firstline}
6 > [phases]
6 > [phases]
7 > publish=False
7 > publish=False
8 > [experimental]
8 > [experimental]
9 > evolution=createmarkers,exchange
9 > evolution=createmarkers,exchange
10 > EOF
10 > EOF
11
11
12 initialize
12 initialize
13
13
14 $ hg init a
14 $ hg init a
15 $ cd a
15 $ cd a
16 $ echo 'test' > test
16 $ echo 'test' > test
17 $ hg commit -Am'test'
17 $ hg commit -Am'test'
18 adding test
18 adding test
19
19
20 set bookmarks
20 set bookmarks
21
21
22 $ hg bookmark X
22 $ hg bookmark X
23 $ hg bookmark Y
23 $ hg bookmark Y
24 $ hg bookmark Z
24 $ hg bookmark Z
25
25
26 import bookmark by name
26 import bookmark by name
27
27
28 $ hg init ../b
28 $ hg init ../b
29 $ cd ../b
29 $ cd ../b
30 $ hg book Y
30 $ hg book Y
31 $ hg book
31 $ hg book
32 * Y -1:000000000000
32 * Y -1:000000000000
33 $ hg pull ../a
33 $ hg pull ../a
34 pulling from ../a
34 pulling from ../a
35 requesting all changes
35 requesting all changes
36 adding changesets
36 adding changesets
37 adding manifests
37 adding manifests
38 adding file changes
38 adding file changes
39 added 1 changesets with 1 changes to 1 files
39 added 1 changesets with 1 changes to 1 files
40 adding remote bookmark X
40 adding remote bookmark X
41 updating bookmark Y
41 updating bookmark Y
42 adding remote bookmark Z
42 adding remote bookmark Z
43 (run 'hg update' to get a working copy)
43 (run 'hg update' to get a working copy)
44 $ hg bookmarks
44 $ hg bookmarks
45 X 0:4e3505fd9583
45 X 0:4e3505fd9583
46 * Y 0:4e3505fd9583
46 * Y 0:4e3505fd9583
47 Z 0:4e3505fd9583
47 Z 0:4e3505fd9583
48 $ hg debugpushkey ../a namespaces
48 $ hg debugpushkey ../a namespaces
49 bookmarks
49 bookmarks
50 namespaces
50 namespaces
51 obsolete
51 obsolete
52 phases
52 phases
53 $ hg debugpushkey ../a bookmarks
53 $ hg debugpushkey ../a bookmarks
54 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
54 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
55 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
55 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
56 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
56 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
57
57
58 delete the bookmark to re-pull it
58 delete the bookmark to re-pull it
59
59
60 $ hg book -d X
60 $ hg book -d X
61 $ hg pull -B X ../a
61 $ hg pull -B X ../a
62 pulling from ../a
62 pulling from ../a
63 no changes found
63 no changes found
64 adding remote bookmark X
64 adding remote bookmark X
65
65
66 finally no-op pull
66 finally no-op pull
67
67
68 $ hg pull -B X ../a
68 $ hg pull -B X ../a
69 pulling from ../a
69 pulling from ../a
70 no changes found
70 no changes found
71 $ hg bookmark
71 $ hg bookmark
72 X 0:4e3505fd9583
72 X 0:4e3505fd9583
73 * Y 0:4e3505fd9583
73 * Y 0:4e3505fd9583
74 Z 0:4e3505fd9583
74 Z 0:4e3505fd9583
75
75
76 export bookmark by name
76 export bookmark by name
77
77
78 $ hg bookmark W
78 $ hg bookmark W
79 $ hg bookmark foo
79 $ hg bookmark foo
80 $ hg bookmark foobar
80 $ hg bookmark foobar
81 $ hg push -B W ../a
81 $ hg push -B W ../a
82 pushing to ../a
82 pushing to ../a
83 searching for changes
83 searching for changes
84 no changes found
84 no changes found
85 exporting bookmark W
85 exporting bookmark W
86 [1]
86 [1]
87 $ hg -R ../a bookmarks
87 $ hg -R ../a bookmarks
88 W -1:000000000000
88 W -1:000000000000
89 X 0:4e3505fd9583
89 X 0:4e3505fd9583
90 Y 0:4e3505fd9583
90 Y 0:4e3505fd9583
91 * Z 0:4e3505fd9583
91 * Z 0:4e3505fd9583
92
92
93 delete a remote bookmark
93 delete a remote bookmark
94
94
95 $ hg book -d W
95 $ hg book -d W
96 $ hg push -B W ../a
96 $ hg push -B W ../a
97 pushing to ../a
97 pushing to ../a
98 searching for changes
98 searching for changes
99 no changes found
99 no changes found
100 deleting remote bookmark W
100 deleting remote bookmark W
101 [1]
101 [1]
102
102
103 push/pull name that doesn't exist
103 push/pull name that doesn't exist
104
104
105 $ hg push -B badname ../a
105 $ hg push -B badname ../a
106 pushing to ../a
106 pushing to ../a
107 searching for changes
107 searching for changes
108 bookmark badname does not exist on the local or remote repository!
108 bookmark badname does not exist on the local or remote repository!
109 no changes found
109 no changes found
110 [2]
110 [2]
111 $ hg pull -B anotherbadname ../a
111 $ hg pull -B anotherbadname ../a
112 pulling from ../a
112 pulling from ../a
113 abort: remote bookmark anotherbadname not found!
113 abort: remote bookmark anotherbadname not found!
114 [255]
114 [255]
115
115
116 divergent bookmarks
116 divergent bookmarks
117
117
118 $ cd ../a
118 $ cd ../a
119 $ echo c1 > f1
119 $ echo c1 > f1
120 $ hg ci -Am1
120 $ hg ci -Am1
121 adding f1
121 adding f1
122 $ hg book -f @
122 $ hg book -f @
123 $ hg book -f X
123 $ hg book -f X
124 $ hg book
124 $ hg book
125 @ 1:0d2164f0ce0d
125 @ 1:0d2164f0ce0d
126 * X 1:0d2164f0ce0d
126 * X 1:0d2164f0ce0d
127 Y 0:4e3505fd9583
127 Y 0:4e3505fd9583
128 Z 1:0d2164f0ce0d
128 Z 1:0d2164f0ce0d
129
129
130 $ cd ../b
130 $ cd ../b
131 $ hg up
131 $ hg up
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 updating bookmark foobar
133 updating bookmark foobar
134 $ echo c2 > f2
134 $ echo c2 > f2
135 $ hg ci -Am2
135 $ hg ci -Am2
136 adding f2
136 adding f2
137 $ hg book -if @
137 $ hg book -if @
138 $ hg book -if X
138 $ hg book -if X
139 $ hg book
139 $ hg book
140 @ 1:9b140be10808
140 @ 1:9b140be10808
141 X 1:9b140be10808
141 X 1:9b140be10808
142 Y 0:4e3505fd9583
142 Y 0:4e3505fd9583
143 Z 0:4e3505fd9583
143 Z 0:4e3505fd9583
144 foo -1:000000000000
144 foo -1:000000000000
145 * foobar 1:9b140be10808
145 * foobar 1:9b140be10808
146
146
147 $ hg pull --config paths.foo=../a foo
147 $ hg pull --config paths.foo=../a foo
148 pulling from $TESTTMP/a (glob)
148 pulling from $TESTTMP/a (glob)
149 searching for changes
149 searching for changes
150 adding changesets
150 adding changesets
151 adding manifests
151 adding manifests
152 adding file changes
152 adding file changes
153 added 1 changesets with 1 changes to 1 files (+1 heads)
153 added 1 changesets with 1 changes to 1 files (+1 heads)
154 divergent bookmark @ stored as @foo
154 divergent bookmark @ stored as @foo
155 divergent bookmark X stored as X@foo
155 divergent bookmark X stored as X@foo
156 updating bookmark Z
156 updating bookmark Z
157 (run 'hg heads' to see heads, 'hg merge' to merge)
157 (run 'hg heads' to see heads, 'hg merge' to merge)
158 $ hg book
158 $ hg book
159 @ 1:9b140be10808
159 @ 1:9b140be10808
160 @foo 2:0d2164f0ce0d
160 @foo 2:0d2164f0ce0d
161 X 1:9b140be10808
161 X 1:9b140be10808
162 X@foo 2:0d2164f0ce0d
162 X@foo 2:0d2164f0ce0d
163 Y 0:4e3505fd9583
163 Y 0:4e3505fd9583
164 Z 2:0d2164f0ce0d
164 Z 2:0d2164f0ce0d
165 foo -1:000000000000
165 foo -1:000000000000
166 * foobar 1:9b140be10808
166 * foobar 1:9b140be10808
167
167
168 (test that too many divergence of bookmark)
168 (test that too many divergence of bookmark)
169
169
170 $ cat > $TESTTMP/seq.py <<EOF
170 $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done
171 > import sys
172 > for i in xrange(*[int(a) for a in sys.argv[1:]]):
173 > print i
174 > EOF
175 $ python $TESTTMP/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done
176 $ hg pull ../a
171 $ hg pull ../a
177 pulling from ../a
172 pulling from ../a
178 searching for changes
173 searching for changes
179 no changes found
174 no changes found
180 warning: failed to assign numbered name to divergent bookmark X
175 warning: failed to assign numbered name to divergent bookmark X
181 divergent bookmark @ stored as @1
176 divergent bookmark @ stored as @1
182 $ hg bookmarks | grep '^ X' | grep -v ':000000000000'
177 $ hg bookmarks | grep '^ X' | grep -v ':000000000000'
183 X 1:9b140be10808
178 X 1:9b140be10808
184 X@foo 2:0d2164f0ce0d
179 X@foo 2:0d2164f0ce0d
185
180
186 (test that remotely diverged bookmarks are reused if they aren't changed)
181 (test that remotely diverged bookmarks are reused if they aren't changed)
187
182
188 $ hg bookmarks | grep '^ @'
183 $ hg bookmarks | grep '^ @'
189 @ 1:9b140be10808
184 @ 1:9b140be10808
190 @1 2:0d2164f0ce0d
185 @1 2:0d2164f0ce0d
191 @foo 2:0d2164f0ce0d
186 @foo 2:0d2164f0ce0d
192 $ hg pull ../a
187 $ hg pull ../a
193 pulling from ../a
188 pulling from ../a
194 searching for changes
189 searching for changes
195 no changes found
190 no changes found
196 warning: failed to assign numbered name to divergent bookmark X
191 warning: failed to assign numbered name to divergent bookmark X
197 divergent bookmark @ stored as @1
192 divergent bookmark @ stored as @1
198 $ hg bookmarks | grep '^ @'
193 $ hg bookmarks | grep '^ @'
199 @ 1:9b140be10808
194 @ 1:9b140be10808
200 @1 2:0d2164f0ce0d
195 @1 2:0d2164f0ce0d
201 @foo 2:0d2164f0ce0d
196 @foo 2:0d2164f0ce0d
202
197
203 $ python $TESTTMP/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
198 $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
204 $ hg bookmarks -d "@1"
199 $ hg bookmarks -d "@1"
205
200
206 $ hg push -f ../a
201 $ hg push -f ../a
207 pushing to ../a
202 pushing to ../a
208 searching for changes
203 searching for changes
209 adding changesets
204 adding changesets
210 adding manifests
205 adding manifests
211 adding file changes
206 adding file changes
212 added 1 changesets with 1 changes to 1 files (+1 heads)
207 added 1 changesets with 1 changes to 1 files (+1 heads)
213 $ hg -R ../a book
208 $ hg -R ../a book
214 @ 1:0d2164f0ce0d
209 @ 1:0d2164f0ce0d
215 * X 1:0d2164f0ce0d
210 * X 1:0d2164f0ce0d
216 Y 0:4e3505fd9583
211 Y 0:4e3505fd9583
217 Z 1:0d2164f0ce0d
212 Z 1:0d2164f0ce0d
218
213
219 explicit pull should overwrite the local version (issue4439)
214 explicit pull should overwrite the local version (issue4439)
220
215
221 $ hg pull --config paths.foo=../a foo -B X
216 $ hg pull --config paths.foo=../a foo -B X
222 pulling from $TESTTMP/a (glob)
217 pulling from $TESTTMP/a (glob)
223 no changes found
218 no changes found
224 divergent bookmark @ stored as @foo
219 divergent bookmark @ stored as @foo
225 importing bookmark X
220 importing bookmark X
226
221
227 reinstall state for further testing:
222 reinstall state for further testing:
228
223
229 $ hg book -fr 9b140be10808 X
224 $ hg book -fr 9b140be10808 X
230
225
231 revsets should not ignore divergent bookmarks
226 revsets should not ignore divergent bookmarks
232
227
233 $ hg bookmark -fr 1 Z
228 $ hg bookmark -fr 1 Z
234 $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n'
229 $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n'
235 0:4e3505fd9583 Y
230 0:4e3505fd9583 Y
236 1:9b140be10808 @ X Z foobar
231 1:9b140be10808 @ X Z foobar
237 2:0d2164f0ce0d @foo X@foo
232 2:0d2164f0ce0d @foo X@foo
238 $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
233 $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
239 2:0d2164f0ce0d @foo X@foo
234 2:0d2164f0ce0d @foo X@foo
240 $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
235 $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
241 2:0d2164f0ce0d @foo X@foo
236 2:0d2164f0ce0d @foo X@foo
242
237
243 update a remote bookmark from a non-head to a head
238 update a remote bookmark from a non-head to a head
244
239
245 $ hg up -q Y
240 $ hg up -q Y
246 $ echo c3 > f2
241 $ echo c3 > f2
247 $ hg ci -Am3
242 $ hg ci -Am3
248 adding f2
243 adding f2
249 created new head
244 created new head
250 $ hg push ../a
245 $ hg push ../a
251 pushing to ../a
246 pushing to ../a
252 searching for changes
247 searching for changes
253 adding changesets
248 adding changesets
254 adding manifests
249 adding manifests
255 adding file changes
250 adding file changes
256 added 1 changesets with 1 changes to 1 files (+1 heads)
251 added 1 changesets with 1 changes to 1 files (+1 heads)
257 updating bookmark Y
252 updating bookmark Y
258 $ hg -R ../a book
253 $ hg -R ../a book
259 @ 1:0d2164f0ce0d
254 @ 1:0d2164f0ce0d
260 * X 1:0d2164f0ce0d
255 * X 1:0d2164f0ce0d
261 Y 3:f6fc62dde3c0
256 Y 3:f6fc62dde3c0
262 Z 1:0d2164f0ce0d
257 Z 1:0d2164f0ce0d
263
258
264 update a bookmark in the middle of a client pulling changes
259 update a bookmark in the middle of a client pulling changes
265
260
266 $ cd ..
261 $ cd ..
267 $ hg clone -q a pull-race
262 $ hg clone -q a pull-race
268 $ hg clone -q pull-race pull-race2
263 $ hg clone -q pull-race pull-race2
269 $ cd pull-race
264 $ cd pull-race
270 $ hg up -q Y
265 $ hg up -q Y
271 $ echo c4 > f2
266 $ echo c4 > f2
272 $ hg ci -Am4
267 $ hg ci -Am4
273 $ echo c5 > f3
268 $ echo c5 > f3
274 $ cat <<EOF > .hg/hgrc
269 $ cat <<EOF > .hg/hgrc
275 > [hooks]
270 > [hooks]
276 > outgoing.makecommit = hg ci -Am5; echo committed in pull-race
271 > outgoing.makecommit = hg ci -Am5; echo committed in pull-race
277 > EOF
272 > EOF
278 $ cd ../pull-race2
273 $ cd ../pull-race2
279 $ hg pull
274 $ hg pull
280 pulling from $TESTTMP/pull-race (glob)
275 pulling from $TESTTMP/pull-race (glob)
281 searching for changes
276 searching for changes
282 adding changesets
277 adding changesets
283 adding f3
278 adding f3
284 committed in pull-race
279 committed in pull-race
285 adding manifests
280 adding manifests
286 adding file changes
281 adding file changes
287 added 1 changesets with 1 changes to 1 files
282 added 1 changesets with 1 changes to 1 files
288 updating bookmark Y
283 updating bookmark Y
289 (run 'hg update' to get a working copy)
284 (run 'hg update' to get a working copy)
290 $ hg book
285 $ hg book
291 * @ 1:0d2164f0ce0d
286 * @ 1:0d2164f0ce0d
292 X 1:0d2164f0ce0d
287 X 1:0d2164f0ce0d
293 Y 4:b0a5eff05604
288 Y 4:b0a5eff05604
294 Z 1:0d2164f0ce0d
289 Z 1:0d2164f0ce0d
295 $ cd ../b
290 $ cd ../b
296
291
297 diverging a remote bookmark fails
292 diverging a remote bookmark fails
298
293
299 $ hg up -q 4e3505fd9583
294 $ hg up -q 4e3505fd9583
300 $ echo c4 > f2
295 $ echo c4 > f2
301 $ hg ci -Am4
296 $ hg ci -Am4
302 adding f2
297 adding f2
303 created new head
298 created new head
304 $ echo c5 > f2
299 $ echo c5 > f2
305 $ hg ci -Am5
300 $ hg ci -Am5
306 $ hg log -G
301 $ hg log -G
307 @ 5:c922c0139ca0 5
302 @ 5:c922c0139ca0 5
308 |
303 |
309 o 4:4efff6d98829 4
304 o 4:4efff6d98829 4
310 |
305 |
311 | o 3:f6fc62dde3c0 3
306 | o 3:f6fc62dde3c0 3
312 |/
307 |/
313 | o 2:0d2164f0ce0d 1
308 | o 2:0d2164f0ce0d 1
314 |/
309 |/
315 | o 1:9b140be10808 2
310 | o 1:9b140be10808 2
316 |/
311 |/
317 o 0:4e3505fd9583 test
312 o 0:4e3505fd9583 test
318
313
319
314
320 $ hg book -f Y
315 $ hg book -f Y
321
316
322 $ cat <<EOF > ../a/.hg/hgrc
317 $ cat <<EOF > ../a/.hg/hgrc
323 > [web]
318 > [web]
324 > push_ssl = false
319 > push_ssl = false
325 > allow_push = *
320 > allow_push = *
326 > EOF
321 > EOF
327
322
328 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
323 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
329 $ cat ../hg2.pid >> $DAEMON_PIDS
324 $ cat ../hg2.pid >> $DAEMON_PIDS
330
325
331 $ hg push http://localhost:$HGPORT2/
326 $ hg push http://localhost:$HGPORT2/
332 pushing to http://localhost:$HGPORT2/
327 pushing to http://localhost:$HGPORT2/
333 searching for changes
328 searching for changes
334 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
329 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
335 (merge or see "hg help push" for details about pushing new heads)
330 (merge or see "hg help push" for details about pushing new heads)
336 [255]
331 [255]
337 $ hg -R ../a book
332 $ hg -R ../a book
338 @ 1:0d2164f0ce0d
333 @ 1:0d2164f0ce0d
339 * X 1:0d2164f0ce0d
334 * X 1:0d2164f0ce0d
340 Y 3:f6fc62dde3c0
335 Y 3:f6fc62dde3c0
341 Z 1:0d2164f0ce0d
336 Z 1:0d2164f0ce0d
342
337
343
338
344 Unrelated marker does not alter the decision
339 Unrelated marker does not alter the decision
345
340
346 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
341 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
347 $ hg push http://localhost:$HGPORT2/
342 $ hg push http://localhost:$HGPORT2/
348 pushing to http://localhost:$HGPORT2/
343 pushing to http://localhost:$HGPORT2/
349 searching for changes
344 searching for changes
350 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
345 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
351 (merge or see "hg help push" for details about pushing new heads)
346 (merge or see "hg help push" for details about pushing new heads)
352 [255]
347 [255]
353 $ hg -R ../a book
348 $ hg -R ../a book
354 @ 1:0d2164f0ce0d
349 @ 1:0d2164f0ce0d
355 * X 1:0d2164f0ce0d
350 * X 1:0d2164f0ce0d
356 Y 3:f6fc62dde3c0
351 Y 3:f6fc62dde3c0
357 Z 1:0d2164f0ce0d
352 Z 1:0d2164f0ce0d
358
353
359 Update to a successor works
354 Update to a successor works
360
355
361 $ hg id --debug -r 3
356 $ hg id --debug -r 3
362 f6fc62dde3c0771e29704af56ba4d8af77abcc2f
357 f6fc62dde3c0771e29704af56ba4d8af77abcc2f
363 $ hg id --debug -r 4
358 $ hg id --debug -r 4
364 4efff6d98829d9c824c621afd6e3f01865f5439f
359 4efff6d98829d9c824c621afd6e3f01865f5439f
365 $ hg id --debug -r 5
360 $ hg id --debug -r 5
366 c922c0139ca03858f655e4a2af4dd02796a63969 tip Y
361 c922c0139ca03858f655e4a2af4dd02796a63969 tip Y
367 $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc
362 $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc
368 $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f
363 $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f
369 $ hg push http://localhost:$HGPORT2/
364 $ hg push http://localhost:$HGPORT2/
370 pushing to http://localhost:$HGPORT2/
365 pushing to http://localhost:$HGPORT2/
371 searching for changes
366 searching for changes
372 remote: adding changesets
367 remote: adding changesets
373 remote: adding manifests
368 remote: adding manifests
374 remote: adding file changes
369 remote: adding file changes
375 remote: added 2 changesets with 2 changes to 1 files (+1 heads)
370 remote: added 2 changesets with 2 changes to 1 files (+1 heads)
376 updating bookmark Y
371 updating bookmark Y
377 $ hg -R ../a book
372 $ hg -R ../a book
378 @ 1:0d2164f0ce0d
373 @ 1:0d2164f0ce0d
379 * X 1:0d2164f0ce0d
374 * X 1:0d2164f0ce0d
380 Y 5:c922c0139ca0
375 Y 5:c922c0139ca0
381 Z 1:0d2164f0ce0d
376 Z 1:0d2164f0ce0d
382
377
383 hgweb
378 hgweb
384
379
385 $ cat <<EOF > .hg/hgrc
380 $ cat <<EOF > .hg/hgrc
386 > [web]
381 > [web]
387 > push_ssl = false
382 > push_ssl = false
388 > allow_push = *
383 > allow_push = *
389 > EOF
384 > EOF
390
385
391 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
386 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
392 $ cat ../hg.pid >> $DAEMON_PIDS
387 $ cat ../hg.pid >> $DAEMON_PIDS
393 $ cd ../a
388 $ cd ../a
394
389
395 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
390 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
396 bookmarks
391 bookmarks
397 namespaces
392 namespaces
398 obsolete
393 obsolete
399 phases
394 phases
400 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
395 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
401 @ 9b140be1080824d768c5a4691a564088eede71f9
396 @ 9b140be1080824d768c5a4691a564088eede71f9
402 X 9b140be1080824d768c5a4691a564088eede71f9
397 X 9b140be1080824d768c5a4691a564088eede71f9
403 Y c922c0139ca03858f655e4a2af4dd02796a63969
398 Y c922c0139ca03858f655e4a2af4dd02796a63969
404 Z 9b140be1080824d768c5a4691a564088eede71f9
399 Z 9b140be1080824d768c5a4691a564088eede71f9
405 foo 0000000000000000000000000000000000000000
400 foo 0000000000000000000000000000000000000000
406 foobar 9b140be1080824d768c5a4691a564088eede71f9
401 foobar 9b140be1080824d768c5a4691a564088eede71f9
407 $ hg out -B http://localhost:$HGPORT/
402 $ hg out -B http://localhost:$HGPORT/
408 comparing with http://localhost:$HGPORT/
403 comparing with http://localhost:$HGPORT/
409 searching for changed bookmarks
404 searching for changed bookmarks
410 no changed bookmarks found
405 no changed bookmarks found
411 [1]
406 [1]
412 $ hg push -B Z http://localhost:$HGPORT/
407 $ hg push -B Z http://localhost:$HGPORT/
413 pushing to http://localhost:$HGPORT/
408 pushing to http://localhost:$HGPORT/
414 searching for changes
409 searching for changes
415 no changes found
410 no changes found
416 updating bookmark Z
411 updating bookmark Z
417 [1]
412 [1]
418 $ hg book -d Z
413 $ hg book -d Z
419 $ hg in -B http://localhost:$HGPORT/
414 $ hg in -B http://localhost:$HGPORT/
420 comparing with http://localhost:$HGPORT/
415 comparing with http://localhost:$HGPORT/
421 searching for changed bookmarks
416 searching for changed bookmarks
422 Z 0d2164f0ce0d
417 Z 0d2164f0ce0d
423 foo 000000000000
418 foo 000000000000
424 foobar 9b140be10808
419 foobar 9b140be10808
425 $ hg pull -B Z http://localhost:$HGPORT/
420 $ hg pull -B Z http://localhost:$HGPORT/
426 pulling from http://localhost:$HGPORT/
421 pulling from http://localhost:$HGPORT/
427 no changes found
422 no changes found
428 divergent bookmark @ stored as @1
423 divergent bookmark @ stored as @1
429 divergent bookmark X stored as X@1
424 divergent bookmark X stored as X@1
430 adding remote bookmark Z
425 adding remote bookmark Z
431 adding remote bookmark foo
426 adding remote bookmark foo
432 adding remote bookmark foobar
427 adding remote bookmark foobar
433 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
428 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
434 requesting all changes
429 requesting all changes
435 adding changesets
430 adding changesets
436 adding manifests
431 adding manifests
437 adding file changes
432 adding file changes
438 added 5 changesets with 5 changes to 3 files (+2 heads)
433 added 5 changesets with 5 changes to 3 files (+2 heads)
439 updating to bookmark @
434 updating to bookmark @
440 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
441 $ hg -R cloned-bookmarks bookmarks
436 $ hg -R cloned-bookmarks bookmarks
442 * @ 1:9b140be10808
437 * @ 1:9b140be10808
443 X 1:9b140be10808
438 X 1:9b140be10808
444 Y 4:c922c0139ca0
439 Y 4:c922c0139ca0
445 Z 2:0d2164f0ce0d
440 Z 2:0d2164f0ce0d
446 foo -1:000000000000
441 foo -1:000000000000
447 foobar 1:9b140be10808
442 foobar 1:9b140be10808
448
443
449 $ cd ..
444 $ cd ..
450
445
451 Pushing a bookmark should only push the changes required by that
446 Pushing a bookmark should only push the changes required by that
452 bookmark, not all outgoing changes:
447 bookmark, not all outgoing changes:
453 $ hg clone http://localhost:$HGPORT/ addmarks
448 $ hg clone http://localhost:$HGPORT/ addmarks
454 requesting all changes
449 requesting all changes
455 adding changesets
450 adding changesets
456 adding manifests
451 adding manifests
457 adding file changes
452 adding file changes
458 added 5 changesets with 5 changes to 3 files (+2 heads)
453 added 5 changesets with 5 changes to 3 files (+2 heads)
459 updating to bookmark @
454 updating to bookmark @
460 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
455 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 $ cd addmarks
456 $ cd addmarks
462 $ echo foo > foo
457 $ echo foo > foo
463 $ hg add foo
458 $ hg add foo
464 $ hg commit -m 'add foo'
459 $ hg commit -m 'add foo'
465 $ echo bar > bar
460 $ echo bar > bar
466 $ hg add bar
461 $ hg add bar
467 $ hg commit -m 'add bar'
462 $ hg commit -m 'add bar'
468 $ hg co "tip^"
463 $ hg co "tip^"
469 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
464 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
470 (leaving bookmark @)
465 (leaving bookmark @)
471 $ hg book add-foo
466 $ hg book add-foo
472 $ hg book -r tip add-bar
467 $ hg book -r tip add-bar
473 Note: this push *must* push only a single changeset, as that's the point
468 Note: this push *must* push only a single changeset, as that's the point
474 of this test.
469 of this test.
475 $ hg push -B add-foo --traceback
470 $ hg push -B add-foo --traceback
476 pushing to http://localhost:$HGPORT/
471 pushing to http://localhost:$HGPORT/
477 searching for changes
472 searching for changes
478 remote: adding changesets
473 remote: adding changesets
479 remote: adding manifests
474 remote: adding manifests
480 remote: adding file changes
475 remote: adding file changes
481 remote: added 1 changesets with 1 changes to 1 files
476 remote: added 1 changesets with 1 changes to 1 files
482 exporting bookmark add-foo
477 exporting bookmark add-foo
483
478
484 pushing a new bookmark on a new head does not require -f if -B is specified
479 pushing a new bookmark on a new head does not require -f if -B is specified
485
480
486 $ hg up -q X
481 $ hg up -q X
487 $ hg book W
482 $ hg book W
488 $ echo c5 > f2
483 $ echo c5 > f2
489 $ hg ci -Am5
484 $ hg ci -Am5
490 created new head
485 created new head
491 $ hg push -B W
486 $ hg push -B W
492 pushing to http://localhost:$HGPORT/
487 pushing to http://localhost:$HGPORT/
493 searching for changes
488 searching for changes
494 remote: adding changesets
489 remote: adding changesets
495 remote: adding manifests
490 remote: adding manifests
496 remote: adding file changes
491 remote: adding file changes
497 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
492 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
498 exporting bookmark W
493 exporting bookmark W
499 $ hg -R ../b id -r W
494 $ hg -R ../b id -r W
500 cc978a373a53 tip W
495 cc978a373a53 tip W
501
496
502 $ cd ..
497 $ cd ..
503
498
504 pushing an unchanged bookmark should result in no changes
499 pushing an unchanged bookmark should result in no changes
505
500
506 $ hg init unchanged-a
501 $ hg init unchanged-a
507 $ hg init unchanged-b
502 $ hg init unchanged-b
508 $ cd unchanged-a
503 $ cd unchanged-a
509 $ echo initial > foo
504 $ echo initial > foo
510 $ hg commit -A -m initial
505 $ hg commit -A -m initial
511 adding foo
506 adding foo
512 $ hg bookmark @
507 $ hg bookmark @
513 $ hg push -B @ ../unchanged-b
508 $ hg push -B @ ../unchanged-b
514 pushing to ../unchanged-b
509 pushing to ../unchanged-b
515 searching for changes
510 searching for changes
516 adding changesets
511 adding changesets
517 adding manifests
512 adding manifests
518 adding file changes
513 adding file changes
519 added 1 changesets with 1 changes to 1 files
514 added 1 changesets with 1 changes to 1 files
520 exporting bookmark @
515 exporting bookmark @
521
516
522 $ hg push -B @ ../unchanged-b
517 $ hg push -B @ ../unchanged-b
523 pushing to ../unchanged-b
518 pushing to ../unchanged-b
524 searching for changes
519 searching for changes
525 no changes found
520 no changes found
526 [1]
521 [1]
527
522
528
523
529 Check hook preventing push (issue4455)
524 Check hook preventing push (issue4455)
530 ======================================
525 ======================================
531
526
532 $ hg bookmarks
527 $ hg bookmarks
533 * @ 0:55482a6fb4b1
528 * @ 0:55482a6fb4b1
534 $ hg log -G
529 $ hg log -G
535 @ 0:55482a6fb4b1 initial
530 @ 0:55482a6fb4b1 initial
536
531
537 $ hg init ../issue4455-dest
532 $ hg init ../issue4455-dest
538 $ hg push ../issue4455-dest # changesets only
533 $ hg push ../issue4455-dest # changesets only
539 pushing to ../issue4455-dest
534 pushing to ../issue4455-dest
540 searching for changes
535 searching for changes
541 adding changesets
536 adding changesets
542 adding manifests
537 adding manifests
543 adding file changes
538 adding file changes
544 added 1 changesets with 1 changes to 1 files
539 added 1 changesets with 1 changes to 1 files
545 $ cat >> .hg/hgrc << EOF
540 $ cat >> .hg/hgrc << EOF
546 > [paths]
541 > [paths]
547 > local=../issue4455-dest/
542 > local=../issue4455-dest/
548 > ssh=ssh://user@dummy/issue4455-dest
543 > ssh=ssh://user@dummy/issue4455-dest
549 > http=http://localhost:$HGPORT/
544 > http=http://localhost:$HGPORT/
550 > [ui]
545 > [ui]
551 > ssh=python "$TESTDIR/dummyssh"
546 > ssh=python "$TESTDIR/dummyssh"
552 > EOF
547 > EOF
553 $ cat >> ../issue4455-dest/.hg/hgrc << EOF
548 $ cat >> ../issue4455-dest/.hg/hgrc << EOF
554 > [hooks]
549 > [hooks]
555 > prepushkey=false
550 > prepushkey=false
556 > [web]
551 > [web]
557 > push_ssl = false
552 > push_ssl = false
558 > allow_push = *
553 > allow_push = *
559 > EOF
554 > EOF
560 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
555 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
561 $ hg -R ../issue4455-dest serve -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log
556 $ hg -R ../issue4455-dest serve -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log
562 $ cat ../issue4455.pid >> $DAEMON_PIDS
557 $ cat ../issue4455.pid >> $DAEMON_PIDS
563
558
564 Local push
559 Local push
565 ----------
560 ----------
566
561
567 $ hg push -B @ local
562 $ hg push -B @ local
568 pushing to $TESTTMP/issue4455-dest (glob)
563 pushing to $TESTTMP/issue4455-dest (glob)
569 searching for changes
564 searching for changes
570 no changes found
565 no changes found
571 pushkey-abort: prepushkey hook exited with status 1
566 pushkey-abort: prepushkey hook exited with status 1
572 exporting bookmark @ failed!
567 exporting bookmark @ failed!
573 [1]
568 [1]
574 $ hg -R ../issue4455-dest/ bookmarks
569 $ hg -R ../issue4455-dest/ bookmarks
575 no bookmarks set
570 no bookmarks set
576
571
577 Using ssh
572 Using ssh
578 ---------
573 ---------
579
574
580 $ hg push -B @ ssh
575 $ hg push -B @ ssh
581 pushing to ssh://user@dummy/issue4455-dest
576 pushing to ssh://user@dummy/issue4455-dest
582 searching for changes
577 searching for changes
583 no changes found
578 no changes found
584 remote: pushkey-abort: prepushkey hook exited with status 1
579 remote: pushkey-abort: prepushkey hook exited with status 1
585 exporting bookmark @ failed!
580 exporting bookmark @ failed!
586 [1]
581 [1]
587 $ hg -R ../issue4455-dest/ bookmarks
582 $ hg -R ../issue4455-dest/ bookmarks
588 no bookmarks set
583 no bookmarks set
589
584
590 Using http
585 Using http
591 ----------
586 ----------
592
587
593 $ hg push -B @ http
588 $ hg push -B @ http
594 pushing to http://localhost:$HGPORT/
589 pushing to http://localhost:$HGPORT/
595 searching for changes
590 searching for changes
596 no changes found
591 no changes found
597 remote: pushkey-abort: prepushkey hook exited with status 1
592 remote: pushkey-abort: prepushkey hook exited with status 1
598 exporting bookmark @ failed!
593 exporting bookmark @ failed!
599 [1]
594 [1]
600 $ hg -R ../issue4455-dest/ bookmarks
595 $ hg -R ../issue4455-dest/ bookmarks
601 no bookmarks set
596 no bookmarks set
@@ -1,480 +1,480 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > censor=
3 > censor=
4 > EOF
4 > EOF
5 $ cp $HGRCPATH $HGRCPATH.orig
5 $ cp $HGRCPATH $HGRCPATH.orig
6
6
7 Create repo with unimpeachable content
7 Create repo with unimpeachable content
8
8
9 $ hg init r
9 $ hg init r
10 $ cd r
10 $ cd r
11 $ echo 'Initially untainted file' > target
11 $ echo 'Initially untainted file' > target
12 $ echo 'Normal file here' > bystander
12 $ echo 'Normal file here' > bystander
13 $ hg add target bystander
13 $ hg add target bystander
14 $ hg ci -m init
14 $ hg ci -m init
15
15
16 Clone repo so we can test pull later
16 Clone repo so we can test pull later
17
17
18 $ cd ..
18 $ cd ..
19 $ hg clone r rpull
19 $ hg clone r rpull
20 updating to branch default
20 updating to branch default
21 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
22 $ cd r
22 $ cd r
23
23
24 Introduce content which will ultimately require censorship. Name the first
24 Introduce content which will ultimately require censorship. Name the first
25 censored node C1, second C2, and so on
25 censored node C1, second C2, and so on
26
26
27 $ echo 'Tainted file' > target
27 $ echo 'Tainted file' > target
28 $ echo 'Passwords: hunter2' >> target
28 $ echo 'Passwords: hunter2' >> target
29 $ hg ci -m taint target
29 $ hg ci -m taint target
30 $ C1=`hg id --debug -i`
30 $ C1=`hg id --debug -i`
31
31
32 $ echo 'hunter3' >> target
32 $ echo 'hunter3' >> target
33 $ echo 'Normal file v2' > bystander
33 $ echo 'Normal file v2' > bystander
34 $ hg ci -m moretaint target bystander
34 $ hg ci -m moretaint target bystander
35 $ C2=`hg id --debug -i`
35 $ C2=`hg id --debug -i`
36
36
37 Add a new sanitized versions to correct our mistake. Name the first head H1,
37 Add a new sanitized versions to correct our mistake. Name the first head H1,
38 the second head H2, and so on
38 the second head H2, and so on
39
39
40 $ echo 'Tainted file is now sanitized' > target
40 $ echo 'Tainted file is now sanitized' > target
41 $ hg ci -m sanitized target
41 $ hg ci -m sanitized target
42 $ H1=`hg id --debug -i`
42 $ H1=`hg id --debug -i`
43
43
44 $ hg update -r $C2
44 $ hg update -r $C2
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ echo 'Tainted file now super sanitized' > target
46 $ echo 'Tainted file now super sanitized' > target
47 $ hg ci -m 'super sanitized' target
47 $ hg ci -m 'super sanitized' target
48 created new head
48 created new head
49 $ H2=`hg id --debug -i`
49 $ H2=`hg id --debug -i`
50
50
51 Verify target contents before censorship at each revision
51 Verify target contents before censorship at each revision
52
52
53 $ hg cat -r $H1 target
53 $ hg cat -r $H1 target
54 Tainted file is now sanitized
54 Tainted file is now sanitized
55 $ hg cat -r $H2 target
55 $ hg cat -r $H2 target
56 Tainted file now super sanitized
56 Tainted file now super sanitized
57 $ hg cat -r $C2 target
57 $ hg cat -r $C2 target
58 Tainted file
58 Tainted file
59 Passwords: hunter2
59 Passwords: hunter2
60 hunter3
60 hunter3
61 $ hg cat -r $C1 target
61 $ hg cat -r $C1 target
62 Tainted file
62 Tainted file
63 Passwords: hunter2
63 Passwords: hunter2
64 $ hg cat -r 0 target
64 $ hg cat -r 0 target
65 Initially untainted file
65 Initially untainted file
66
66
67 Try to censor revision with too large of a tombstone message
67 Try to censor revision with too large of a tombstone message
68
68
69 $ hg censor -r $C1 -t 'blah blah blah blah blah blah blah blah bla' target
69 $ hg censor -r $C1 -t 'blah blah blah blah blah blah blah blah bla' target
70 abort: censor tombstone must be no longer than censored data
70 abort: censor tombstone must be no longer than censored data
71 [255]
71 [255]
72
72
73 Censor revision with 2 offenses
73 Censor revision with 2 offenses
74
74
75 $ hg censor -r $C2 -t "remove password" target
75 $ hg censor -r $C2 -t "remove password" target
76 $ hg cat -r $H1 target
76 $ hg cat -r $H1 target
77 Tainted file is now sanitized
77 Tainted file is now sanitized
78 $ hg cat -r $H2 target
78 $ hg cat -r $H2 target
79 Tainted file now super sanitized
79 Tainted file now super sanitized
80 $ hg cat -r $C2 target
80 $ hg cat -r $C2 target
81 abort: censored node: 1e0247a9a4b7
81 abort: censored node: 1e0247a9a4b7
82 (set censor.policy to ignore errors)
82 (set censor.policy to ignore errors)
83 [255]
83 [255]
84 $ hg cat -r $C1 target
84 $ hg cat -r $C1 target
85 Tainted file
85 Tainted file
86 Passwords: hunter2
86 Passwords: hunter2
87 $ hg cat -r 0 target
87 $ hg cat -r 0 target
88 Initially untainted file
88 Initially untainted file
89
89
90 Censor revision with 1 offense
90 Censor revision with 1 offense
91
91
92 $ hg censor -r $C1 target
92 $ hg censor -r $C1 target
93 $ hg cat -r $H1 target
93 $ hg cat -r $H1 target
94 Tainted file is now sanitized
94 Tainted file is now sanitized
95 $ hg cat -r $H2 target
95 $ hg cat -r $H2 target
96 Tainted file now super sanitized
96 Tainted file now super sanitized
97 $ hg cat -r $C2 target
97 $ hg cat -r $C2 target
98 abort: censored node: 1e0247a9a4b7
98 abort: censored node: 1e0247a9a4b7
99 (set censor.policy to ignore errors)
99 (set censor.policy to ignore errors)
100 [255]
100 [255]
101 $ hg cat -r $C1 target
101 $ hg cat -r $C1 target
102 abort: censored node: 613bc869fceb
102 abort: censored node: 613bc869fceb
103 (set censor.policy to ignore errors)
103 (set censor.policy to ignore errors)
104 [255]
104 [255]
105 $ hg cat -r 0 target
105 $ hg cat -r 0 target
106 Initially untainted file
106 Initially untainted file
107
107
108 Can only checkout target at uncensored revisions, -X is workaround for --all
108 Can only checkout target at uncensored revisions, -X is workaround for --all
109
109
110 $ hg revert -r $C2 target
110 $ hg revert -r $C2 target
111 abort: censored node: 1e0247a9a4b7
111 abort: censored node: 1e0247a9a4b7
112 (set censor.policy to ignore errors)
112 (set censor.policy to ignore errors)
113 [255]
113 [255]
114 $ hg revert -r $C1 target
114 $ hg revert -r $C1 target
115 abort: censored node: 613bc869fceb
115 abort: censored node: 613bc869fceb
116 (set censor.policy to ignore errors)
116 (set censor.policy to ignore errors)
117 [255]
117 [255]
118 $ hg revert -r $C1 --all
118 $ hg revert -r $C1 --all
119 reverting bystander
119 reverting bystander
120 reverting target
120 reverting target
121 abort: censored node: 613bc869fceb
121 abort: censored node: 613bc869fceb
122 (set censor.policy to ignore errors)
122 (set censor.policy to ignore errors)
123 [255]
123 [255]
124 $ hg revert -r $C1 --all -X target
124 $ hg revert -r $C1 --all -X target
125 $ cat target
125 $ cat target
126 Tainted file now super sanitized
126 Tainted file now super sanitized
127 $ hg revert -r 0 --all
127 $ hg revert -r 0 --all
128 reverting target
128 reverting target
129 $ cat target
129 $ cat target
130 Initially untainted file
130 Initially untainted file
131 $ hg revert -r $H2 --all
131 $ hg revert -r $H2 --all
132 reverting bystander
132 reverting bystander
133 reverting target
133 reverting target
134 $ cat target
134 $ cat target
135 Tainted file now super sanitized
135 Tainted file now super sanitized
136
136
137 Uncensored file can be viewed at any revision
137 Uncensored file can be viewed at any revision
138
138
139 $ hg cat -r $H1 bystander
139 $ hg cat -r $H1 bystander
140 Normal file v2
140 Normal file v2
141 $ hg cat -r $C2 bystander
141 $ hg cat -r $C2 bystander
142 Normal file v2
142 Normal file v2
143 $ hg cat -r $C1 bystander
143 $ hg cat -r $C1 bystander
144 Normal file here
144 Normal file here
145 $ hg cat -r 0 bystander
145 $ hg cat -r 0 bystander
146 Normal file here
146 Normal file here
147
147
148 Can update to children of censored revision
148 Can update to children of censored revision
149
149
150 $ hg update -r $H1
150 $ hg update -r $H1
151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 $ cat target
152 $ cat target
153 Tainted file is now sanitized
153 Tainted file is now sanitized
154 $ hg update -r $H2
154 $ hg update -r $H2
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 $ cat target
156 $ cat target
157 Tainted file now super sanitized
157 Tainted file now super sanitized
158
158
159 Set censor policy to abort in trusted $HGRC so hg verify fails
159 Set censor policy to abort in trusted $HGRC so hg verify fails
160
160
161 $ cp $HGRCPATH.orig $HGRCPATH
161 $ cp $HGRCPATH.orig $HGRCPATH
162 $ cat >> $HGRCPATH <<EOF
162 $ cat >> $HGRCPATH <<EOF
163 > [censor]
163 > [censor]
164 > policy = abort
164 > policy = abort
165 > EOF
165 > EOF
166
166
167 Repo fails verification due to censorship
167 Repo fails verification due to censorship
168
168
169 $ hg verify
169 $ hg verify
170 checking changesets
170 checking changesets
171 checking manifests
171 checking manifests
172 crosschecking files in changesets and manifests
172 crosschecking files in changesets and manifests
173 checking files
173 checking files
174 target@1: censored file data
174 target@1: censored file data
175 target@2: censored file data
175 target@2: censored file data
176 2 files, 5 changesets, 7 total revisions
176 2 files, 5 changesets, 7 total revisions
177 2 integrity errors encountered!
177 2 integrity errors encountered!
178 (first damaged changeset appears to be 1)
178 (first damaged changeset appears to be 1)
179 [1]
179 [1]
180
180
181 Cannot update to revision with censored data
181 Cannot update to revision with censored data
182
182
183 $ hg update -r $C2
183 $ hg update -r $C2
184 abort: censored node: 1e0247a9a4b7
184 abort: censored node: 1e0247a9a4b7
185 (set censor.policy to ignore errors)
185 (set censor.policy to ignore errors)
186 [255]
186 [255]
187 $ hg update -r $C1
187 $ hg update -r $C1
188 abort: censored node: 613bc869fceb
188 abort: censored node: 613bc869fceb
189 (set censor.policy to ignore errors)
189 (set censor.policy to ignore errors)
190 [255]
190 [255]
191 $ hg update -r 0
191 $ hg update -r 0
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 $ hg update -r $H2
193 $ hg update -r $H2
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
195
195
196 Set censor policy to ignore in trusted $HGRC so hg verify passes
196 Set censor policy to ignore in trusted $HGRC so hg verify passes
197
197
198 $ cp $HGRCPATH.orig $HGRCPATH
198 $ cp $HGRCPATH.orig $HGRCPATH
199 $ cat >> $HGRCPATH <<EOF
199 $ cat >> $HGRCPATH <<EOF
200 > [censor]
200 > [censor]
201 > policy = ignore
201 > policy = ignore
202 > EOF
202 > EOF
203
203
204 Repo passes verification with warnings with explicit config
204 Repo passes verification with warnings with explicit config
205
205
206 $ hg verify
206 $ hg verify
207 checking changesets
207 checking changesets
208 checking manifests
208 checking manifests
209 crosschecking files in changesets and manifests
209 crosschecking files in changesets and manifests
210 checking files
210 checking files
211 2 files, 5 changesets, 7 total revisions
211 2 files, 5 changesets, 7 total revisions
212
212
213 May update to revision with censored data with explicit config
213 May update to revision with censored data with explicit config
214
214
215 $ hg update -r $C2
215 $ hg update -r $C2
216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
217 $ cat target
217 $ cat target
218 $ hg update -r $C1
218 $ hg update -r $C1
219 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 $ cat target
220 $ cat target
221 $ hg update -r 0
221 $ hg update -r 0
222 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 $ cat target
223 $ cat target
224 Initially untainted file
224 Initially untainted file
225 $ hg update -r $H2
225 $ hg update -r $H2
226 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
226 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 $ cat target
227 $ cat target
228 Tainted file now super sanitized
228 Tainted file now super sanitized
229
229
230 Can merge in revision with censored data. Test requires one branch of history
230 Can merge in revision with censored data. Test requires one branch of history
231 with the file censored, but we can't censor at a head, so advance H1.
231 with the file censored, but we can't censor at a head, so advance H1.
232
232
233 $ hg update -r $H1
233 $ hg update -r $H1
234 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 $ C3=$H1
235 $ C3=$H1
236 $ echo 'advanced head H1' > target
236 $ echo 'advanced head H1' > target
237 $ hg ci -m 'advance head H1' target
237 $ hg ci -m 'advance head H1' target
238 $ H1=`hg id --debug -i`
238 $ H1=`hg id --debug -i`
239 $ hg censor -r $C3 target
239 $ hg censor -r $C3 target
240 $ hg update -r $H2
240 $ hg update -r $H2
241 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
242 $ hg merge -r $C3
242 $ hg merge -r $C3
243 merging target
243 merging target
244 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
244 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
245 (branch merge, don't forget to commit)
245 (branch merge, don't forget to commit)
246
246
247 Revisions present in repository heads may not be censored
247 Revisions present in repository heads may not be censored
248
248
249 $ hg update -C -r $H2
249 $ hg update -C -r $H2
250 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
250 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
251 $ hg censor -r $H2 target
251 $ hg censor -r $H2 target
252 abort: cannot censor file in heads (78a8fc215e79)
252 abort: cannot censor file in heads (78a8fc215e79)
253 (clean/delete and commit first)
253 (clean/delete and commit first)
254 [255]
254 [255]
255 $ echo 'twiddling thumbs' > bystander
255 $ echo 'twiddling thumbs' > bystander
256 $ hg ci -m 'bystander commit'
256 $ hg ci -m 'bystander commit'
257 $ H2=`hg id --debug -i`
257 $ H2=`hg id --debug -i`
258 $ hg censor -r "$H2^" target
258 $ hg censor -r "$H2^" target
259 abort: cannot censor file in heads (efbe78065929)
259 abort: cannot censor file in heads (efbe78065929)
260 (clean/delete and commit first)
260 (clean/delete and commit first)
261 [255]
261 [255]
262
262
263 Cannot censor working directory
263 Cannot censor working directory
264
264
265 $ echo 'seriously no passwords' > target
265 $ echo 'seriously no passwords' > target
266 $ hg ci -m 'extend second head arbitrarily' target
266 $ hg ci -m 'extend second head arbitrarily' target
267 $ H2=`hg id --debug -i`
267 $ H2=`hg id --debug -i`
268 $ hg update -r "$H2^"
268 $ hg update -r "$H2^"
269 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 $ hg censor -r . target
270 $ hg censor -r . target
271 abort: cannot censor working directory
271 abort: cannot censor working directory
272 (clean/delete/update first)
272 (clean/delete/update first)
273 [255]
273 [255]
274 $ hg update -r $H2
274 $ hg update -r $H2
275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276
276
277 Can re-add file after being deleted + censored
277 Can re-add file after being deleted + censored
278
278
279 $ C4=$H2
279 $ C4=$H2
280 $ hg rm target
280 $ hg rm target
281 $ hg ci -m 'delete target so it may be censored'
281 $ hg ci -m 'delete target so it may be censored'
282 $ H2=`hg id --debug -i`
282 $ H2=`hg id --debug -i`
283 $ hg censor -r $C4 target
283 $ hg censor -r $C4 target
284 $ hg cat -r $C4 target
284 $ hg cat -r $C4 target
285 $ hg cat -r "$H2^^" target
285 $ hg cat -r "$H2^^" target
286 Tainted file now super sanitized
286 Tainted file now super sanitized
287 $ echo 'fresh start' > target
287 $ echo 'fresh start' > target
288 $ hg add target
288 $ hg add target
289 $ hg ci -m reincarnated target
289 $ hg ci -m reincarnated target
290 $ H2=`hg id --debug -i`
290 $ H2=`hg id --debug -i`
291 $ hg cat -r $H2 target
291 $ hg cat -r $H2 target
292 fresh start
292 fresh start
293 $ hg cat -r "$H2^" target
293 $ hg cat -r "$H2^" target
294 target: no such file in rev 452ec1762369
294 target: no such file in rev 452ec1762369
295 [1]
295 [1]
296 $ hg cat -r $C4 target
296 $ hg cat -r $C4 target
297 $ hg cat -r "$H2^^^" target
297 $ hg cat -r "$H2^^^" target
298 Tainted file now super sanitized
298 Tainted file now super sanitized
299
299
300 Can censor after revlog has expanded to no longer permit inline storage
300 Can censor after revlog has expanded to no longer permit inline storage
301
301
302 $ for x in `seq 0 50000`
302 $ for x in `python $TESTDIR/seq.py 0 50000`
303 > do
303 > do
304 > echo "Password: hunter$x" >> target
304 > echo "Password: hunter$x" >> target
305 > done
305 > done
306 $ hg ci -m 'add 100k passwords'
306 $ hg ci -m 'add 100k passwords'
307 $ H2=`hg id --debug -i`
307 $ H2=`hg id --debug -i`
308 $ C5=$H2
308 $ C5=$H2
309 $ hg revert -r "$H2^" target
309 $ hg revert -r "$H2^" target
310 $ hg ci -m 'cleaned 100k passwords'
310 $ hg ci -m 'cleaned 100k passwords'
311 $ H2=`hg id --debug -i`
311 $ H2=`hg id --debug -i`
312 $ hg censor -r $C5 target
312 $ hg censor -r $C5 target
313 $ hg cat -r $C5 target
313 $ hg cat -r $C5 target
314 $ hg cat -r $H2 target
314 $ hg cat -r $H2 target
315 fresh start
315 fresh start
316
316
317 Repo with censored nodes can be cloned and cloned nodes are censored
317 Repo with censored nodes can be cloned and cloned nodes are censored
318
318
319 $ cd ..
319 $ cd ..
320 $ hg clone r rclone
320 $ hg clone r rclone
321 updating to branch default
321 updating to branch default
322 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
322 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 $ cd rclone
323 $ cd rclone
324 $ hg cat -r $H1 target
324 $ hg cat -r $H1 target
325 advanced head H1
325 advanced head H1
326 $ hg cat -r $H2~5 target
326 $ hg cat -r $H2~5 target
327 Tainted file now super sanitized
327 Tainted file now super sanitized
328 $ hg cat -r $C2 target
328 $ hg cat -r $C2 target
329 $ hg cat -r $C1 target
329 $ hg cat -r $C1 target
330 $ hg cat -r 0 target
330 $ hg cat -r 0 target
331 Initially untainted file
331 Initially untainted file
332 $ hg verify
332 $ hg verify
333 checking changesets
333 checking changesets
334 checking manifests
334 checking manifests
335 crosschecking files in changesets and manifests
335 crosschecking files in changesets and manifests
336 checking files
336 checking files
337 2 files, 12 changesets, 13 total revisions
337 2 files, 12 changesets, 13 total revisions
338
338
339 Repo cloned before tainted content introduced can pull censored nodes
339 Repo cloned before tainted content introduced can pull censored nodes
340
340
341 $ cd ../rpull
341 $ cd ../rpull
342 $ hg cat -r tip target
342 $ hg cat -r tip target
343 Initially untainted file
343 Initially untainted file
344 $ hg verify
344 $ hg verify
345 checking changesets
345 checking changesets
346 checking manifests
346 checking manifests
347 crosschecking files in changesets and manifests
347 crosschecking files in changesets and manifests
348 checking files
348 checking files
349 2 files, 1 changesets, 2 total revisions
349 2 files, 1 changesets, 2 total revisions
350 $ hg pull -r $H1 -r $H2
350 $ hg pull -r $H1 -r $H2
351 pulling from $TESTTMP/r (glob)
351 pulling from $TESTTMP/r (glob)
352 searching for changes
352 searching for changes
353 adding changesets
353 adding changesets
354 adding manifests
354 adding manifests
355 adding file changes
355 adding file changes
356 added 11 changesets with 11 changes to 2 files (+1 heads)
356 added 11 changesets with 11 changes to 2 files (+1 heads)
357 (run 'hg heads' to see heads, 'hg merge' to merge)
357 (run 'hg heads' to see heads, 'hg merge' to merge)
358 $ hg update 4
358 $ hg update 4
359 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
359 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
360 $ cat target
360 $ cat target
361 Tainted file now super sanitized
361 Tainted file now super sanitized
362 $ hg cat -r $H1 target
362 $ hg cat -r $H1 target
363 advanced head H1
363 advanced head H1
364 $ hg cat -r $H2~5 target
364 $ hg cat -r $H2~5 target
365 Tainted file now super sanitized
365 Tainted file now super sanitized
366 $ hg cat -r $C2 target
366 $ hg cat -r $C2 target
367 $ hg cat -r $C1 target
367 $ hg cat -r $C1 target
368 $ hg cat -r 0 target
368 $ hg cat -r 0 target
369 Initially untainted file
369 Initially untainted file
370 $ hg verify
370 $ hg verify
371 checking changesets
371 checking changesets
372 checking manifests
372 checking manifests
373 crosschecking files in changesets and manifests
373 crosschecking files in changesets and manifests
374 checking files
374 checking files
375 2 files, 12 changesets, 13 total revisions
375 2 files, 12 changesets, 13 total revisions
376
376
377 Censored nodes can be pushed if they censor previously unexchanged nodes
377 Censored nodes can be pushed if they censor previously unexchanged nodes
378
378
379 $ echo 'Passwords: hunter2hunter2' > target
379 $ echo 'Passwords: hunter2hunter2' > target
380 $ hg ci -m 're-add password from clone' target
380 $ hg ci -m 're-add password from clone' target
381 created new head
381 created new head
382 $ H3=`hg id --debug -i`
382 $ H3=`hg id --debug -i`
383 $ REV=$H3
383 $ REV=$H3
384 $ echo 'Re-sanitized; nothing to see here' > target
384 $ echo 'Re-sanitized; nothing to see here' > target
385 $ hg ci -m 're-sanitized' target
385 $ hg ci -m 're-sanitized' target
386 $ H2=`hg id --debug -i`
386 $ H2=`hg id --debug -i`
387 $ CLEANREV=$H2
387 $ CLEANREV=$H2
388 $ hg cat -r $REV target
388 $ hg cat -r $REV target
389 Passwords: hunter2hunter2
389 Passwords: hunter2hunter2
390 $ hg censor -r $REV target
390 $ hg censor -r $REV target
391 $ hg cat -r $REV target
391 $ hg cat -r $REV target
392 $ hg cat -r $CLEANREV target
392 $ hg cat -r $CLEANREV target
393 Re-sanitized; nothing to see here
393 Re-sanitized; nothing to see here
394 $ hg push -f -r $H2
394 $ hg push -f -r $H2
395 pushing to $TESTTMP/r (glob)
395 pushing to $TESTTMP/r (glob)
396 searching for changes
396 searching for changes
397 adding changesets
397 adding changesets
398 adding manifests
398 adding manifests
399 adding file changes
399 adding file changes
400 added 2 changesets with 2 changes to 1 files (+1 heads)
400 added 2 changesets with 2 changes to 1 files (+1 heads)
401
401
402 $ cd ../r
402 $ cd ../r
403 $ hg cat -r $REV target
403 $ hg cat -r $REV target
404 $ hg cat -r $CLEANREV target
404 $ hg cat -r $CLEANREV target
405 Re-sanitized; nothing to see here
405 Re-sanitized; nothing to see here
406 $ hg update $CLEANREV
406 $ hg update $CLEANREV
407 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
408 $ cat target
408 $ cat target
409 Re-sanitized; nothing to see here
409 Re-sanitized; nothing to see here
410
410
411 Censored nodes can be bundled up and unbundled in another repo
411 Censored nodes can be bundled up and unbundled in another repo
412
412
413 $ hg bundle --base 0 ../pwbundle
413 $ hg bundle --base 0 ../pwbundle
414 13 changesets found
414 13 changesets found
415 $ cd ../rclone
415 $ cd ../rclone
416 $ hg unbundle ../pwbundle
416 $ hg unbundle ../pwbundle
417 adding changesets
417 adding changesets
418 adding manifests
418 adding manifests
419 adding file changes
419 adding file changes
420 added 2 changesets with 2 changes to 2 files (+1 heads)
420 added 2 changesets with 2 changes to 2 files (+1 heads)
421 (run 'hg heads .' to see heads, 'hg merge' to merge)
421 (run 'hg heads .' to see heads, 'hg merge' to merge)
422 $ hg cat -r $REV target
422 $ hg cat -r $REV target
423 $ hg cat -r $CLEANREV target
423 $ hg cat -r $CLEANREV target
424 Re-sanitized; nothing to see here
424 Re-sanitized; nothing to see here
425 $ hg update $CLEANREV
425 $ hg update $CLEANREV
426 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
426 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
427 $ cat target
427 $ cat target
428 Re-sanitized; nothing to see here
428 Re-sanitized; nothing to see here
429 $ hg verify
429 $ hg verify
430 checking changesets
430 checking changesets
431 checking manifests
431 checking manifests
432 crosschecking files in changesets and manifests
432 crosschecking files in changesets and manifests
433 checking files
433 checking files
434 2 files, 14 changesets, 15 total revisions
434 2 files, 14 changesets, 15 total revisions
435
435
436 Censored nodes can be imported on top of censored nodes, consecutively
436 Censored nodes can be imported on top of censored nodes, consecutively
437
437
438 $ hg init ../rimport
438 $ hg init ../rimport
439 $ hg bundle --base 1 ../rimport/splitbundle
439 $ hg bundle --base 1 ../rimport/splitbundle
440 12 changesets found
440 12 changesets found
441 $ cd ../rimport
441 $ cd ../rimport
442 $ hg pull -r $H1 -r $H2 ../r
442 $ hg pull -r $H1 -r $H2 ../r
443 pulling from ../r
443 pulling from ../r
444 adding changesets
444 adding changesets
445 adding manifests
445 adding manifests
446 adding file changes
446 adding file changes
447 added 8 changesets with 10 changes to 2 files (+1 heads)
447 added 8 changesets with 10 changes to 2 files (+1 heads)
448 (run 'hg heads' to see heads, 'hg merge' to merge)
448 (run 'hg heads' to see heads, 'hg merge' to merge)
449 $ hg unbundle splitbundle
449 $ hg unbundle splitbundle
450 adding changesets
450 adding changesets
451 adding manifests
451 adding manifests
452 adding file changes
452 adding file changes
453 added 6 changesets with 5 changes to 2 files (+1 heads)
453 added 6 changesets with 5 changes to 2 files (+1 heads)
454 (run 'hg heads .' to see heads, 'hg merge' to merge)
454 (run 'hg heads .' to see heads, 'hg merge' to merge)
455 $ hg update $H2
455 $ hg update $H2
456 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
456 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
457 $ cat target
457 $ cat target
458 Re-sanitized; nothing to see here
458 Re-sanitized; nothing to see here
459 $ hg verify
459 $ hg verify
460 checking changesets
460 checking changesets
461 checking manifests
461 checking manifests
462 crosschecking files in changesets and manifests
462 crosschecking files in changesets and manifests
463 checking files
463 checking files
464 2 files, 14 changesets, 15 total revisions
464 2 files, 14 changesets, 15 total revisions
465 $ cd ../r
465 $ cd ../r
466
466
467 Can import bundle where first revision of a file is censored
467 Can import bundle where first revision of a file is censored
468
468
469 $ hg init ../rinit
469 $ hg init ../rinit
470 $ hg censor -r 0 target
470 $ hg censor -r 0 target
471 $ hg bundle -r 0 --base null ../rinit/initbundle
471 $ hg bundle -r 0 --base null ../rinit/initbundle
472 1 changesets found
472 1 changesets found
473 $ cd ../rinit
473 $ cd ../rinit
474 $ hg unbundle initbundle
474 $ hg unbundle initbundle
475 adding changesets
475 adding changesets
476 adding manifests
476 adding manifests
477 adding file changes
477 adding file changes
478 added 1 changesets with 2 changes to 2 files
478 added 1 changesets with 2 changes to 2 files
479 (run 'hg update' to get a working copy)
479 (run 'hg update' to get a working copy)
480 $ hg cat -r 0 target
480 $ hg cat -r 0 target
@@ -1,184 +1,184 b''
1 Set up a repo
1 Set up a repo
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [ui]
4 > [ui]
5 > interactive = true
5 > interactive = true
6 > [experimental]
6 > [experimental]
7 > crecord = true
7 > crecord = true
8 > crecordtest = testModeCommands
8 > crecordtest = testModeCommands
9 > EOF
9 > EOF
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13
13
14 Committing some changes but stopping on the way
14 Committing some changes but stopping on the way
15
15
16 $ echo "a" > a
16 $ echo "a" > a
17 $ hg add a
17 $ hg add a
18 $ cat <<EOF >testModeCommands
18 $ cat <<EOF >testModeCommands
19 > TOGGLE
19 > TOGGLE
20 > X
20 > X
21 > EOF
21 > EOF
22 $ hg commit -i -m "a" -d "0 0"
22 $ hg commit -i -m "a" -d "0 0"
23 no changes to record
23 no changes to record
24 $ hg tip
24 $ hg tip
25 changeset: -1:000000000000
25 changeset: -1:000000000000
26 tag: tip
26 tag: tip
27 user:
27 user:
28 date: Thu Jan 01 00:00:00 1970 +0000
28 date: Thu Jan 01 00:00:00 1970 +0000
29
29
30
30
31 Committing some changes
31 Committing some changes
32
32
33 $ cat <<EOF >testModeCommands
33 $ cat <<EOF >testModeCommands
34 > X
34 > X
35 > EOF
35 > EOF
36 $ hg commit -i -m "a" -d "0 0"
36 $ hg commit -i -m "a" -d "0 0"
37 $ hg tip
37 $ hg tip
38 changeset: 0:cb9a9f314b8b
38 changeset: 0:cb9a9f314b8b
39 tag: tip
39 tag: tip
40 user: test
40 user: test
41 date: Thu Jan 01 00:00:00 1970 +0000
41 date: Thu Jan 01 00:00:00 1970 +0000
42 summary: a
42 summary: a
43
43
44 Committing only one file
44 Committing only one file
45
45
46 $ echo "a" >> a
46 $ echo "a" >> a
47 $ seq 1 10 > b
47 $ python $TESTDIR/seq.py 1 10 > b
48 $ hg add b
48 $ hg add b
49 $ cat <<EOF >testModeCommands
49 $ cat <<EOF >testModeCommands
50 > TOGGLE
50 > TOGGLE
51 > KEY_DOWN
51 > KEY_DOWN
52 > X
52 > X
53 > EOF
53 > EOF
54 $ hg commit -i -m "one file" -d "0 0"
54 $ hg commit -i -m "one file" -d "0 0"
55 $ hg tip
55 $ hg tip
56 changeset: 1:fb2705a663ea
56 changeset: 1:fb2705a663ea
57 tag: tip
57 tag: tip
58 user: test
58 user: test
59 date: Thu Jan 01 00:00:00 1970 +0000
59 date: Thu Jan 01 00:00:00 1970 +0000
60 summary: one file
60 summary: one file
61
61
62 $ hg cat -r tip a
62 $ hg cat -r tip a
63 a
63 a
64 $ cat a
64 $ cat a
65 a
65 a
66 a
66 a
67
67
68 Committing only one hunk
68 Committing only one hunk
69
69
70 - Untoggle all the hunks, go down to the second file
70 - Untoggle all the hunks, go down to the second file
71 - unfold it
71 - unfold it
72 - go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike)
72 - go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike)
73 - toggle the second hunk
73 - toggle the second hunk
74 - commit
74 - commit
75
75
76 $ echo "x" > c
76 $ echo "x" > c
77 $ cat b >> c
77 $ cat b >> c
78 $ echo "y" >> c
78 $ echo "y" >> c
79 $ mv c b
79 $ mv c b
80 $ cat <<EOF >testModeCommands
80 $ cat <<EOF >testModeCommands
81 > A
81 > A
82 > KEY_DOWN
82 > KEY_DOWN
83 > f
83 > f
84 > KEY_DOWN
84 > KEY_DOWN
85 > KEY_DOWN
85 > KEY_DOWN
86 > KEY_DOWN
86 > KEY_DOWN
87 > KEY_DOWN
87 > KEY_DOWN
88 > TOGGLE
88 > TOGGLE
89 > X
89 > X
90 > EOF
90 > EOF
91 $ hg commit -i -m "one hunk" -d "0 0"
91 $ hg commit -i -m "one hunk" -d "0 0"
92 $ hg tip
92 $ hg tip
93 changeset: 2:7d10dfe755a8
93 changeset: 2:7d10dfe755a8
94 tag: tip
94 tag: tip
95 user: test
95 user: test
96 date: Thu Jan 01 00:00:00 1970 +0000
96 date: Thu Jan 01 00:00:00 1970 +0000
97 summary: one hunk
97 summary: one hunk
98
98
99 $ hg cat -r tip b
99 $ hg cat -r tip b
100 1
100 1
101 2
101 2
102 3
102 3
103 4
103 4
104 5
104 5
105 6
105 6
106 7
106 7
107 8
107 8
108 9
108 9
109 10
109 10
110 y
110 y
111 $ cat b
111 $ cat b
112 x
112 x
113 1
113 1
114 2
114 2
115 3
115 3
116 4
116 4
117 5
117 5
118 6
118 6
119 7
119 7
120 8
120 8
121 9
121 9
122 10
122 10
123 y
123 y
124 $ hg commit -m "other hunks"
124 $ hg commit -m "other hunks"
125 $ hg tip
125 $ hg tip
126 changeset: 3:a6735021574d
126 changeset: 3:a6735021574d
127 tag: tip
127 tag: tip
128 user: test
128 user: test
129 date: Thu Jan 01 00:00:00 1970 +0000
129 date: Thu Jan 01 00:00:00 1970 +0000
130 summary: other hunks
130 summary: other hunks
131
131
132 $ hg cat -r tip b
132 $ hg cat -r tip b
133 x
133 x
134 1
134 1
135 2
135 2
136 3
136 3
137 4
137 4
138 5
138 5
139 6
139 6
140 7
140 7
141 8
141 8
142 9
142 9
143 10
143 10
144 y
144 y
145
145
146 Editing patch of newly added file
146 Editing patch of newly added file
147
147
148 $ cat > editor.sh << '__EOF__'
148 $ cat > editor.sh << '__EOF__'
149 > cat "$1" | sed "s/first/very/g" > tt
149 > cat "$1" | sed "s/first/very/g" > tt
150 > mv tt "$1"
150 > mv tt "$1"
151 > __EOF__
151 > __EOF__
152 $ cat > newfile << '__EOF__'
152 $ cat > newfile << '__EOF__'
153 > This is the first line
153 > This is the first line
154 > This is the second line
154 > This is the second line
155 > This is the third line
155 > This is the third line
156 > __EOF__
156 > __EOF__
157 $ hg add newfile
157 $ hg add newfile
158 $ cat <<EOF >testModeCommands
158 $ cat <<EOF >testModeCommands
159 > f
159 > f
160 > KEY_DOWN
160 > KEY_DOWN
161 > KEY_DOWN
161 > KEY_DOWN
162 > KEY_DOWN
162 > KEY_DOWN
163 > e
163 > e
164 > X
164 > X
165 > EOF
165 > EOF
166 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new
166 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new
167 $ hg tip
167 $ hg tip
168 changeset: 4:6a0a43e9eff5
168 changeset: 4:6a0a43e9eff5
169 tag: tip
169 tag: tip
170 user: test
170 user: test
171 date: Thu Jan 01 00:00:23 1970 +0000
171 date: Thu Jan 01 00:00:23 1970 +0000
172 summary: edit-patch-new
172 summary: edit-patch-new
173
173
174 $ hg cat -r tip newfile
174 $ hg cat -r tip newfile
175 This is the very line
175 This is the very line
176 This is the second line
176 This is the second line
177 This is the third line
177 This is the third line
178
178
179 $ cat newfile
179 $ cat newfile
180 This is the first line
180 This is the first line
181 This is the second line
181 This is the second line
182 This is the third line
182 This is the third line
183
183
184
184
@@ -1,781 +1,781 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo foo > t1
3 $ echo foo > t1
4 $ hg add t1
4 $ hg add t1
5 $ hg commit -m "1"
5 $ hg commit -m "1"
6
6
7 $ cd ..
7 $ cd ..
8 $ hg clone a b
8 $ hg clone a b
9 updating to branch default
9 updating to branch default
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11
11
12 $ cd a
12 $ cd a
13 $ echo foo > t2
13 $ echo foo > t2
14 $ hg add t2
14 $ hg add t2
15 $ hg commit -m "2"
15 $ hg commit -m "2"
16
16
17 $ cd ../b
17 $ cd ../b
18 $ echo foo > t3
18 $ echo foo > t3
19 $ hg add t3
19 $ hg add t3
20 $ hg commit -m "3"
20 $ hg commit -m "3"
21
21
22 $ hg push ../a
22 $ hg push ../a
23 pushing to ../a
23 pushing to ../a
24 searching for changes
24 searching for changes
25 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a
25 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a
26 abort: push creates new remote head 1e108cc5548c!
26 abort: push creates new remote head 1e108cc5548c!
27 (pull and merge or see "hg help push" for details about pushing new heads)
27 (pull and merge or see "hg help push" for details about pushing new heads)
28 [255]
28 [255]
29
29
30 $ hg push --debug ../a
30 $ hg push --debug ../a
31 pushing to ../a
31 pushing to ../a
32 query 1; heads
32 query 1; heads
33 searching for changes
33 searching for changes
34 taking quick initial sample
34 taking quick initial sample
35 searching: 2 queries
35 searching: 2 queries
36 query 2; still undecided: 1, sample size is: 1
36 query 2; still undecided: 1, sample size is: 1
37 2 total queries
37 2 total queries
38 listing keys for "phases"
38 listing keys for "phases"
39 checking for updated bookmarks
39 checking for updated bookmarks
40 listing keys for "bookmarks"
40 listing keys for "bookmarks"
41 listing keys for "bookmarks"
41 listing keys for "bookmarks"
42 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a
42 remote has heads on branch 'default' that are not known locally: 1c9246a22a0a
43 new remote heads on branch 'default':
43 new remote heads on branch 'default':
44 1e108cc5548c
44 1e108cc5548c
45 abort: push creates new remote head 1e108cc5548c!
45 abort: push creates new remote head 1e108cc5548c!
46 (pull and merge or see "hg help push" for details about pushing new heads)
46 (pull and merge or see "hg help push" for details about pushing new heads)
47 [255]
47 [255]
48
48
49 $ hg pull ../a
49 $ hg pull ../a
50 pulling from ../a
50 pulling from ../a
51 searching for changes
51 searching for changes
52 adding changesets
52 adding changesets
53 adding manifests
53 adding manifests
54 adding file changes
54 adding file changes
55 added 1 changesets with 1 changes to 1 files (+1 heads)
55 added 1 changesets with 1 changes to 1 files (+1 heads)
56 (run 'hg heads' to see heads, 'hg merge' to merge)
56 (run 'hg heads' to see heads, 'hg merge' to merge)
57
57
58 $ hg push ../a
58 $ hg push ../a
59 pushing to ../a
59 pushing to ../a
60 searching for changes
60 searching for changes
61 abort: push creates new remote head 1e108cc5548c!
61 abort: push creates new remote head 1e108cc5548c!
62 (merge or see "hg help push" for details about pushing new heads)
62 (merge or see "hg help push" for details about pushing new heads)
63 [255]
63 [255]
64
64
65 $ hg merge
65 $ hg merge
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 (branch merge, don't forget to commit)
67 (branch merge, don't forget to commit)
68
68
69 $ hg commit -m "4"
69 $ hg commit -m "4"
70 $ hg push ../a
70 $ hg push ../a
71 pushing to ../a
71 pushing to ../a
72 searching for changes
72 searching for changes
73 adding changesets
73 adding changesets
74 adding manifests
74 adding manifests
75 adding file changes
75 adding file changes
76 added 2 changesets with 1 changes to 1 files
76 added 2 changesets with 1 changes to 1 files
77
77
78 $ cd ..
78 $ cd ..
79
79
80 $ hg init c
80 $ hg init c
81 $ cd c
81 $ cd c
82 $ for i in 0 1 2; do
82 $ for i in 0 1 2; do
83 > echo $i >> foo
83 > echo $i >> foo
84 > hg ci -Am $i
84 > hg ci -Am $i
85 > done
85 > done
86 adding foo
86 adding foo
87 $ cd ..
87 $ cd ..
88
88
89 $ hg clone c d
89 $ hg clone c d
90 updating to branch default
90 updating to branch default
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92
92
93 $ cd d
93 $ cd d
94 $ for i in 0 1; do
94 $ for i in 0 1; do
95 > hg co -C $i
95 > hg co -C $i
96 > echo d-$i >> foo
96 > echo d-$i >> foo
97 > hg ci -m d-$i
97 > hg ci -m d-$i
98 > done
98 > done
99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 created new head
100 created new head
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 created new head
102 created new head
103
103
104 $ HGMERGE=true hg merge 3
104 $ HGMERGE=true hg merge 3
105 merging foo
105 merging foo
106 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
106 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
107 (branch merge, don't forget to commit)
107 (branch merge, don't forget to commit)
108
108
109 $ hg ci -m c-d
109 $ hg ci -m c-d
110
110
111 $ hg push ../c
111 $ hg push ../c
112 pushing to ../c
112 pushing to ../c
113 searching for changes
113 searching for changes
114 abort: push creates new remote head 6346d66eb9f5!
114 abort: push creates new remote head 6346d66eb9f5!
115 (merge or see "hg help push" for details about pushing new heads)
115 (merge or see "hg help push" for details about pushing new heads)
116 [255]
116 [255]
117
117
118 $ hg push -r 2 ../c
118 $ hg push -r 2 ../c
119 pushing to ../c
119 pushing to ../c
120 searching for changes
120 searching for changes
121 no changes found
121 no changes found
122 [1]
122 [1]
123
123
124 $ hg push -r 3 ../c
124 $ hg push -r 3 ../c
125 pushing to ../c
125 pushing to ../c
126 searching for changes
126 searching for changes
127 abort: push creates new remote head a5dda829a167!
127 abort: push creates new remote head a5dda829a167!
128 (merge or see "hg help push" for details about pushing new heads)
128 (merge or see "hg help push" for details about pushing new heads)
129 [255]
129 [255]
130
130
131 $ hg push -v -r 3 -r 4 ../c
131 $ hg push -v -r 3 -r 4 ../c
132 pushing to ../c
132 pushing to ../c
133 searching for changes
133 searching for changes
134 new remote heads on branch 'default':
134 new remote heads on branch 'default':
135 a5dda829a167
135 a5dda829a167
136 ee8fbc7a0295
136 ee8fbc7a0295
137 abort: push creates new remote head a5dda829a167!
137 abort: push creates new remote head a5dda829a167!
138 (merge or see "hg help push" for details about pushing new heads)
138 (merge or see "hg help push" for details about pushing new heads)
139 [255]
139 [255]
140
140
141 $ hg push -v -f -r 3 -r 4 ../c
141 $ hg push -v -f -r 3 -r 4 ../c
142 pushing to ../c
142 pushing to ../c
143 searching for changes
143 searching for changes
144 2 changesets found
144 2 changesets found
145 uncompressed size of bundle content:
145 uncompressed size of bundle content:
146 308 (changelog)
146 308 (changelog)
147 286 (manifests)
147 286 (manifests)
148 213 foo
148 213 foo
149 adding changesets
149 adding changesets
150 adding manifests
150 adding manifests
151 adding file changes
151 adding file changes
152 added 2 changesets with 2 changes to 1 files (+2 heads)
152 added 2 changesets with 2 changes to 1 files (+2 heads)
153
153
154 $ hg push -r 5 ../c
154 $ hg push -r 5 ../c
155 pushing to ../c
155 pushing to ../c
156 searching for changes
156 searching for changes
157 adding changesets
157 adding changesets
158 adding manifests
158 adding manifests
159 adding file changes
159 adding file changes
160 added 1 changesets with 1 changes to 1 files (-1 heads)
160 added 1 changesets with 1 changes to 1 files (-1 heads)
161
161
162 $ hg in ../c
162 $ hg in ../c
163 comparing with ../c
163 comparing with ../c
164 searching for changes
164 searching for changes
165 no changes found
165 no changes found
166 [1]
166 [1]
167
167
168
168
169 Issue450: push -r warns about remote head creation even if no heads
169 Issue450: push -r warns about remote head creation even if no heads
170 will be created
170 will be created
171
171
172 $ hg init ../e
172 $ hg init ../e
173 $ hg push -r 0 ../e
173 $ hg push -r 0 ../e
174 pushing to ../e
174 pushing to ../e
175 searching for changes
175 searching for changes
176 adding changesets
176 adding changesets
177 adding manifests
177 adding manifests
178 adding file changes
178 adding file changes
179 added 1 changesets with 1 changes to 1 files
179 added 1 changesets with 1 changes to 1 files
180
180
181 $ hg push -r 1 ../e
181 $ hg push -r 1 ../e
182 pushing to ../e
182 pushing to ../e
183 searching for changes
183 searching for changes
184 adding changesets
184 adding changesets
185 adding manifests
185 adding manifests
186 adding file changes
186 adding file changes
187 added 1 changesets with 1 changes to 1 files
187 added 1 changesets with 1 changes to 1 files
188
188
189 $ cd ..
189 $ cd ..
190
190
191
191
192 Issue736: named branches are not considered for detection of
192 Issue736: named branches are not considered for detection of
193 unmerged heads in "hg push"
193 unmerged heads in "hg push"
194
194
195 $ hg init f
195 $ hg init f
196 $ cd f
196 $ cd f
197 $ hg -q branch a
197 $ hg -q branch a
198 $ echo 0 > foo
198 $ echo 0 > foo
199 $ hg -q ci -Am 0
199 $ hg -q ci -Am 0
200 $ echo 1 > foo
200 $ echo 1 > foo
201 $ hg -q ci -m 1
201 $ hg -q ci -m 1
202 $ hg -q up 0
202 $ hg -q up 0
203 $ echo 2 > foo
203 $ echo 2 > foo
204 $ hg -q ci -m 2
204 $ hg -q ci -m 2
205 $ hg -q up 0
205 $ hg -q up 0
206 $ hg -q branch b
206 $ hg -q branch b
207 $ echo 3 > foo
207 $ echo 3 > foo
208 $ hg -q ci -m 3
208 $ hg -q ci -m 3
209 $ cd ..
209 $ cd ..
210
210
211 $ hg -q clone f g
211 $ hg -q clone f g
212 $ cd g
212 $ cd g
213
213
214 Push on existing branch and new branch:
214 Push on existing branch and new branch:
215
215
216 $ hg -q up 1
216 $ hg -q up 1
217 $ echo 4 > foo
217 $ echo 4 > foo
218 $ hg -q ci -m 4
218 $ hg -q ci -m 4
219 $ hg -q up 0
219 $ hg -q up 0
220 $ echo 5 > foo
220 $ echo 5 > foo
221 $ hg -q branch c
221 $ hg -q branch c
222 $ hg -q ci -m 5
222 $ hg -q ci -m 5
223
223
224 $ hg push ../f
224 $ hg push ../f
225 pushing to ../f
225 pushing to ../f
226 searching for changes
226 searching for changes
227 abort: push creates new remote branches: c!
227 abort: push creates new remote branches: c!
228 (use 'hg push --new-branch' to create new remote branches)
228 (use 'hg push --new-branch' to create new remote branches)
229 [255]
229 [255]
230
230
231 $ hg push -r 4 -r 5 ../f
231 $ hg push -r 4 -r 5 ../f
232 pushing to ../f
232 pushing to ../f
233 searching for changes
233 searching for changes
234 abort: push creates new remote branches: c!
234 abort: push creates new remote branches: c!
235 (use 'hg push --new-branch' to create new remote branches)
235 (use 'hg push --new-branch' to create new remote branches)
236 [255]
236 [255]
237
237
238
238
239 Multiple new branches:
239 Multiple new branches:
240
240
241 $ hg -q branch d
241 $ hg -q branch d
242 $ echo 6 > foo
242 $ echo 6 > foo
243 $ hg -q ci -m 6
243 $ hg -q ci -m 6
244
244
245 $ hg push ../f
245 $ hg push ../f
246 pushing to ../f
246 pushing to ../f
247 searching for changes
247 searching for changes
248 abort: push creates new remote branches: c, d!
248 abort: push creates new remote branches: c, d!
249 (use 'hg push --new-branch' to create new remote branches)
249 (use 'hg push --new-branch' to create new remote branches)
250 [255]
250 [255]
251
251
252 $ hg push -r 4 -r 6 ../f
252 $ hg push -r 4 -r 6 ../f
253 pushing to ../f
253 pushing to ../f
254 searching for changes
254 searching for changes
255 abort: push creates new remote branches: c, d!
255 abort: push creates new remote branches: c, d!
256 (use 'hg push --new-branch' to create new remote branches)
256 (use 'hg push --new-branch' to create new remote branches)
257 [255]
257 [255]
258
258
259 $ cd ../g
259 $ cd ../g
260
260
261
261
262 Fail on multiple head push:
262 Fail on multiple head push:
263
263
264 $ hg -q up 1
264 $ hg -q up 1
265 $ echo 7 > foo
265 $ echo 7 > foo
266 $ hg -q ci -m 7
266 $ hg -q ci -m 7
267
267
268 $ hg push -r 4 -r 7 ../f
268 $ hg push -r 4 -r 7 ../f
269 pushing to ../f
269 pushing to ../f
270 searching for changes
270 searching for changes
271 abort: push creates new remote head 0b715ef6ff8f on branch 'a'!
271 abort: push creates new remote head 0b715ef6ff8f on branch 'a'!
272 (merge or see "hg help push" for details about pushing new heads)
272 (merge or see "hg help push" for details about pushing new heads)
273 [255]
273 [255]
274
274
275 Push replacement head on existing branches:
275 Push replacement head on existing branches:
276
276
277 $ hg -q up 3
277 $ hg -q up 3
278 $ echo 8 > foo
278 $ echo 8 > foo
279 $ hg -q ci -m 8
279 $ hg -q ci -m 8
280
280
281 $ hg push -r 7 -r 8 ../f
281 $ hg push -r 7 -r 8 ../f
282 pushing to ../f
282 pushing to ../f
283 searching for changes
283 searching for changes
284 adding changesets
284 adding changesets
285 adding manifests
285 adding manifests
286 adding file changes
286 adding file changes
287 added 2 changesets with 2 changes to 1 files
287 added 2 changesets with 2 changes to 1 files
288
288
289
289
290 Merge of branch a to other branch b followed by unrelated push
290 Merge of branch a to other branch b followed by unrelated push
291 on branch a:
291 on branch a:
292
292
293 $ hg -q up 7
293 $ hg -q up 7
294 $ HGMERGE=true hg -q merge 8
294 $ HGMERGE=true hg -q merge 8
295 $ hg -q ci -m 9
295 $ hg -q ci -m 9
296 $ hg -q up 8
296 $ hg -q up 8
297 $ echo 10 > foo
297 $ echo 10 > foo
298 $ hg -q ci -m 10
298 $ hg -q ci -m 10
299
299
300 $ hg push -r 9 ../f
300 $ hg push -r 9 ../f
301 pushing to ../f
301 pushing to ../f
302 searching for changes
302 searching for changes
303 adding changesets
303 adding changesets
304 adding manifests
304 adding manifests
305 adding file changes
305 adding file changes
306 added 1 changesets with 1 changes to 1 files (-1 heads)
306 added 1 changesets with 1 changes to 1 files (-1 heads)
307
307
308 $ hg push -r 10 ../f
308 $ hg push -r 10 ../f
309 pushing to ../f
309 pushing to ../f
310 searching for changes
310 searching for changes
311 adding changesets
311 adding changesets
312 adding manifests
312 adding manifests
313 adding file changes
313 adding file changes
314 added 1 changesets with 1 changes to 1 files (+1 heads)
314 added 1 changesets with 1 changes to 1 files (+1 heads)
315
315
316
316
317 Cheating the counting algorithm:
317 Cheating the counting algorithm:
318
318
319 $ hg -q up 9
319 $ hg -q up 9
320 $ HGMERGE=true hg -q merge 2
320 $ HGMERGE=true hg -q merge 2
321 $ hg -q ci -m 11
321 $ hg -q ci -m 11
322 $ hg -q up 1
322 $ hg -q up 1
323 $ echo 12 > foo
323 $ echo 12 > foo
324 $ hg -q ci -m 12
324 $ hg -q ci -m 12
325
325
326 $ hg push -r 11 -r 12 ../f
326 $ hg push -r 11 -r 12 ../f
327 pushing to ../f
327 pushing to ../f
328 searching for changes
328 searching for changes
329 adding changesets
329 adding changesets
330 adding manifests
330 adding manifests
331 adding file changes
331 adding file changes
332 added 2 changesets with 2 changes to 1 files
332 added 2 changesets with 2 changes to 1 files
333
333
334
334
335 Failed push of new named branch:
335 Failed push of new named branch:
336
336
337 $ echo 12 > foo
337 $ echo 12 > foo
338 $ hg -q ci -m 12a
338 $ hg -q ci -m 12a
339 [1]
339 [1]
340 $ hg -q up 11
340 $ hg -q up 11
341 $ echo 13 > foo
341 $ echo 13 > foo
342 $ hg -q branch e
342 $ hg -q branch e
343 $ hg -q ci -m 13d
343 $ hg -q ci -m 13d
344
344
345 $ hg push -r 12 -r 13 ../f
345 $ hg push -r 12 -r 13 ../f
346 pushing to ../f
346 pushing to ../f
347 searching for changes
347 searching for changes
348 abort: push creates new remote branches: e!
348 abort: push creates new remote branches: e!
349 (use 'hg push --new-branch' to create new remote branches)
349 (use 'hg push --new-branch' to create new remote branches)
350 [255]
350 [255]
351
351
352
352
353 Using --new-branch to push new named branch:
353 Using --new-branch to push new named branch:
354
354
355 $ hg push --new-branch -r 12 -r 13 ../f
355 $ hg push --new-branch -r 12 -r 13 ../f
356 pushing to ../f
356 pushing to ../f
357 searching for changes
357 searching for changes
358 adding changesets
358 adding changesets
359 adding manifests
359 adding manifests
360 adding file changes
360 adding file changes
361 added 1 changesets with 1 changes to 1 files
361 added 1 changesets with 1 changes to 1 files
362
362
363 Pushing multi headed new branch:
363 Pushing multi headed new branch:
364
364
365 $ echo 14 > foo
365 $ echo 14 > foo
366 $ hg -q branch f
366 $ hg -q branch f
367 $ hg -q ci -m 14
367 $ hg -q ci -m 14
368 $ echo 15 > foo
368 $ echo 15 > foo
369 $ hg -q ci -m 15
369 $ hg -q ci -m 15
370 $ hg -q up 14
370 $ hg -q up 14
371 $ echo 16 > foo
371 $ echo 16 > foo
372 $ hg -q ci -m 16
372 $ hg -q ci -m 16
373 $ hg push --branch f --new-branch ../f
373 $ hg push --branch f --new-branch ../f
374 pushing to ../f
374 pushing to ../f
375 searching for changes
375 searching for changes
376 abort: push creates new branch 'f' with multiple heads
376 abort: push creates new branch 'f' with multiple heads
377 (merge or see "hg help push" for details about pushing new heads)
377 (merge or see "hg help push" for details about pushing new heads)
378 [255]
378 [255]
379 $ hg push --branch f --new-branch --force ../f
379 $ hg push --branch f --new-branch --force ../f
380 pushing to ../f
380 pushing to ../f
381 searching for changes
381 searching for changes
382 adding changesets
382 adding changesets
383 adding manifests
383 adding manifests
384 adding file changes
384 adding file changes
385 added 3 changesets with 3 changes to 1 files (+1 heads)
385 added 3 changesets with 3 changes to 1 files (+1 heads)
386
386
387 Checking prepush logic does not allow silently pushing
387 Checking prepush logic does not allow silently pushing
388 multiple new heads but also doesn't report too many heads:
388 multiple new heads but also doesn't report too many heads:
389
389
390 $ cd ..
390 $ cd ..
391 $ hg init h
391 $ hg init h
392 $ echo init > h/init
392 $ echo init > h/init
393 $ hg -R h ci -Am init
393 $ hg -R h ci -Am init
394 adding init
394 adding init
395 $ echo a > h/a
395 $ echo a > h/a
396 $ hg -R h ci -Am a
396 $ hg -R h ci -Am a
397 adding a
397 adding a
398 $ hg clone h i
398 $ hg clone h i
399 updating to branch default
399 updating to branch default
400 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
400 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
401 $ hg -R h up 0
401 $ hg -R h up 0
402 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
402 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
403 $ echo b > h/b
403 $ echo b > h/b
404 $ hg -R h ci -Am b
404 $ hg -R h ci -Am b
405 adding b
405 adding b
406 created new head
406 created new head
407 $ hg -R i up 0
407 $ hg -R i up 0
408 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
408 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
409 $ echo c > i/c
409 $ echo c > i/c
410 $ hg -R i ci -Am c
410 $ hg -R i ci -Am c
411 adding c
411 adding c
412 created new head
412 created new head
413
413
414 $ for i in `seq 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done
414 $ for i in `python $TESTDIR/seq.py 3`; do hg -R h up -q 0; echo $i > h/b; hg -R h ci -qAm$i; done
415
415
416 $ hg -R i push h
416 $ hg -R i push h
417 pushing to h
417 pushing to h
418 searching for changes
418 searching for changes
419 remote has heads on branch 'default' that are not known locally: 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847
419 remote has heads on branch 'default' that are not known locally: 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847
420 abort: push creates new remote head 97bd0c84d346!
420 abort: push creates new remote head 97bd0c84d346!
421 (pull and merge or see "hg help push" for details about pushing new heads)
421 (pull and merge or see "hg help push" for details about pushing new heads)
422 [255]
422 [255]
423 $ hg -R h up -q 0; echo x > h/b; hg -R h ci -qAmx
423 $ hg -R h up -q 0; echo x > h/b; hg -R h ci -qAmx
424 $ hg -R i push h
424 $ hg -R i push h
425 pushing to h
425 pushing to h
426 searching for changes
426 searching for changes
427 remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 and 1 others
427 remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 and 1 others
428 abort: push creates new remote head 97bd0c84d346!
428 abort: push creates new remote head 97bd0c84d346!
429 (pull and merge or see "hg help push" for details about pushing new heads)
429 (pull and merge or see "hg help push" for details about pushing new heads)
430 [255]
430 [255]
431 $ hg -R i push h -v
431 $ hg -R i push h -v
432 pushing to h
432 pushing to h
433 searching for changes
433 searching for changes
434 remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847
434 remote has heads on branch 'default' that are not known locally: 18ddb72c4590 534543e22c29 764f8ec07b96 afe7cc7679f5 ce4212fc8847
435 new remote heads on branch 'default':
435 new remote heads on branch 'default':
436 97bd0c84d346
436 97bd0c84d346
437 abort: push creates new remote head 97bd0c84d346!
437 abort: push creates new remote head 97bd0c84d346!
438 (pull and merge or see "hg help push" for details about pushing new heads)
438 (pull and merge or see "hg help push" for details about pushing new heads)
439 [255]
439 [255]
440
440
441
441
442 Check prepush logic with merged branches:
442 Check prepush logic with merged branches:
443
443
444 $ hg init j
444 $ hg init j
445 $ hg -R j branch a
445 $ hg -R j branch a
446 marked working directory as branch a
446 marked working directory as branch a
447 (branches are permanent and global, did you want a bookmark?)
447 (branches are permanent and global, did you want a bookmark?)
448 $ echo init > j/foo
448 $ echo init > j/foo
449 $ hg -R j ci -Am init
449 $ hg -R j ci -Am init
450 adding foo
450 adding foo
451 $ hg clone j k
451 $ hg clone j k
452 updating to branch a
452 updating to branch a
453 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
453 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
454 $ echo a1 > j/foo
454 $ echo a1 > j/foo
455 $ hg -R j ci -m a1
455 $ hg -R j ci -m a1
456 $ hg -R k branch b
456 $ hg -R k branch b
457 marked working directory as branch b
457 marked working directory as branch b
458 (branches are permanent and global, did you want a bookmark?)
458 (branches are permanent and global, did you want a bookmark?)
459 $ echo b > k/foo
459 $ echo b > k/foo
460 $ hg -R k ci -m b
460 $ hg -R k ci -m b
461 $ hg -R k up 0
461 $ hg -R k up 0
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
463
463
464 $ hg -R k merge b
464 $ hg -R k merge b
465 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
465 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
466 (branch merge, don't forget to commit)
466 (branch merge, don't forget to commit)
467
467
468 $ hg -R k ci -m merge
468 $ hg -R k ci -m merge
469
469
470 $ hg -R k push -r a j
470 $ hg -R k push -r a j
471 pushing to j
471 pushing to j
472 searching for changes
472 searching for changes
473 abort: push creates new remote branches: b!
473 abort: push creates new remote branches: b!
474 (use 'hg push --new-branch' to create new remote branches)
474 (use 'hg push --new-branch' to create new remote branches)
475 [255]
475 [255]
476
476
477
477
478 Prepush -r should not allow you to sneak in new heads:
478 Prepush -r should not allow you to sneak in new heads:
479
479
480 $ hg init l
480 $ hg init l
481 $ cd l
481 $ cd l
482 $ echo a >> foo
482 $ echo a >> foo
483 $ hg -q add foo
483 $ hg -q add foo
484 $ hg -q branch a
484 $ hg -q branch a
485 $ hg -q ci -ma
485 $ hg -q ci -ma
486 $ hg -q up null
486 $ hg -q up null
487 $ echo a >> foo
487 $ echo a >> foo
488 $ hg -q add foo
488 $ hg -q add foo
489 $ hg -q branch b
489 $ hg -q branch b
490 $ hg -q ci -mb
490 $ hg -q ci -mb
491 $ cd ..
491 $ cd ..
492 $ hg -q clone l m -u a
492 $ hg -q clone l m -u a
493 $ cd m
493 $ cd m
494 $ hg -q merge b
494 $ hg -q merge b
495 $ hg -q ci -mmb
495 $ hg -q ci -mmb
496 $ hg -q up 0
496 $ hg -q up 0
497 $ echo a >> foo
497 $ echo a >> foo
498 $ hg -q ci -ma2
498 $ hg -q ci -ma2
499 $ hg -q up 2
499 $ hg -q up 2
500 $ echo a >> foo
500 $ echo a >> foo
501 $ hg -q branch -f b
501 $ hg -q branch -f b
502 $ hg -q ci -mb2
502 $ hg -q ci -mb2
503 $ hg -q merge 3
503 $ hg -q merge 3
504 $ hg -q ci -mma
504 $ hg -q ci -mma
505
505
506 $ hg push ../l -b b
506 $ hg push ../l -b b
507 pushing to ../l
507 pushing to ../l
508 searching for changes
508 searching for changes
509 abort: push creates new remote head 451211cc22b0 on branch 'a'!
509 abort: push creates new remote head 451211cc22b0 on branch 'a'!
510 (merge or see "hg help push" for details about pushing new heads)
510 (merge or see "hg help push" for details about pushing new heads)
511 [255]
511 [255]
512
512
513 $ cd ..
513 $ cd ..
514
514
515
515
516 Check prepush with new branch head on former topo non-head:
516 Check prepush with new branch head on former topo non-head:
517
517
518 $ hg init n
518 $ hg init n
519 $ cd n
519 $ cd n
520 $ hg branch A
520 $ hg branch A
521 marked working directory as branch A
521 marked working directory as branch A
522 (branches are permanent and global, did you want a bookmark?)
522 (branches are permanent and global, did you want a bookmark?)
523 $ echo a >a
523 $ echo a >a
524 $ hg ci -Ama
524 $ hg ci -Ama
525 adding a
525 adding a
526 $ hg branch B
526 $ hg branch B
527 marked working directory as branch B
527 marked working directory as branch B
528 (branches are permanent and global, did you want a bookmark?)
528 (branches are permanent and global, did you want a bookmark?)
529 $ echo b >b
529 $ echo b >b
530 $ hg ci -Amb
530 $ hg ci -Amb
531 adding b
531 adding b
532
532
533 b is now branch head of B, and a topological head
533 b is now branch head of B, and a topological head
534 a is now branch head of A, but not a topological head
534 a is now branch head of A, but not a topological head
535
535
536 $ hg clone . inner
536 $ hg clone . inner
537 updating to branch B
537 updating to branch B
538 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
538 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
539 $ cd inner
539 $ cd inner
540 $ hg up B
540 $ hg up B
541 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
541 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
542 $ echo b1 >b1
542 $ echo b1 >b1
543 $ hg ci -Amb1
543 $ hg ci -Amb1
544 adding b1
544 adding b1
545
545
546 in the clone b1 is now the head of B
546 in the clone b1 is now the head of B
547
547
548 $ cd ..
548 $ cd ..
549 $ hg up 0
549 $ hg up 0
550 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
550 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
551 $ echo a2 >a2
551 $ echo a2 >a2
552 $ hg ci -Ama2
552 $ hg ci -Ama2
553 adding a2
553 adding a2
554
554
555 a2 is now the new branch head of A, and a new topological head
555 a2 is now the new branch head of A, and a new topological head
556 it replaces a former inner branch head, so it should at most warn about
556 it replaces a former inner branch head, so it should at most warn about
557 A, not B
557 A, not B
558
558
559 glog of local:
559 glog of local:
560
560
561 $ hg log -G --template "{rev}: {branches} {desc}\n"
561 $ hg log -G --template "{rev}: {branches} {desc}\n"
562 @ 2: A a2
562 @ 2: A a2
563 |
563 |
564 | o 1: B b
564 | o 1: B b
565 |/
565 |/
566 o 0: A a
566 o 0: A a
567
567
568 glog of remote:
568 glog of remote:
569
569
570 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
570 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
571 @ 2: B b1
571 @ 2: B b1
572 |
572 |
573 o 1: B b
573 o 1: B b
574 |
574 |
575 o 0: A a
575 o 0: A a
576
576
577 outgoing:
577 outgoing:
578
578
579 $ hg out inner --template "{rev}: {branches} {desc}\n"
579 $ hg out inner --template "{rev}: {branches} {desc}\n"
580 comparing with inner
580 comparing with inner
581 searching for changes
581 searching for changes
582 2: A a2
582 2: A a2
583
583
584 $ hg push inner
584 $ hg push inner
585 pushing to inner
585 pushing to inner
586 searching for changes
586 searching for changes
587 adding changesets
587 adding changesets
588 adding manifests
588 adding manifests
589 adding file changes
589 adding file changes
590 added 1 changesets with 1 changes to 1 files (+1 heads)
590 added 1 changesets with 1 changes to 1 files (+1 heads)
591
591
592 $ cd ..
592 $ cd ..
593
593
594
594
595 Check prepush with new branch head on former topo head:
595 Check prepush with new branch head on former topo head:
596
596
597 $ hg init o
597 $ hg init o
598 $ cd o
598 $ cd o
599 $ hg branch A
599 $ hg branch A
600 marked working directory as branch A
600 marked working directory as branch A
601 (branches are permanent and global, did you want a bookmark?)
601 (branches are permanent and global, did you want a bookmark?)
602 $ echo a >a
602 $ echo a >a
603 $ hg ci -Ama
603 $ hg ci -Ama
604 adding a
604 adding a
605 $ hg branch B
605 $ hg branch B
606 marked working directory as branch B
606 marked working directory as branch B
607 (branches are permanent and global, did you want a bookmark?)
607 (branches are permanent and global, did you want a bookmark?)
608 $ echo b >b
608 $ echo b >b
609 $ hg ci -Amb
609 $ hg ci -Amb
610 adding b
610 adding b
611
611
612 b is now branch head of B, and a topological head
612 b is now branch head of B, and a topological head
613
613
614 $ hg up 0
614 $ hg up 0
615 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
615 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
616 $ echo a1 >a1
616 $ echo a1 >a1
617 $ hg ci -Ama1
617 $ hg ci -Ama1
618 adding a1
618 adding a1
619
619
620 a1 is now branch head of A, and a topological head
620 a1 is now branch head of A, and a topological head
621
621
622 $ hg clone . inner
622 $ hg clone . inner
623 updating to branch A
623 updating to branch A
624 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
624 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
625 $ cd inner
625 $ cd inner
626 $ hg up B
626 $ hg up B
627 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
627 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
628 $ echo b1 >b1
628 $ echo b1 >b1
629 $ hg ci -Amb1
629 $ hg ci -Amb1
630 adding b1
630 adding b1
631
631
632 in the clone b1 is now the head of B
632 in the clone b1 is now the head of B
633
633
634 $ cd ..
634 $ cd ..
635 $ echo a2 >a2
635 $ echo a2 >a2
636 $ hg ci -Ama2
636 $ hg ci -Ama2
637 adding a2
637 adding a2
638
638
639 a2 is now the new branch head of A, and a topological head
639 a2 is now the new branch head of A, and a topological head
640 it replaces a former topological and branch head, so this should not warn
640 it replaces a former topological and branch head, so this should not warn
641
641
642 glog of local:
642 glog of local:
643
643
644 $ hg log -G --template "{rev}: {branches} {desc}\n"
644 $ hg log -G --template "{rev}: {branches} {desc}\n"
645 @ 3: A a2
645 @ 3: A a2
646 |
646 |
647 o 2: A a1
647 o 2: A a1
648 |
648 |
649 | o 1: B b
649 | o 1: B b
650 |/
650 |/
651 o 0: A a
651 o 0: A a
652
652
653 glog of remote:
653 glog of remote:
654
654
655 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
655 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
656 @ 3: B b1
656 @ 3: B b1
657 |
657 |
658 | o 2: A a1
658 | o 2: A a1
659 | |
659 | |
660 o | 1: B b
660 o | 1: B b
661 |/
661 |/
662 o 0: A a
662 o 0: A a
663
663
664 outgoing:
664 outgoing:
665
665
666 $ hg out inner --template "{rev}: {branches} {desc}\n"
666 $ hg out inner --template "{rev}: {branches} {desc}\n"
667 comparing with inner
667 comparing with inner
668 searching for changes
668 searching for changes
669 3: A a2
669 3: A a2
670
670
671 $ hg push inner
671 $ hg push inner
672 pushing to inner
672 pushing to inner
673 searching for changes
673 searching for changes
674 adding changesets
674 adding changesets
675 adding manifests
675 adding manifests
676 adding file changes
676 adding file changes
677 added 1 changesets with 1 changes to 1 files
677 added 1 changesets with 1 changes to 1 files
678
678
679 $ cd ..
679 $ cd ..
680
680
681
681
682 Check prepush with new branch head and new child of former branch head
682 Check prepush with new branch head and new child of former branch head
683 but child is on different branch:
683 but child is on different branch:
684
684
685 $ hg init p
685 $ hg init p
686 $ cd p
686 $ cd p
687 $ hg branch A
687 $ hg branch A
688 marked working directory as branch A
688 marked working directory as branch A
689 (branches are permanent and global, did you want a bookmark?)
689 (branches are permanent and global, did you want a bookmark?)
690 $ echo a0 >a
690 $ echo a0 >a
691 $ hg ci -Ama0
691 $ hg ci -Ama0
692 adding a
692 adding a
693 $ echo a1 >a
693 $ echo a1 >a
694 $ hg ci -ma1
694 $ hg ci -ma1
695 $ hg up null
695 $ hg up null
696 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
696 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
697 $ hg branch B
697 $ hg branch B
698 marked working directory as branch B
698 marked working directory as branch B
699 (branches are permanent and global, did you want a bookmark?)
699 (branches are permanent and global, did you want a bookmark?)
700 $ echo b0 >b
700 $ echo b0 >b
701 $ hg ci -Amb0
701 $ hg ci -Amb0
702 adding b
702 adding b
703 $ echo b1 >b
703 $ echo b1 >b
704 $ hg ci -mb1
704 $ hg ci -mb1
705
705
706 $ hg clone . inner
706 $ hg clone . inner
707 updating to branch B
707 updating to branch B
708 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
708 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
709
709
710 $ hg up A
710 $ hg up A
711 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
711 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
712 $ hg branch -f B
712 $ hg branch -f B
713 marked working directory as branch B
713 marked working directory as branch B
714 (branches are permanent and global, did you want a bookmark?)
714 (branches are permanent and global, did you want a bookmark?)
715 $ echo a3 >a
715 $ echo a3 >a
716 $ hg ci -ma3
716 $ hg ci -ma3
717 created new head
717 created new head
718 $ hg up 3
718 $ hg up 3
719 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
719 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
720 $ hg branch -f A
720 $ hg branch -f A
721 marked working directory as branch A
721 marked working directory as branch A
722 (branches are permanent and global, did you want a bookmark?)
722 (branches are permanent and global, did you want a bookmark?)
723 $ echo b3 >b
723 $ echo b3 >b
724 $ hg ci -mb3
724 $ hg ci -mb3
725 created new head
725 created new head
726
726
727 glog of local:
727 glog of local:
728
728
729 $ hg log -G --template "{rev}: {branches} {desc}\n"
729 $ hg log -G --template "{rev}: {branches} {desc}\n"
730 @ 5: A b3
730 @ 5: A b3
731 |
731 |
732 | o 4: B a3
732 | o 4: B a3
733 | |
733 | |
734 o | 3: B b1
734 o | 3: B b1
735 | |
735 | |
736 o | 2: B b0
736 o | 2: B b0
737 /
737 /
738 o 1: A a1
738 o 1: A a1
739 |
739 |
740 o 0: A a0
740 o 0: A a0
741
741
742 glog of remote:
742 glog of remote:
743
743
744 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
744 $ hg log -G -R inner --template "{rev}: {branches} {desc}\n"
745 @ 3: B b1
745 @ 3: B b1
746 |
746 |
747 o 2: B b0
747 o 2: B b0
748
748
749 o 1: A a1
749 o 1: A a1
750 |
750 |
751 o 0: A a0
751 o 0: A a0
752
752
753 outgoing:
753 outgoing:
754
754
755 $ hg out inner --template "{rev}: {branches} {desc}\n"
755 $ hg out inner --template "{rev}: {branches} {desc}\n"
756 comparing with inner
756 comparing with inner
757 searching for changes
757 searching for changes
758 4: B a3
758 4: B a3
759 5: A b3
759 5: A b3
760
760
761 $ hg push inner
761 $ hg push inner
762 pushing to inner
762 pushing to inner
763 searching for changes
763 searching for changes
764 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
764 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
765 (merge or see "hg help push" for details about pushing new heads)
765 (merge or see "hg help push" for details about pushing new heads)
766 [255]
766 [255]
767
767
768 $ hg push inner -r4 -r5
768 $ hg push inner -r4 -r5
769 pushing to inner
769 pushing to inner
770 searching for changes
770 searching for changes
771 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
771 abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'!
772 (merge or see "hg help push" for details about pushing new heads)
772 (merge or see "hg help push" for details about pushing new heads)
773 [255]
773 [255]
774
774
775 $ hg in inner
775 $ hg in inner
776 comparing with inner
776 comparing with inner
777 searching for changes
777 searching for changes
778 no changes found
778 no changes found
779 [1]
779 [1]
780
780
781 $ cd ..
781 $ cd ..
@@ -1,203 +1,203 b''
1 Revert interactive tests
1 Revert interactive tests
2 1 add and commit file f
2 1 add and commit file f
3 2 add commit file folder1/g
3 2 add commit file folder1/g
4 3 add and commit file folder2/h
4 3 add and commit file folder2/h
5 4 add and commit file folder1/i
5 4 add and commit file folder1/i
6 5 commit change to file f
6 5 commit change to file f
7 6 commit changes to files folder1/g folder2/h
7 6 commit changes to files folder1/g folder2/h
8 7 commit changes to files folder1/g folder2/h
8 7 commit changes to files folder1/g folder2/h
9 8 revert interactive to commit id 2 (line 3 above), check that folder1/i is removed and
9 8 revert interactive to commit id 2 (line 3 above), check that folder1/i is removed and
10 9 make workdir match 7
10 9 make workdir match 7
11 10 run the same test than 8 from within folder1 and check same expectations
11 10 run the same test than 8 from within folder1 and check same expectations
12
12
13 $ cat <<EOF >> $HGRCPATH
13 $ cat <<EOF >> $HGRCPATH
14 > [ui]
14 > [ui]
15 > interactive = true
15 > interactive = true
16 > [extensions]
16 > [extensions]
17 > record =
17 > record =
18 > EOF
18 > EOF
19
19
20
20
21 $ mkdir -p a/{folder1,folder2}
21 $ mkdir -p a/{folder1,folder2}
22 $ cd a
22 $ cd a
23 $ hg init
23 $ hg init
24 $ seq 1 5 > f ; hg add f ; hg commit -m "adding f"
24 $ python $TESTDIR/seq.py 1 5 > f ; hg add f ; hg commit -m "adding f"
25 $ seq 1 5 > folder1/g ; hg add folder1/g ; hg commit -m "adding folder1/g"
25 $ cat f > folder1/g ; hg add folder1/g ; hg commit -m "adding folder1/g"
26 $ seq 1 5 > folder2/h ; hg add folder2/h ; hg commit -m "adding folder2/h"
26 $ cat f > folder2/h ; hg add folder2/h ; hg commit -m "adding folder2/h"
27 $ seq 1 5 > folder1/i ; hg add folder1/i ; hg commit -m "adding folder1/i"
27 $ cat f > folder1/i ; hg add folder1/i ; hg commit -m "adding folder1/i"
28 $ echo "a" > f ; seq 1 5 >> f ; echo "b" >> f ; hg commit -m "modifying f"
28 $ echo "a" > f ; python $TESTDIR/seq.py 1 5 >> f ; echo "b" >> f ; hg commit -m "modifying f"
29 $ echo "c" > folder1/g ; seq 1 5 >> folder1/g ; echo "d" >> folder1/g ; hg commit -m "modifying folder1/g"
29 $ echo "c" > folder1/g ; python $TESTDIR/seq.py 1 5 >> folder1/g ; echo "d" >> folder1/g ; hg commit -m "modifying folder1/g"
30 $ echo "e" > folder2/h ; seq 1 5 >> folder2/h ; echo "f" >> folder2/h ; hg commit -m "modifying folder2/h"
30 $ echo "e" > folder2/h ; python $TESTDIR/seq.py 1 5 >> folder2/h ; echo "f" >> folder2/h ; hg commit -m "modifying folder2/h"
31 $ hg tip
31 $ hg tip
32 changeset: 6:59dd6e4ab63a
32 changeset: 6:59dd6e4ab63a
33 tag: tip
33 tag: tip
34 user: test
34 user: test
35 date: Thu Jan 01 00:00:00 1970 +0000
35 date: Thu Jan 01 00:00:00 1970 +0000
36 summary: modifying folder2/h
36 summary: modifying folder2/h
37
37
38 $ hg revert -i -r 2 --all -- << EOF
38 $ hg revert -i -r 2 --all -- << EOF
39 > y
39 > y
40 > y
40 > y
41 > y
41 > y
42 > y
42 > y
43 > y
43 > y
44 > n
44 > n
45 > n
45 > n
46 > EOF
46 > EOF
47 reverting f
47 reverting f
48 reverting folder1/g (glob)
48 reverting folder1/g (glob)
49 removing folder1/i (glob)
49 removing folder1/i (glob)
50 reverting folder2/h (glob)
50 reverting folder2/h (glob)
51 diff -r 89ac3d72e4a4 f
51 diff -r 89ac3d72e4a4 f
52 2 hunks, 2 lines changed
52 2 hunks, 2 lines changed
53 examine changes to 'f'? [Ynesfdaq?] y
53 examine changes to 'f'? [Ynesfdaq?] y
54
54
55 @@ -1,6 +1,5 @@
55 @@ -1,6 +1,5 @@
56 -a
56 -a
57 1
57 1
58 2
58 2
59 3
59 3
60 4
60 4
61 5
61 5
62 record change 1/6 to 'f'? [Ynesfdaq?] y
62 record change 1/6 to 'f'? [Ynesfdaq?] y
63
63
64 @@ -2,6 +1,5 @@
64 @@ -2,6 +1,5 @@
65 1
65 1
66 2
66 2
67 3
67 3
68 4
68 4
69 5
69 5
70 -b
70 -b
71 record change 2/6 to 'f'? [Ynesfdaq?] y
71 record change 2/6 to 'f'? [Ynesfdaq?] y
72
72
73 diff -r 89ac3d72e4a4 folder1/g
73 diff -r 89ac3d72e4a4 folder1/g
74 2 hunks, 2 lines changed
74 2 hunks, 2 lines changed
75 examine changes to 'folder1/g'? [Ynesfdaq?] y
75 examine changes to 'folder1/g'? [Ynesfdaq?] y
76
76
77 @@ -1,6 +1,5 @@
77 @@ -1,6 +1,5 @@
78 -c
78 -c
79 1
79 1
80 2
80 2
81 3
81 3
82 4
82 4
83 5
83 5
84 record change 3/6 to 'folder1/g'? [Ynesfdaq?] y
84 record change 3/6 to 'folder1/g'? [Ynesfdaq?] y
85
85
86 @@ -2,6 +1,5 @@
86 @@ -2,6 +1,5 @@
87 1
87 1
88 2
88 2
89 3
89 3
90 4
90 4
91 5
91 5
92 -d
92 -d
93 record change 4/6 to 'folder1/g'? [Ynesfdaq?] n
93 record change 4/6 to 'folder1/g'? [Ynesfdaq?] n
94
94
95 diff -r 89ac3d72e4a4 folder2/h
95 diff -r 89ac3d72e4a4 folder2/h
96 2 hunks, 2 lines changed
96 2 hunks, 2 lines changed
97 examine changes to 'folder2/h'? [Ynesfdaq?] n
97 examine changes to 'folder2/h'? [Ynesfdaq?] n
98
98
99 $ cat f
99 $ cat f
100 1
100 1
101 2
101 2
102 3
102 3
103 4
103 4
104 5
104 5
105 $ cat folder1/g
105 $ cat folder1/g
106 1
106 1
107 2
107 2
108 3
108 3
109 4
109 4
110 5
110 5
111 d
111 d
112 $ cat folder2/h
112 $ cat folder2/h
113 e
113 e
114 1
114 1
115 2
115 2
116 3
116 3
117 4
117 4
118 5
118 5
119 f
119 f
120 $ hg update -C 6
120 $ hg update -C 6
121 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 $ hg revert -i -r 2 --all -- << EOF
122 $ hg revert -i -r 2 --all -- << EOF
123 > y
123 > y
124 > y
124 > y
125 > y
125 > y
126 > y
126 > y
127 > y
127 > y
128 > n
128 > n
129 > n
129 > n
130 > EOF
130 > EOF
131 reverting f
131 reverting f
132 reverting folder1/g (glob)
132 reverting folder1/g (glob)
133 removing folder1/i (glob)
133 removing folder1/i (glob)
134 reverting folder2/h (glob)
134 reverting folder2/h (glob)
135 diff -r 89ac3d72e4a4 f
135 diff -r 89ac3d72e4a4 f
136 2 hunks, 2 lines changed
136 2 hunks, 2 lines changed
137 examine changes to 'f'? [Ynesfdaq?] y
137 examine changes to 'f'? [Ynesfdaq?] y
138
138
139 @@ -1,6 +1,5 @@
139 @@ -1,6 +1,5 @@
140 -a
140 -a
141 1
141 1
142 2
142 2
143 3
143 3
144 4
144 4
145 5
145 5
146 record change 1/6 to 'f'? [Ynesfdaq?] y
146 record change 1/6 to 'f'? [Ynesfdaq?] y
147
147
148 @@ -2,6 +1,5 @@
148 @@ -2,6 +1,5 @@
149 1
149 1
150 2
150 2
151 3
151 3
152 4
152 4
153 5
153 5
154 -b
154 -b
155 record change 2/6 to 'f'? [Ynesfdaq?] y
155 record change 2/6 to 'f'? [Ynesfdaq?] y
156
156
157 diff -r 89ac3d72e4a4 folder1/g
157 diff -r 89ac3d72e4a4 folder1/g
158 2 hunks, 2 lines changed
158 2 hunks, 2 lines changed
159 examine changes to 'folder1/g'? [Ynesfdaq?] y
159 examine changes to 'folder1/g'? [Ynesfdaq?] y
160
160
161 @@ -1,6 +1,5 @@
161 @@ -1,6 +1,5 @@
162 -c
162 -c
163 1
163 1
164 2
164 2
165 3
165 3
166 4
166 4
167 5
167 5
168 record change 3/6 to 'folder1/g'? [Ynesfdaq?] y
168 record change 3/6 to 'folder1/g'? [Ynesfdaq?] y
169
169
170 @@ -2,6 +1,5 @@
170 @@ -2,6 +1,5 @@
171 1
171 1
172 2
172 2
173 3
173 3
174 4
174 4
175 5
175 5
176 -d
176 -d
177 record change 4/6 to 'folder1/g'? [Ynesfdaq?] n
177 record change 4/6 to 'folder1/g'? [Ynesfdaq?] n
178
178
179 diff -r 89ac3d72e4a4 folder2/h
179 diff -r 89ac3d72e4a4 folder2/h
180 2 hunks, 2 lines changed
180 2 hunks, 2 lines changed
181 examine changes to 'folder2/h'? [Ynesfdaq?] n
181 examine changes to 'folder2/h'? [Ynesfdaq?] n
182
182
183 $ cat f
183 $ cat f
184 1
184 1
185 2
185 2
186 3
186 3
187 4
187 4
188 5
188 5
189 $ cat folder1/g
189 $ cat folder1/g
190 1
190 1
191 2
191 2
192 3
192 3
193 4
193 4
194 5
194 5
195 d
195 d
196 $ cat folder2/h
196 $ cat folder2/h
197 e
197 e
198 1
198 1
199 2
199 2
200 3
200 3
201 4
201 4
202 5
202 5
203 f
203 f
@@ -1,406 +1,406 b''
1
1
2 Function to test discovery between two repos in both directions, using both the local shortcut
2 Function to test discovery between two repos in both directions, using both the local shortcut
3 (which is currently not activated by default) and the full remotable protocol:
3 (which is currently not activated by default) and the full remotable protocol:
4
4
5 $ testdesc() { # revs_a, revs_b, dagdesc
5 $ testdesc() { # revs_a, revs_b, dagdesc
6 > if [ -d foo ]; then rm -rf foo; fi
6 > if [ -d foo ]; then rm -rf foo; fi
7 > hg init foo
7 > hg init foo
8 > cd foo
8 > cd foo
9 > hg debugbuilddag "$3"
9 > hg debugbuilddag "$3"
10 > hg clone . a $1 --quiet
10 > hg clone . a $1 --quiet
11 > hg clone . b $2 --quiet
11 > hg clone . b $2 --quiet
12 > echo
12 > echo
13 > echo "% -- a -> b tree"
13 > echo "% -- a -> b tree"
14 > hg -R a debugdiscovery b --verbose --old
14 > hg -R a debugdiscovery b --verbose --old
15 > echo
15 > echo
16 > echo "% -- a -> b set"
16 > echo "% -- a -> b set"
17 > hg -R a debugdiscovery b --verbose --debug
17 > hg -R a debugdiscovery b --verbose --debug
18 > echo
18 > echo
19 > echo "% -- b -> a tree"
19 > echo "% -- b -> a tree"
20 > hg -R b debugdiscovery a --verbose --old
20 > hg -R b debugdiscovery a --verbose --old
21 > echo
21 > echo
22 > echo "% -- b -> a set"
22 > echo "% -- b -> a set"
23 > hg -R b debugdiscovery a --verbose --debug
23 > hg -R b debugdiscovery a --verbose --debug
24 > cd ..
24 > cd ..
25 > }
25 > }
26
26
27
27
28 Small superset:
28 Small superset:
29
29
30 $ testdesc '-ra1 -ra2' '-rb1 -rb2 -rb3' '
30 $ testdesc '-ra1 -ra2' '-rb1 -rb2 -rb3' '
31 > +2:f +1:a1:b1
31 > +2:f +1:a1:b1
32 > <f +4 :a2
32 > <f +4 :a2
33 > +5 :b2
33 > +5 :b2
34 > <f +3 :b3'
34 > <f +3 :b3'
35
35
36 % -- a -> b tree
36 % -- a -> b tree
37 comparing with b
37 comparing with b
38 searching for changes
38 searching for changes
39 unpruned common: 01241442b3c2 66f7d451a68b b5714e113bc0
39 unpruned common: 01241442b3c2 66f7d451a68b b5714e113bc0
40 common heads: 01241442b3c2 b5714e113bc0
40 common heads: 01241442b3c2 b5714e113bc0
41 local is subset
41 local is subset
42
42
43 % -- a -> b set
43 % -- a -> b set
44 comparing with b
44 comparing with b
45 query 1; heads
45 query 1; heads
46 searching for changes
46 searching for changes
47 all local heads known remotely
47 all local heads known remotely
48 common heads: 01241442b3c2 b5714e113bc0
48 common heads: 01241442b3c2 b5714e113bc0
49 local is subset
49 local is subset
50
50
51 % -- b -> a tree
51 % -- b -> a tree
52 comparing with a
52 comparing with a
53 searching for changes
53 searching for changes
54 unpruned common: 01241442b3c2 b5714e113bc0
54 unpruned common: 01241442b3c2 b5714e113bc0
55 common heads: 01241442b3c2 b5714e113bc0
55 common heads: 01241442b3c2 b5714e113bc0
56 remote is subset
56 remote is subset
57
57
58 % -- b -> a set
58 % -- b -> a set
59 comparing with a
59 comparing with a
60 query 1; heads
60 query 1; heads
61 searching for changes
61 searching for changes
62 all remote heads known locally
62 all remote heads known locally
63 common heads: 01241442b3c2 b5714e113bc0
63 common heads: 01241442b3c2 b5714e113bc0
64 remote is subset
64 remote is subset
65
65
66
66
67 Many new:
67 Many new:
68
68
69 $ testdesc '-ra1 -ra2' '-rb' '
69 $ testdesc '-ra1 -ra2' '-rb' '
70 > +2:f +3:a1 +3:b
70 > +2:f +3:a1 +3:b
71 > <f +30 :a2'
71 > <f +30 :a2'
72
72
73 % -- a -> b tree
73 % -- a -> b tree
74 comparing with b
74 comparing with b
75 searching for changes
75 searching for changes
76 unpruned common: bebd167eb94d
76 unpruned common: bebd167eb94d
77 common heads: bebd167eb94d
77 common heads: bebd167eb94d
78
78
79 % -- a -> b set
79 % -- a -> b set
80 comparing with b
80 comparing with b
81 query 1; heads
81 query 1; heads
82 searching for changes
82 searching for changes
83 taking initial sample
83 taking initial sample
84 searching: 2 queries
84 searching: 2 queries
85 query 2; still undecided: 29, sample size is: 29
85 query 2; still undecided: 29, sample size is: 29
86 2 total queries
86 2 total queries
87 common heads: bebd167eb94d
87 common heads: bebd167eb94d
88
88
89 % -- b -> a tree
89 % -- b -> a tree
90 comparing with a
90 comparing with a
91 searching for changes
91 searching for changes
92 unpruned common: 66f7d451a68b bebd167eb94d
92 unpruned common: 66f7d451a68b bebd167eb94d
93 common heads: bebd167eb94d
93 common heads: bebd167eb94d
94
94
95 % -- b -> a set
95 % -- b -> a set
96 comparing with a
96 comparing with a
97 query 1; heads
97 query 1; heads
98 searching for changes
98 searching for changes
99 taking initial sample
99 taking initial sample
100 searching: 2 queries
100 searching: 2 queries
101 query 2; still undecided: 2, sample size is: 2
101 query 2; still undecided: 2, sample size is: 2
102 2 total queries
102 2 total queries
103 common heads: bebd167eb94d
103 common heads: bebd167eb94d
104
104
105
105
106 Both sides many new with stub:
106 Both sides many new with stub:
107
107
108 $ testdesc '-ra1 -ra2' '-rb' '
108 $ testdesc '-ra1 -ra2' '-rb' '
109 > +2:f +2:a1 +30 :b
109 > +2:f +2:a1 +30 :b
110 > <f +30 :a2'
110 > <f +30 :a2'
111
111
112 % -- a -> b tree
112 % -- a -> b tree
113 comparing with b
113 comparing with b
114 searching for changes
114 searching for changes
115 unpruned common: 2dc09a01254d
115 unpruned common: 2dc09a01254d
116 common heads: 2dc09a01254d
116 common heads: 2dc09a01254d
117
117
118 % -- a -> b set
118 % -- a -> b set
119 comparing with b
119 comparing with b
120 query 1; heads
120 query 1; heads
121 searching for changes
121 searching for changes
122 taking initial sample
122 taking initial sample
123 searching: 2 queries
123 searching: 2 queries
124 query 2; still undecided: 29, sample size is: 29
124 query 2; still undecided: 29, sample size is: 29
125 2 total queries
125 2 total queries
126 common heads: 2dc09a01254d
126 common heads: 2dc09a01254d
127
127
128 % -- b -> a tree
128 % -- b -> a tree
129 comparing with a
129 comparing with a
130 searching for changes
130 searching for changes
131 unpruned common: 2dc09a01254d 66f7d451a68b
131 unpruned common: 2dc09a01254d 66f7d451a68b
132 common heads: 2dc09a01254d
132 common heads: 2dc09a01254d
133
133
134 % -- b -> a set
134 % -- b -> a set
135 comparing with a
135 comparing with a
136 query 1; heads
136 query 1; heads
137 searching for changes
137 searching for changes
138 taking initial sample
138 taking initial sample
139 searching: 2 queries
139 searching: 2 queries
140 query 2; still undecided: 29, sample size is: 29
140 query 2; still undecided: 29, sample size is: 29
141 2 total queries
141 2 total queries
142 common heads: 2dc09a01254d
142 common heads: 2dc09a01254d
143
143
144
144
145 Both many new:
145 Both many new:
146
146
147 $ testdesc '-ra' '-rb' '
147 $ testdesc '-ra' '-rb' '
148 > +2:f +30 :b
148 > +2:f +30 :b
149 > <f +30 :a'
149 > <f +30 :a'
150
150
151 % -- a -> b tree
151 % -- a -> b tree
152 comparing with b
152 comparing with b
153 searching for changes
153 searching for changes
154 unpruned common: 66f7d451a68b
154 unpruned common: 66f7d451a68b
155 common heads: 66f7d451a68b
155 common heads: 66f7d451a68b
156
156
157 % -- a -> b set
157 % -- a -> b set
158 comparing with b
158 comparing with b
159 query 1; heads
159 query 1; heads
160 searching for changes
160 searching for changes
161 taking quick initial sample
161 taking quick initial sample
162 searching: 2 queries
162 searching: 2 queries
163 query 2; still undecided: 31, sample size is: 31
163 query 2; still undecided: 31, sample size is: 31
164 2 total queries
164 2 total queries
165 common heads: 66f7d451a68b
165 common heads: 66f7d451a68b
166
166
167 % -- b -> a tree
167 % -- b -> a tree
168 comparing with a
168 comparing with a
169 searching for changes
169 searching for changes
170 unpruned common: 66f7d451a68b
170 unpruned common: 66f7d451a68b
171 common heads: 66f7d451a68b
171 common heads: 66f7d451a68b
172
172
173 % -- b -> a set
173 % -- b -> a set
174 comparing with a
174 comparing with a
175 query 1; heads
175 query 1; heads
176 searching for changes
176 searching for changes
177 taking quick initial sample
177 taking quick initial sample
178 searching: 2 queries
178 searching: 2 queries
179 query 2; still undecided: 31, sample size is: 31
179 query 2; still undecided: 31, sample size is: 31
180 2 total queries
180 2 total queries
181 common heads: 66f7d451a68b
181 common heads: 66f7d451a68b
182
182
183
183
184 Both many new skewed:
184 Both many new skewed:
185
185
186 $ testdesc '-ra' '-rb' '
186 $ testdesc '-ra' '-rb' '
187 > +2:f +30 :b
187 > +2:f +30 :b
188 > <f +50 :a'
188 > <f +50 :a'
189
189
190 % -- a -> b tree
190 % -- a -> b tree
191 comparing with b
191 comparing with b
192 searching for changes
192 searching for changes
193 unpruned common: 66f7d451a68b
193 unpruned common: 66f7d451a68b
194 common heads: 66f7d451a68b
194 common heads: 66f7d451a68b
195
195
196 % -- a -> b set
196 % -- a -> b set
197 comparing with b
197 comparing with b
198 query 1; heads
198 query 1; heads
199 searching for changes
199 searching for changes
200 taking quick initial sample
200 taking quick initial sample
201 searching: 2 queries
201 searching: 2 queries
202 query 2; still undecided: 51, sample size is: 51
202 query 2; still undecided: 51, sample size is: 51
203 2 total queries
203 2 total queries
204 common heads: 66f7d451a68b
204 common heads: 66f7d451a68b
205
205
206 % -- b -> a tree
206 % -- b -> a tree
207 comparing with a
207 comparing with a
208 searching for changes
208 searching for changes
209 unpruned common: 66f7d451a68b
209 unpruned common: 66f7d451a68b
210 common heads: 66f7d451a68b
210 common heads: 66f7d451a68b
211
211
212 % -- b -> a set
212 % -- b -> a set
213 comparing with a
213 comparing with a
214 query 1; heads
214 query 1; heads
215 searching for changes
215 searching for changes
216 taking quick initial sample
216 taking quick initial sample
217 searching: 2 queries
217 searching: 2 queries
218 query 2; still undecided: 31, sample size is: 31
218 query 2; still undecided: 31, sample size is: 31
219 2 total queries
219 2 total queries
220 common heads: 66f7d451a68b
220 common heads: 66f7d451a68b
221
221
222
222
223 Both many new on top of long history:
223 Both many new on top of long history:
224
224
225 $ testdesc '-ra' '-rb' '
225 $ testdesc '-ra' '-rb' '
226 > +1000:f +30 :b
226 > +1000:f +30 :b
227 > <f +50 :a'
227 > <f +50 :a'
228
228
229 % -- a -> b tree
229 % -- a -> b tree
230 comparing with b
230 comparing with b
231 searching for changes
231 searching for changes
232 unpruned common: 7ead0cba2838
232 unpruned common: 7ead0cba2838
233 common heads: 7ead0cba2838
233 common heads: 7ead0cba2838
234
234
235 % -- a -> b set
235 % -- a -> b set
236 comparing with b
236 comparing with b
237 query 1; heads
237 query 1; heads
238 searching for changes
238 searching for changes
239 taking quick initial sample
239 taking quick initial sample
240 searching: 2 queries
240 searching: 2 queries
241 query 2; still undecided: 1049, sample size is: 11
241 query 2; still undecided: 1049, sample size is: 11
242 sampling from both directions
242 sampling from both directions
243 searching: 3 queries
243 searching: 3 queries
244 query 3; still undecided: 31, sample size is: 31
244 query 3; still undecided: 31, sample size is: 31
245 3 total queries
245 3 total queries
246 common heads: 7ead0cba2838
246 common heads: 7ead0cba2838
247
247
248 % -- b -> a tree
248 % -- b -> a tree
249 comparing with a
249 comparing with a
250 searching for changes
250 searching for changes
251 unpruned common: 7ead0cba2838
251 unpruned common: 7ead0cba2838
252 common heads: 7ead0cba2838
252 common heads: 7ead0cba2838
253
253
254 % -- b -> a set
254 % -- b -> a set
255 comparing with a
255 comparing with a
256 query 1; heads
256 query 1; heads
257 searching for changes
257 searching for changes
258 taking quick initial sample
258 taking quick initial sample
259 searching: 2 queries
259 searching: 2 queries
260 query 2; still undecided: 1029, sample size is: 11
260 query 2; still undecided: 1029, sample size is: 11
261 sampling from both directions
261 sampling from both directions
262 searching: 3 queries
262 searching: 3 queries
263 query 3; still undecided: 15, sample size is: 15
263 query 3; still undecided: 15, sample size is: 15
264 3 total queries
264 3 total queries
265 common heads: 7ead0cba2838
265 common heads: 7ead0cba2838
266
266
267
267
268 One with >200 heads, which used to use up all of the sample:
268 One with >200 heads, which used to use up all of the sample:
269
269
270 $ hg init manyheads
270 $ hg init manyheads
271 $ cd manyheads
271 $ cd manyheads
272 $ echo "+300:r @a" >dagdesc
272 $ echo "+300:r @a" >dagdesc
273 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
273 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
274 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
274 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
275 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
275 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
276 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
276 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
277 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
277 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
278 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
278 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
279 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
279 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
280 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
280 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
281 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
281 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
282 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
282 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
283 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
283 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
284 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
284 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
285 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
285 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
286 $ echo "@b *r+3" >>dagdesc # one more head
286 $ echo "@b *r+3" >>dagdesc # one more head
287 $ hg debugbuilddag <dagdesc
287 $ hg debugbuilddag <dagdesc
288 reading DAG from stdin
288 reading DAG from stdin
289
289
290 $ hg heads -t --template . | wc -c
290 $ hg heads -t --template . | wc -c
291 \s*261 (re)
291 \s*261 (re)
292
292
293 $ hg clone -b a . a
293 $ hg clone -b a . a
294 adding changesets
294 adding changesets
295 adding manifests
295 adding manifests
296 adding file changes
296 adding file changes
297 added 1340 changesets with 0 changes to 0 files (+259 heads)
297 added 1340 changesets with 0 changes to 0 files (+259 heads)
298 updating to branch a
298 updating to branch a
299 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
299 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
300 $ hg clone -b b . b
300 $ hg clone -b b . b
301 adding changesets
301 adding changesets
302 adding manifests
302 adding manifests
303 adding file changes
303 adding file changes
304 added 304 changesets with 0 changes to 0 files
304 added 304 changesets with 0 changes to 0 files
305 updating to branch b
305 updating to branch b
306 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
306 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
307
307
308 $ hg -R a debugdiscovery b --debug --verbose
308 $ hg -R a debugdiscovery b --debug --verbose
309 comparing with b
309 comparing with b
310 query 1; heads
310 query 1; heads
311 searching for changes
311 searching for changes
312 taking quick initial sample
312 taking quick initial sample
313 searching: 2 queries
313 searching: 2 queries
314 query 2; still undecided: 1240, sample size is: 100
314 query 2; still undecided: 1240, sample size is: 100
315 sampling from both directions
315 sampling from both directions
316 searching: 3 queries
316 searching: 3 queries
317 query 3; still undecided: 1140, sample size is: 200
317 query 3; still undecided: 1140, sample size is: 200
318 sampling from both directions
318 sampling from both directions
319 searching: 4 queries
319 searching: 4 queries
320 query 4; still undecided: 592, sample size is: 200
320 query 4; still undecided: 592, sample size is: 200
321 sampling from both directions
321 sampling from both directions
322 searching: 5 queries
322 searching: 5 queries
323 query 5; still undecided: 292, sample size is: 200
323 query 5; still undecided: 292, sample size is: 200
324 sampling from both directions
324 sampling from both directions
325 searching: 6 queries
325 searching: 6 queries
326 query 6; still undecided: 51, sample size is: 51
326 query 6; still undecided: 51, sample size is: 51
327 6 total queries
327 6 total queries
328 common heads: 3ee37d65064a
328 common heads: 3ee37d65064a
329
329
330 Test actual protocol when pulling one new head in addition to common heads
330 Test actual protocol when pulling one new head in addition to common heads
331
331
332 $ hg clone -U b c
332 $ hg clone -U b c
333 $ hg -R c id -ir tip
333 $ hg -R c id -ir tip
334 513314ca8b3a
334 513314ca8b3a
335 $ hg -R c up -qr default
335 $ hg -R c up -qr default
336 $ touch c/f
336 $ touch c/f
337 $ hg -R c ci -Aqm "extra head"
337 $ hg -R c ci -Aqm "extra head"
338 $ hg -R c id -i
338 $ hg -R c id -i
339 e64a39e7da8b
339 e64a39e7da8b
340
340
341 $ hg serve -R c -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
341 $ hg serve -R c -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
342 $ cat hg.pid >> $DAEMON_PIDS
342 $ cat hg.pid >> $DAEMON_PIDS
343
343
344 $ hg -R b incoming http://localhost:$HGPORT/ -T '{node|short}\n'
344 $ hg -R b incoming http://localhost:$HGPORT/ -T '{node|short}\n'
345 comparing with http://localhost:$HGPORT/
345 comparing with http://localhost:$HGPORT/
346 searching for changes
346 searching for changes
347 e64a39e7da8b
347 e64a39e7da8b
348
348
349 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
349 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
350 $ cut -d' ' -f6- access.log | grep -v cmd=known # cmd=known uses random sampling
350 $ cut -d' ' -f6- access.log | grep -v cmd=known # cmd=known uses random sampling
351 "GET /?cmd=capabilities HTTP/1.1" 200 -
351 "GET /?cmd=capabilities HTTP/1.1" 200 -
352 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db
352 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db
353 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477
353 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477
354 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases
354 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases
355 $ cat errors.log
355 $ cat errors.log
356
356
357 $ cd ..
357 $ cd ..
358
358
359
359
360 Issue 4438 - test coverage for 3ef893520a85 issues.
360 Issue 4438 - test coverage for 3ef893520a85 issues.
361
361
362 $ mkdir issue4438
362 $ mkdir issue4438
363 $ cd issue4438
363 $ cd issue4438
364 #if false
364 #if false
365 generate new bundles:
365 generate new bundles:
366 $ hg init r1
366 $ hg init r1
367 $ for i in `seq 101`; do hg -R r1 up -qr null && hg -R r1 branch -q b$i && hg -R r1 ci -qmb$i; done
367 $ for i in `python $TESTDIR/seq.py 101`; do hg -R r1 up -qr null && hg -R r1 branch -q b$i && hg -R r1 ci -qmb$i; done
368 $ hg clone -q r1 r2
368 $ hg clone -q r1 r2
369 $ for i in `seq 10`; do hg -R r1 up -qr null && hg -R r1 branch -q c$i && hg -R r1 ci -qmc$i; done
369 $ for i in `python $TESTDIR/seq.py 10`; do hg -R r1 up -qr null && hg -R r1 branch -q c$i && hg -R r1 ci -qmc$i; done
370 $ hg -R r2 branch -q r2change && hg -R r2 ci -qmr2change
370 $ hg -R r2 branch -q r2change && hg -R r2 ci -qmr2change
371 $ hg -R r1 bundle -qa $TESTDIR/bundles/issue4438-r1.hg
371 $ hg -R r1 bundle -qa $TESTDIR/bundles/issue4438-r1.hg
372 $ hg -R r2 bundle -qa $TESTDIR/bundles/issue4438-r2.hg
372 $ hg -R r2 bundle -qa $TESTDIR/bundles/issue4438-r2.hg
373 #else
373 #else
374 use existing bundles:
374 use existing bundles:
375 $ hg clone -q $TESTDIR/bundles/issue4438-r1.hg r1
375 $ hg clone -q $TESTDIR/bundles/issue4438-r1.hg r1
376 $ hg clone -q $TESTDIR/bundles/issue4438-r2.hg r2
376 $ hg clone -q $TESTDIR/bundles/issue4438-r2.hg r2
377 #endif
377 #endif
378
378
379 Set iteration order could cause wrong and unstable results - fixed in 73cfaa348650:
379 Set iteration order could cause wrong and unstable results - fixed in 73cfaa348650:
380
380
381 $ hg -R r1 outgoing r2 -T'{rev} '
381 $ hg -R r1 outgoing r2 -T'{rev} '
382 comparing with r2
382 comparing with r2
383 searching for changes
383 searching for changes
384 101 102 103 104 105 106 107 108 109 110 (no-eol)
384 101 102 103 104 105 106 107 108 109 110 (no-eol)
385
385
386 The case where all the 'initialsamplesize' samples already were common would
386 The case where all the 'initialsamplesize' samples already were common would
387 give 'all remote heads known locally' without checking the remaining heads -
387 give 'all remote heads known locally' without checking the remaining heads -
388 fixed in 86c35b7ae300:
388 fixed in 86c35b7ae300:
389
389
390 $ cat >> $TESTTMP/unrandomsample.py << EOF
390 $ cat >> $TESTTMP/unrandomsample.py << EOF
391 > import random
391 > import random
392 > def sample(population, k):
392 > def sample(population, k):
393 > return sorted(population)[:k]
393 > return sorted(population)[:k]
394 > random.sample = sample
394 > random.sample = sample
395 > EOF
395 > EOF
396
396
397 $ cat >> r1/.hg/hgrc << EOF
397 $ cat >> r1/.hg/hgrc << EOF
398 > [extensions]
398 > [extensions]
399 > unrandomsample = $TESTTMP/unrandomsample.py
399 > unrandomsample = $TESTTMP/unrandomsample.py
400 > EOF
400 > EOF
401
401
402 $ hg -R r1 outgoing r2 -T'{rev} '
402 $ hg -R r1 outgoing r2 -T'{rev} '
403 comparing with r2
403 comparing with r2
404 searching for changes
404 searching for changes
405 101 102 103 104 105 106 107 108 109 110 (no-eol)
405 101 102 103 104 105 106 107 108 109 110 (no-eol)
406 $ cd ..
406 $ cd ..
@@ -1,104 +1,104 b''
1 Tests of the file helper tool
1 Tests of the file helper tool
2
2
3 $ f -h
3 $ f -h
4 ?sage: f [options] [filenames] (glob)
4 ?sage: f [options] [filenames] (glob)
5
5
6 ?ptions: (glob)
6 ?ptions: (glob)
7 -h, --help show this help message and exit
7 -h, --help show this help message and exit
8 -t, --type show file type (file or directory)
8 -t, --type show file type (file or directory)
9 -m, --mode show file mode
9 -m, --mode show file mode
10 -l, --links show number of links
10 -l, --links show number of links
11 -s, --size show size of file
11 -s, --size show size of file
12 -n NEWER, --newer=NEWER
12 -n NEWER, --newer=NEWER
13 check if file is newer (or same)
13 check if file is newer (or same)
14 -r, --recurse recurse into directories
14 -r, --recurse recurse into directories
15 -S, --sha1 show sha1 hash of the content
15 -S, --sha1 show sha1 hash of the content
16 -M, --md5 show md5 hash of the content
16 -M, --md5 show md5 hash of the content
17 -D, --dump dump file content
17 -D, --dump dump file content
18 -H, --hexdump hexdump file content
18 -H, --hexdump hexdump file content
19 -B BYTES, --bytes=BYTES
19 -B BYTES, --bytes=BYTES
20 number of characters to dump
20 number of characters to dump
21 -L LINES, --lines=LINES
21 -L LINES, --lines=LINES
22 number of lines to dump
22 number of lines to dump
23 -q, --quiet no default output
23 -q, --quiet no default output
24
24
25 $ mkdir dir
25 $ mkdir dir
26 $ cd dir
26 $ cd dir
27
27
28 $ f --size
28 $ f --size
29 size=0
29 size=0
30
30
31 $ echo hello | f --md5 --size
31 $ echo hello | f --md5 --size
32 size=6, md5=b1946ac92492d2347c6235b4d2611184
32 size=6, md5=b1946ac92492d2347c6235b4d2611184
33
33
34 $ f foo
34 $ f foo
35 foo: file not found
35 foo: file not found
36
36
37 $ echo foo > foo
37 $ echo foo > foo
38 $ f foo
38 $ f foo
39 foo:
39 foo:
40
40
41 #if symlink
41 #if symlink
42 $ f foo --mode
42 $ f foo --mode
43 foo: mode=644
43 foo: mode=644
44 #endif
44 #endif
45
45
46 $ seq 10 > bar
46 $ python $TESTDIR/seq.py 10 > bar
47 #if unix-permissions symlink
47 #if unix-permissions symlink
48 $ chmod +x bar
48 $ chmod +x bar
49 $ f bar --newer foo --mode --type --size --dump --links --bytes 7
49 $ f bar --newer foo --mode --type --size --dump --links --bytes 7
50 bar: file, size=21, mode=755, links=1, newer than foo
50 bar: file, size=21, mode=755, links=1, newer than foo
51 >>>
51 >>>
52 1
52 1
53 2
53 2
54 3
54 3
55 4
55 4
56 <<< no trailing newline
56 <<< no trailing newline
57 #endif
57 #endif
58
58
59 #if unix-permissions
59 #if unix-permissions
60 $ ln bar baz
60 $ ln bar baz
61 $ f bar -n baz -l --hexdump -t --sha1 --lines=9 -B 20
61 $ f bar -n baz -l --hexdump -t --sha1 --lines=9 -B 20
62 bar: file, links=2, newer than baz, sha1=612ca68d0305c821750a
62 bar: file, links=2, newer than baz, sha1=612ca68d0305c821750a
63 0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
63 0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
64 0010: 39 0a |9.|
64 0010: 39 0a |9.|
65 $ rm baz
65 $ rm baz
66 #endif
66 #endif
67
67
68 #if unix-permissions symlink
68 #if unix-permissions symlink
69 $ ln -s yadda l
69 $ ln -s yadda l
70 $ f . --recurse -MStmsB4
70 $ f . --recurse -MStmsB4
71 .: directory with 3 files, mode=755
71 .: directory with 3 files, mode=755
72 ./bar: file, size=21, mode=755, md5=3b03, sha1=612c
72 ./bar: file, size=21, mode=755, md5=3b03, sha1=612c
73 ./foo: file, size=4, mode=644, md5=d3b0, sha1=f1d2
73 ./foo: file, size=4, mode=644, md5=d3b0, sha1=f1d2
74 ./l: link, size=5, md5=2faa, sha1=af93
74 ./l: link, size=5, md5=2faa, sha1=af93
75 #endif
75 #endif
76
76
77 $ f --quiet bar -DL 3
77 $ f --quiet bar -DL 3
78 1
78 1
79 2
79 2
80 3
80 3
81
81
82 $ cd ..
82 $ cd ..
83
83
84 Yadda is a symlink
84 Yadda is a symlink
85 #if symlink
85 #if symlink
86 $ f -qr dir -HB 17
86 $ f -qr dir -HB 17
87 dir: directory with 3 files
87 dir: directory with 3 files
88 dir/bar:
88 dir/bar:
89 0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
89 0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
90 0010: 39 |9|
90 0010: 39 |9|
91 dir/foo:
91 dir/foo:
92 0000: 66 6f 6f 0a |foo.|
92 0000: 66 6f 6f 0a |foo.|
93 dir/l:
93 dir/l:
94 0000: 79 61 64 64 61 |yadda|
94 0000: 79 61 64 64 61 |yadda|
95 #else
95 #else
96 $ f -qr dir -HB 17
96 $ f -qr dir -HB 17
97 dir: directory with 2 files (esc)
97 dir: directory with 2 files (esc)
98 dir/bar: (glob)
98 dir/bar: (glob)
99 0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
99 0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
100 0010: 39 |9|
100 0010: 39 |9|
101 dir/foo: (glob)
101 dir/foo: (glob)
102 0000: 66 6f 6f 0a |foo.|
102 0000: 66 6f 6f 0a |foo.|
103 #endif
103 #endif
104
104
General Comments 0
You need to be logged in to leave comments. Login now