Show More
@@ -1,909 +1,995 b'' | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | $ cat << EOF >> $HGRCPATH |
|
4 | 4 | > [ui] |
|
5 | 5 | > logtemplate={rev}:{node|short} {desc|firstline} |
|
6 | 6 | > [phases] |
|
7 | 7 | > publish=False |
|
8 | 8 | > [experimental] |
|
9 | 9 | > evolution.createmarkers=True |
|
10 | 10 | > evolution.exchange=True |
|
11 | 11 | > EOF |
|
12 | 12 | |
|
13 | 13 | $ cat > $TESTTMP/hook.sh <<'EOF' |
|
14 | 14 | > echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE" |
|
15 | 15 | > EOF |
|
16 | 16 | $ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh" |
|
17 | 17 | |
|
18 | 18 | initialize |
|
19 | 19 | |
|
20 | 20 | $ hg init a |
|
21 | 21 | $ cd a |
|
22 | 22 | $ echo 'test' > test |
|
23 | 23 | $ hg commit -Am'test' |
|
24 | 24 | adding test |
|
25 | 25 | |
|
26 | 26 | set bookmarks |
|
27 | 27 | |
|
28 | 28 | $ hg bookmark X |
|
29 | 29 | $ hg bookmark Y |
|
30 | 30 | $ hg bookmark Z |
|
31 | 31 | |
|
32 | 32 | import bookmark by name |
|
33 | 33 | |
|
34 | 34 | $ hg init ../b |
|
35 | 35 | $ cd ../b |
|
36 | 36 | $ hg book Y |
|
37 | 37 | $ hg book |
|
38 | 38 | * Y -1:000000000000 |
|
39 | 39 | $ hg pull ../a --config "$TESTHOOK" |
|
40 | 40 | pulling from ../a |
|
41 | 41 | requesting all changes |
|
42 | 42 | adding changesets |
|
43 | 43 | adding manifests |
|
44 | 44 | adding file changes |
|
45 | 45 | added 1 changesets with 1 changes to 1 files |
|
46 | 46 | adding remote bookmark X |
|
47 | 47 | updating bookmark Y |
|
48 | 48 | adding remote bookmark Z |
|
49 | 49 | new changesets 4e3505fd9583 |
|
50 | 50 | test-hook-bookmark: X: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
51 | 51 | test-hook-bookmark: Y: 0000000000000000000000000000000000000000 -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
52 | 52 | test-hook-bookmark: Z: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
53 | 53 | (run 'hg update' to get a working copy) |
|
54 | 54 | $ hg bookmarks |
|
55 | 55 | X 0:4e3505fd9583 |
|
56 | 56 | * Y 0:4e3505fd9583 |
|
57 | 57 | Z 0:4e3505fd9583 |
|
58 | 58 | $ hg debugpushkey ../a namespaces |
|
59 | 59 | bookmarks |
|
60 | 60 | namespaces |
|
61 | 61 | obsolete |
|
62 | 62 | phases |
|
63 | 63 | $ hg debugpushkey ../a bookmarks |
|
64 | 64 | X 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
65 | 65 | Y 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
66 | 66 | Z 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
67 | 67 | |
|
68 | 68 | delete the bookmark to re-pull it |
|
69 | 69 | |
|
70 | 70 | $ hg book -d X |
|
71 | 71 | $ hg pull -B X ../a |
|
72 | 72 | pulling from ../a |
|
73 | 73 | no changes found |
|
74 | 74 | adding remote bookmark X |
|
75 | 75 | |
|
76 | 76 | finally no-op pull |
|
77 | 77 | |
|
78 | 78 | $ hg pull -B X ../a |
|
79 | 79 | pulling from ../a |
|
80 | 80 | no changes found |
|
81 | 81 | $ hg bookmark |
|
82 | 82 | X 0:4e3505fd9583 |
|
83 | 83 | * Y 0:4e3505fd9583 |
|
84 | 84 | Z 0:4e3505fd9583 |
|
85 | 85 | |
|
86 | 86 | export bookmark by name |
|
87 | 87 | |
|
88 | 88 | $ hg bookmark W |
|
89 | 89 | $ hg bookmark foo |
|
90 | 90 | $ hg bookmark foobar |
|
91 | 91 | $ hg push -B W ../a |
|
92 | 92 | pushing to ../a |
|
93 | 93 | searching for changes |
|
94 | 94 | no changes found |
|
95 | 95 | exporting bookmark W |
|
96 | 96 | [1] |
|
97 | 97 | $ hg -R ../a bookmarks |
|
98 | 98 | W -1:000000000000 |
|
99 | 99 | X 0:4e3505fd9583 |
|
100 | 100 | Y 0:4e3505fd9583 |
|
101 | 101 | * Z 0:4e3505fd9583 |
|
102 | 102 | |
|
103 | 103 | delete a remote bookmark |
|
104 | 104 | |
|
105 | 105 | $ hg book -d W |
|
106 | $ hg push -B W ../a --config "$TESTHOOK" | |
|
106 | $ hg push -B W ../a --config "$TESTHOOK" --debug --config devel.bundle2.debug=yes | |
|
107 | 107 | pushing to ../a |
|
108 | query 1; heads | |
|
108 | 109 | searching for changes |
|
110 | all remote heads known locally | |
|
111 | listing keys for "phases" | |
|
112 | checking for updated bookmarks | |
|
113 | listing keys for "bookmarks" | |
|
109 | 114 | no changes found |
|
115 | bundle2-output-bundle: "HG20", 3 parts total | |
|
116 | bundle2-output: start emission of HG20 stream | |
|
117 | bundle2-output: bundle parameter: | |
|
118 | bundle2-output: start of parts | |
|
119 | bundle2-output: bundle part: "replycaps" | |
|
120 | bundle2-output-part: "replycaps" 185 bytes payload | |
|
121 | bundle2-output: part 0: "REPLYCAPS" | |
|
122 | bundle2-output: header chunk size: 16 | |
|
123 | bundle2-output: payload chunk size: 185 | |
|
124 | bundle2-output: closing payload chunk | |
|
125 | bundle2-output: bundle part: "check:phases" | |
|
126 | bundle2-output-part: "check:phases" 48 bytes payload | |
|
127 | bundle2-output: part 1: "CHECK:PHASES" | |
|
128 | bundle2-output: header chunk size: 19 | |
|
129 | bundle2-output: payload chunk size: 48 | |
|
130 | bundle2-output: closing payload chunk | |
|
131 | bundle2-output: bundle part: "pushkey" | |
|
132 | bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload | |
|
133 | bundle2-output: part 2: "PUSHKEY" | |
|
134 | bundle2-output: header chunk size: 90 | |
|
135 | bundle2-output: closing payload chunk | |
|
136 | bundle2-output: end of bundle | |
|
137 | bundle2-input: start processing of HG20 stream | |
|
138 | bundle2-input: reading bundle2 stream parameters | |
|
139 | bundle2-input-bundle: with-transaction | |
|
140 | bundle2-input: start extraction of bundle2 parts | |
|
141 | bundle2-input: part header size: 16 | |
|
142 | bundle2-input: part type: "REPLYCAPS" | |
|
143 | bundle2-input: part id: "0" | |
|
144 | bundle2-input: part parameters: 0 | |
|
145 | bundle2-input: found a handler for part replycaps | |
|
146 | bundle2-input-part: "replycaps" supported | |
|
147 | bundle2-input: payload chunk size: 185 | |
|
148 | bundle2-input: payload chunk size: 0 | |
|
149 | bundle2-input-part: total payload size 185 | |
|
150 | bundle2-input: part header size: 19 | |
|
151 | bundle2-input: part type: "CHECK:PHASES" | |
|
152 | bundle2-input: part id: "1" | |
|
153 | bundle2-input: part parameters: 0 | |
|
154 | bundle2-input: found a handler for part check:phases | |
|
155 | bundle2-input-part: "check:phases" supported | |
|
156 | bundle2-input: payload chunk size: 48 | |
|
157 | bundle2-input: payload chunk size: 0 | |
|
158 | bundle2-input-part: total payload size 48 | |
|
159 | bundle2-input: part header size: 90 | |
|
160 | bundle2-input: part type: "PUSHKEY" | |
|
161 | bundle2-input: part id: "2" | |
|
162 | bundle2-input: part parameters: 4 | |
|
163 | bundle2-input: found a handler for part pushkey | |
|
164 | bundle2-input-part: "pushkey" (params: 4 mandatory) supported | |
|
165 | pushing key for "bookmarks:W" | |
|
166 | bundle2-input: payload chunk size: 0 | |
|
167 | bundle2-input: part header size: 0 | |
|
168 | bundle2-input: end of bundle2 stream | |
|
169 | bundle2-input-bundle: 2 parts total | |
|
170 | running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh | |
|
110 | 171 | test-hook-bookmark: W: 0000000000000000000000000000000000000000 -> |
|
172 | bundle2-output-bundle: "HG20", 1 parts total | |
|
173 | bundle2-output: start emission of HG20 stream | |
|
174 | bundle2-output: bundle parameter: | |
|
175 | bundle2-output: start of parts | |
|
176 | bundle2-output: bundle part: "reply:pushkey" | |
|
177 | bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload | |
|
178 | bundle2-output: part 0: "REPLY:PUSHKEY" | |
|
179 | bundle2-output: header chunk size: 43 | |
|
180 | bundle2-output: closing payload chunk | |
|
181 | bundle2-output: end of bundle | |
|
182 | bundle2-input: start processing of HG20 stream | |
|
183 | bundle2-input: reading bundle2 stream parameters | |
|
184 | bundle2-input-bundle: no-transaction | |
|
185 | bundle2-input: start extraction of bundle2 parts | |
|
186 | bundle2-input: part header size: 43 | |
|
187 | bundle2-input: part type: "REPLY:PUSHKEY" | |
|
188 | bundle2-input: part id: "0" | |
|
189 | bundle2-input: part parameters: 2 | |
|
190 | bundle2-input: found a handler for part reply:pushkey | |
|
191 | bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported | |
|
192 | bundle2-input: payload chunk size: 0 | |
|
193 | bundle2-input: part header size: 0 | |
|
194 | bundle2-input: end of bundle2 stream | |
|
195 | bundle2-input-bundle: 0 parts total | |
|
111 | 196 | deleting remote bookmark W |
|
197 | listing keys for "phases" | |
|
112 | 198 | [1] |
|
113 | 199 | |
|
114 | 200 | export the active bookmark |
|
115 | 201 | |
|
116 | 202 | $ hg bookmark V |
|
117 | 203 | $ hg push -B . ../a |
|
118 | 204 | pushing to ../a |
|
119 | 205 | searching for changes |
|
120 | 206 | no changes found |
|
121 | 207 | exporting bookmark V |
|
122 | 208 | [1] |
|
123 | 209 | |
|
124 | 210 | exporting the active bookmark with 'push -B .' |
|
125 | 211 | demand that one of the bookmarks is activated |
|
126 | 212 | |
|
127 | 213 | $ hg update -r default |
|
128 | 214 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
129 | 215 | (leaving bookmark V) |
|
130 | 216 | $ hg push -B . ../a |
|
131 | 217 | abort: no active bookmark |
|
132 | 218 | [255] |
|
133 | 219 | $ hg update -r V |
|
134 | 220 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
135 | 221 | (activating bookmark V) |
|
136 | 222 | |
|
137 | 223 | delete the bookmark |
|
138 | 224 | |
|
139 | 225 | $ hg book -d V |
|
140 | 226 | $ hg push -B V ../a |
|
141 | 227 | pushing to ../a |
|
142 | 228 | searching for changes |
|
143 | 229 | no changes found |
|
144 | 230 | deleting remote bookmark V |
|
145 | 231 | [1] |
|
146 | 232 | $ hg up foobar |
|
147 | 233 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
148 | 234 | (activating bookmark foobar) |
|
149 | 235 | |
|
150 | 236 | push/pull name that doesn't exist |
|
151 | 237 | |
|
152 | 238 | $ hg push -B badname ../a |
|
153 | 239 | pushing to ../a |
|
154 | 240 | searching for changes |
|
155 | 241 | bookmark badname does not exist on the local or remote repository! |
|
156 | 242 | no changes found |
|
157 | 243 | [2] |
|
158 | 244 | $ hg pull -B anotherbadname ../a |
|
159 | 245 | pulling from ../a |
|
160 | 246 | abort: remote bookmark anotherbadname not found! |
|
161 | 247 | [255] |
|
162 | 248 | |
|
163 | 249 | divergent bookmarks |
|
164 | 250 | |
|
165 | 251 | $ cd ../a |
|
166 | 252 | $ echo c1 > f1 |
|
167 | 253 | $ hg ci -Am1 |
|
168 | 254 | adding f1 |
|
169 | 255 | $ hg book -f @ |
|
170 | 256 | $ hg book -f X |
|
171 | 257 | $ hg book |
|
172 | 258 | @ 1:0d2164f0ce0d |
|
173 | 259 | * X 1:0d2164f0ce0d |
|
174 | 260 | Y 0:4e3505fd9583 |
|
175 | 261 | Z 1:0d2164f0ce0d |
|
176 | 262 | |
|
177 | 263 | $ cd ../b |
|
178 | 264 | $ hg up --config |
|
179 | 265 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
180 | 266 | updating bookmark foobar |
|
181 | 267 | $ echo c2 > f2 |
|
182 | 268 | $ hg ci -Am2 |
|
183 | 269 | adding f2 |
|
184 | 270 | $ hg book -if @ |
|
185 | 271 | $ hg book -if X |
|
186 | 272 | $ hg book |
|
187 | 273 | @ 1:9b140be10808 |
|
188 | 274 | X 1:9b140be10808 |
|
189 | 275 | Y 0:4e3505fd9583 |
|
190 | 276 | Z 0:4e3505fd9583 |
|
191 | 277 | foo -1:000000000000 |
|
192 | 278 | * foobar 1:9b140be10808 |
|
193 | 279 | |
|
194 | 280 | $ hg pull --config paths.foo=../a foo --config "$TESTHOOK" |
|
195 | 281 | pulling from $TESTTMP/a (glob) |
|
196 | 282 | searching for changes |
|
197 | 283 | adding changesets |
|
198 | 284 | adding manifests |
|
199 | 285 | adding file changes |
|
200 | 286 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
201 | 287 | divergent bookmark @ stored as @foo |
|
202 | 288 | divergent bookmark X stored as X@foo |
|
203 | 289 | updating bookmark Z |
|
204 | 290 | new changesets 0d2164f0ce0d |
|
205 | 291 | test-hook-bookmark: @foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
206 | 292 | test-hook-bookmark: X@foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
207 | 293 | test-hook-bookmark: Z: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
208 | 294 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
209 | 295 | $ hg book |
|
210 | 296 | @ 1:9b140be10808 |
|
211 | 297 | @foo 2:0d2164f0ce0d |
|
212 | 298 | X 1:9b140be10808 |
|
213 | 299 | X@foo 2:0d2164f0ce0d |
|
214 | 300 | Y 0:4e3505fd9583 |
|
215 | 301 | Z 2:0d2164f0ce0d |
|
216 | 302 | foo -1:000000000000 |
|
217 | 303 | * foobar 1:9b140be10808 |
|
218 | 304 | |
|
219 | 305 | (test that too many divergence of bookmark) |
|
220 | 306 | |
|
221 | 307 | $ $PYTHON $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done |
|
222 | 308 | $ hg pull ../a |
|
223 | 309 | pulling from ../a |
|
224 | 310 | searching for changes |
|
225 | 311 | no changes found |
|
226 | 312 | warning: failed to assign numbered name to divergent bookmark X |
|
227 | 313 | divergent bookmark @ stored as @1 |
|
228 | 314 | $ hg bookmarks | grep '^ X' | grep -v ':000000000000' |
|
229 | 315 | X 1:9b140be10808 |
|
230 | 316 | X@foo 2:0d2164f0ce0d |
|
231 | 317 | |
|
232 | 318 | (test that remotely diverged bookmarks are reused if they aren't changed) |
|
233 | 319 | |
|
234 | 320 | $ hg bookmarks | grep '^ @' |
|
235 | 321 | @ 1:9b140be10808 |
|
236 | 322 | @1 2:0d2164f0ce0d |
|
237 | 323 | @foo 2:0d2164f0ce0d |
|
238 | 324 | $ hg pull ../a |
|
239 | 325 | pulling from ../a |
|
240 | 326 | searching for changes |
|
241 | 327 | no changes found |
|
242 | 328 | warning: failed to assign numbered name to divergent bookmark X |
|
243 | 329 | divergent bookmark @ stored as @1 |
|
244 | 330 | $ hg bookmarks | grep '^ @' |
|
245 | 331 | @ 1:9b140be10808 |
|
246 | 332 | @1 2:0d2164f0ce0d |
|
247 | 333 | @foo 2:0d2164f0ce0d |
|
248 | 334 | |
|
249 | 335 | $ $PYTHON $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done |
|
250 | 336 | $ hg bookmarks -d "@1" |
|
251 | 337 | |
|
252 | 338 | $ hg push -f ../a |
|
253 | 339 | pushing to ../a |
|
254 | 340 | searching for changes |
|
255 | 341 | adding changesets |
|
256 | 342 | adding manifests |
|
257 | 343 | adding file changes |
|
258 | 344 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
259 | 345 | $ hg -R ../a book |
|
260 | 346 | @ 1:0d2164f0ce0d |
|
261 | 347 | * X 1:0d2164f0ce0d |
|
262 | 348 | Y 0:4e3505fd9583 |
|
263 | 349 | Z 1:0d2164f0ce0d |
|
264 | 350 | |
|
265 | 351 | explicit pull should overwrite the local version (issue4439) |
|
266 | 352 | |
|
267 | 353 | $ hg update -r X |
|
268 | 354 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
269 | 355 | (activating bookmark X) |
|
270 | 356 | $ hg pull --config paths.foo=../a foo -B . --config "$TESTHOOK" |
|
271 | 357 | pulling from $TESTTMP/a (glob) |
|
272 | 358 | no changes found |
|
273 | 359 | divergent bookmark @ stored as @foo |
|
274 | 360 | importing bookmark X |
|
275 | 361 | test-hook-bookmark: @foo: 0d2164f0ce0d8f1d6f94351eba04b794909be66c -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
276 | 362 | test-hook-bookmark: X: 9b140be1080824d768c5a4691a564088eede71f9 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
277 | 363 | |
|
278 | 364 | reinstall state for further testing: |
|
279 | 365 | |
|
280 | 366 | $ hg book -fr 9b140be10808 X |
|
281 | 367 | |
|
282 | 368 | revsets should not ignore divergent bookmarks |
|
283 | 369 | |
|
284 | 370 | $ hg bookmark -fr 1 Z |
|
285 | 371 | $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n' |
|
286 | 372 | 0:4e3505fd9583 Y |
|
287 | 373 | 1:9b140be10808 @ X Z foobar |
|
288 | 374 | 2:0d2164f0ce0d @foo X@foo |
|
289 | 375 | $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n' |
|
290 | 376 | 2:0d2164f0ce0d @foo X@foo |
|
291 | 377 | $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n' |
|
292 | 378 | 2:0d2164f0ce0d @foo X@foo |
|
293 | 379 | |
|
294 | 380 | update a remote bookmark from a non-head to a head |
|
295 | 381 | |
|
296 | 382 | $ hg up -q Y |
|
297 | 383 | $ echo c3 > f2 |
|
298 | 384 | $ hg ci -Am3 |
|
299 | 385 | adding f2 |
|
300 | 386 | created new head |
|
301 | 387 | $ hg push ../a --config "$TESTHOOK" |
|
302 | 388 | pushing to ../a |
|
303 | 389 | searching for changes |
|
304 | 390 | adding changesets |
|
305 | 391 | adding manifests |
|
306 | 392 | adding file changes |
|
307 | 393 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
308 | 394 | test-hook-bookmark: Y: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f |
|
309 | 395 | updating bookmark Y |
|
310 | 396 | $ hg -R ../a book |
|
311 | 397 | @ 1:0d2164f0ce0d |
|
312 | 398 | * X 1:0d2164f0ce0d |
|
313 | 399 | Y 3:f6fc62dde3c0 |
|
314 | 400 | Z 1:0d2164f0ce0d |
|
315 | 401 | |
|
316 | 402 | update a bookmark in the middle of a client pulling changes |
|
317 | 403 | |
|
318 | 404 | $ cd .. |
|
319 | 405 | $ hg clone -q a pull-race |
|
320 | 406 | |
|
321 | 407 | We want to use http because it is stateless and therefore more susceptible to |
|
322 | 408 | race conditions |
|
323 | 409 | |
|
324 | 410 | $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log |
|
325 | 411 | $ cat pull-race.pid >> $DAEMON_PIDS |
|
326 | 412 | |
|
327 | 413 | $ cat <<EOF > $TESTTMP/out_makecommit.sh |
|
328 | 414 | > #!/bin/sh |
|
329 | 415 | > hg ci -Am5 |
|
330 | 416 | > echo committed in pull-race |
|
331 | 417 | > EOF |
|
332 | 418 | |
|
333 | 419 | $ hg clone -q http://localhost:$HGPORT/ pull-race2 --config "$TESTHOOK" |
|
334 | 420 | test-hook-bookmark: @: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
335 | 421 | test-hook-bookmark: X: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
336 | 422 | test-hook-bookmark: Y: -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f |
|
337 | 423 | test-hook-bookmark: Z: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c |
|
338 | 424 | $ cd pull-race |
|
339 | 425 | $ hg up -q Y |
|
340 | 426 | $ echo c4 > f2 |
|
341 | 427 | $ hg ci -Am4 |
|
342 | 428 | $ echo c5 > f3 |
|
343 | 429 | $ cat <<EOF > .hg/hgrc |
|
344 | 430 | > [hooks] |
|
345 | 431 | > outgoing.makecommit = sh $TESTTMP/out_makecommit.sh |
|
346 | 432 | > EOF |
|
347 | 433 | |
|
348 | 434 | (new config needs a server restart) |
|
349 | 435 | |
|
350 | 436 | $ cd .. |
|
351 | 437 | $ killdaemons.py |
|
352 | 438 | $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log |
|
353 | 439 | $ cat pull-race.pid >> $DAEMON_PIDS |
|
354 | 440 | $ cd pull-race2 |
|
355 | 441 | $ hg -R $TESTTMP/pull-race book |
|
356 | 442 | @ 1:0d2164f0ce0d |
|
357 | 443 | X 1:0d2164f0ce0d |
|
358 | 444 | * Y 4:b0a5eff05604 |
|
359 | 445 | Z 1:0d2164f0ce0d |
|
360 | 446 | $ hg pull |
|
361 | 447 | pulling from http://localhost:$HGPORT/ |
|
362 | 448 | searching for changes |
|
363 | 449 | adding changesets |
|
364 | 450 | adding manifests |
|
365 | 451 | adding file changes |
|
366 | 452 | added 1 changesets with 1 changes to 1 files |
|
367 | 453 | updating bookmark Y |
|
368 | 454 | new changesets b0a5eff05604 |
|
369 | 455 | (run 'hg update' to get a working copy) |
|
370 | 456 | $ hg book |
|
371 | 457 | * @ 1:0d2164f0ce0d |
|
372 | 458 | X 1:0d2164f0ce0d |
|
373 | 459 | Y 4:b0a5eff05604 |
|
374 | 460 | Z 1:0d2164f0ce0d |
|
375 | 461 | |
|
376 | 462 | Update a bookmark right after the initial lookup -B (issue4689) |
|
377 | 463 | |
|
378 | 464 | $ echo c6 > ../pull-race/f3 # to be committed during the race |
|
379 | 465 | $ cat <<EOF > $TESTTMP/listkeys_makecommit.sh |
|
380 | 466 | > #!/bin/sh |
|
381 | 467 | > if hg st | grep -q M; then |
|
382 | 468 | > hg commit -m race |
|
383 | 469 | > echo committed in pull-race |
|
384 | 470 | > else |
|
385 | 471 | > exit 0 |
|
386 | 472 | > fi |
|
387 | 473 | > EOF |
|
388 | 474 | $ cat <<EOF > ../pull-race/.hg/hgrc |
|
389 | 475 | > [hooks] |
|
390 | 476 | > # If anything to commit, commit it right after the first key listing used |
|
391 | 477 | > # during lookup. This makes the commit appear before the actual getbundle |
|
392 | 478 | > # call. |
|
393 | 479 | > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh |
|
394 | 480 | > EOF |
|
395 | 481 | |
|
396 | 482 | (new config need server restart) |
|
397 | 483 | |
|
398 | 484 | $ killdaemons.py |
|
399 | 485 | $ hg serve -R ../pull-race -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log |
|
400 | 486 | $ cat ../pull-race.pid >> $DAEMON_PIDS |
|
401 | 487 | |
|
402 | 488 | $ hg -R $TESTTMP/pull-race book |
|
403 | 489 | @ 1:0d2164f0ce0d |
|
404 | 490 | X 1:0d2164f0ce0d |
|
405 | 491 | * Y 5:35d1ef0a8d1b |
|
406 | 492 | Z 1:0d2164f0ce0d |
|
407 | 493 | $ hg update -r Y |
|
408 | 494 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
409 | 495 | (activating bookmark Y) |
|
410 | 496 | $ hg pull -B . |
|
411 | 497 | pulling from http://localhost:$HGPORT/ |
|
412 | 498 | searching for changes |
|
413 | 499 | adding changesets |
|
414 | 500 | adding manifests |
|
415 | 501 | adding file changes |
|
416 | 502 | added 1 changesets with 1 changes to 1 files |
|
417 | 503 | updating bookmark Y |
|
418 | 504 | new changesets 35d1ef0a8d1b |
|
419 | 505 | (run 'hg update' to get a working copy) |
|
420 | 506 | $ hg book |
|
421 | 507 | @ 1:0d2164f0ce0d |
|
422 | 508 | X 1:0d2164f0ce0d |
|
423 | 509 | * Y 5:35d1ef0a8d1b |
|
424 | 510 | Z 1:0d2164f0ce0d |
|
425 | 511 | |
|
426 | 512 | (done with this section of the test) |
|
427 | 513 | |
|
428 | 514 | $ killdaemons.py |
|
429 | 515 | $ cd ../b |
|
430 | 516 | |
|
431 | 517 | diverging a remote bookmark fails |
|
432 | 518 | |
|
433 | 519 | $ hg up -q 4e3505fd9583 |
|
434 | 520 | $ echo c4 > f2 |
|
435 | 521 | $ hg ci -Am4 |
|
436 | 522 | adding f2 |
|
437 | 523 | created new head |
|
438 | 524 | $ echo c5 > f2 |
|
439 | 525 | $ hg ci -Am5 |
|
440 | 526 | $ hg log -G |
|
441 | 527 | @ 5:c922c0139ca0 5 |
|
442 | 528 | | |
|
443 | 529 | o 4:4efff6d98829 4 |
|
444 | 530 | | |
|
445 | 531 | | o 3:f6fc62dde3c0 3 |
|
446 | 532 | |/ |
|
447 | 533 | | o 2:0d2164f0ce0d 1 |
|
448 | 534 | |/ |
|
449 | 535 | | o 1:9b140be10808 2 |
|
450 | 536 | |/ |
|
451 | 537 | o 0:4e3505fd9583 test |
|
452 | 538 | |
|
453 | 539 | |
|
454 | 540 | $ hg book -f Y |
|
455 | 541 | |
|
456 | 542 | $ cat <<EOF > ../a/.hg/hgrc |
|
457 | 543 | > [web] |
|
458 | 544 | > push_ssl = false |
|
459 | 545 | > allow_push = * |
|
460 | 546 | > EOF |
|
461 | 547 | |
|
462 | 548 | $ hg serve -R ../a -p $HGPORT2 -d --pid-file=../hg2.pid |
|
463 | 549 | $ cat ../hg2.pid >> $DAEMON_PIDS |
|
464 | 550 | |
|
465 | 551 | $ hg push http://localhost:$HGPORT2/ |
|
466 | 552 | pushing to http://localhost:$HGPORT2/ |
|
467 | 553 | searching for changes |
|
468 | 554 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y'! |
|
469 | 555 | (merge or see 'hg help push' for details about pushing new heads) |
|
470 | 556 | [255] |
|
471 | 557 | $ hg -R ../a book |
|
472 | 558 | @ 1:0d2164f0ce0d |
|
473 | 559 | * X 1:0d2164f0ce0d |
|
474 | 560 | Y 3:f6fc62dde3c0 |
|
475 | 561 | Z 1:0d2164f0ce0d |
|
476 | 562 | |
|
477 | 563 | |
|
478 | 564 | Unrelated marker does not alter the decision |
|
479 | 565 | |
|
480 | 566 | $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
481 | 567 | $ hg push http://localhost:$HGPORT2/ |
|
482 | 568 | pushing to http://localhost:$HGPORT2/ |
|
483 | 569 | searching for changes |
|
484 | 570 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y'! |
|
485 | 571 | (merge or see 'hg help push' for details about pushing new heads) |
|
486 | 572 | [255] |
|
487 | 573 | $ hg -R ../a book |
|
488 | 574 | @ 1:0d2164f0ce0d |
|
489 | 575 | * X 1:0d2164f0ce0d |
|
490 | 576 | Y 3:f6fc62dde3c0 |
|
491 | 577 | Z 1:0d2164f0ce0d |
|
492 | 578 | |
|
493 | 579 | Update to a successor works |
|
494 | 580 | |
|
495 | 581 | $ hg id --debug -r 3 |
|
496 | 582 | f6fc62dde3c0771e29704af56ba4d8af77abcc2f |
|
497 | 583 | $ hg id --debug -r 4 |
|
498 | 584 | 4efff6d98829d9c824c621afd6e3f01865f5439f |
|
499 | 585 | $ hg id --debug -r 5 |
|
500 | 586 | c922c0139ca03858f655e4a2af4dd02796a63969 tip Y |
|
501 | 587 | $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc |
|
502 | 588 | obsoleted 1 changesets |
|
503 | 589 | $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f |
|
504 | 590 | $ hg push http://localhost:$HGPORT2/ |
|
505 | 591 | pushing to http://localhost:$HGPORT2/ |
|
506 | 592 | searching for changes |
|
507 | 593 | remote: adding changesets |
|
508 | 594 | remote: adding manifests |
|
509 | 595 | remote: adding file changes |
|
510 | 596 | remote: added 2 changesets with 2 changes to 1 files (+1 heads) |
|
511 | 597 | remote: 2 new obsolescence markers |
|
512 | 598 | remote: obsoleted 1 changesets |
|
513 | 599 | updating bookmark Y |
|
514 | 600 | $ hg -R ../a book |
|
515 | 601 | @ 1:0d2164f0ce0d |
|
516 | 602 | * X 1:0d2164f0ce0d |
|
517 | 603 | Y 5:c922c0139ca0 |
|
518 | 604 | Z 1:0d2164f0ce0d |
|
519 | 605 | |
|
520 | 606 | hgweb |
|
521 | 607 | |
|
522 | 608 | $ cat <<EOF > .hg/hgrc |
|
523 | 609 | > [web] |
|
524 | 610 | > push_ssl = false |
|
525 | 611 | > allow_push = * |
|
526 | 612 | > EOF |
|
527 | 613 | |
|
528 | 614 | $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log |
|
529 | 615 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
530 | 616 | $ cd ../a |
|
531 | 617 | |
|
532 | 618 | $ hg debugpushkey http://localhost:$HGPORT/ namespaces |
|
533 | 619 | bookmarks |
|
534 | 620 | namespaces |
|
535 | 621 | obsolete |
|
536 | 622 | phases |
|
537 | 623 | $ hg debugpushkey http://localhost:$HGPORT/ bookmarks |
|
538 | 624 | @ 9b140be1080824d768c5a4691a564088eede71f9 |
|
539 | 625 | X 9b140be1080824d768c5a4691a564088eede71f9 |
|
540 | 626 | Y c922c0139ca03858f655e4a2af4dd02796a63969 |
|
541 | 627 | Z 9b140be1080824d768c5a4691a564088eede71f9 |
|
542 | 628 | foo 0000000000000000000000000000000000000000 |
|
543 | 629 | foobar 9b140be1080824d768c5a4691a564088eede71f9 |
|
544 | 630 | $ hg out -B http://localhost:$HGPORT/ |
|
545 | 631 | comparing with http://localhost:$HGPORT/ |
|
546 | 632 | searching for changed bookmarks |
|
547 | 633 | @ 0d2164f0ce0d |
|
548 | 634 | X 0d2164f0ce0d |
|
549 | 635 | Z 0d2164f0ce0d |
|
550 | 636 | foo |
|
551 | 637 | foobar |
|
552 | 638 | $ hg push -B Z http://localhost:$HGPORT/ |
|
553 | 639 | pushing to http://localhost:$HGPORT/ |
|
554 | 640 | searching for changes |
|
555 | 641 | no changes found |
|
556 | 642 | updating bookmark Z |
|
557 | 643 | [1] |
|
558 | 644 | $ hg book -d Z |
|
559 | 645 | $ hg in -B http://localhost:$HGPORT/ |
|
560 | 646 | comparing with http://localhost:$HGPORT/ |
|
561 | 647 | searching for changed bookmarks |
|
562 | 648 | @ 9b140be10808 |
|
563 | 649 | X 9b140be10808 |
|
564 | 650 | Z 0d2164f0ce0d |
|
565 | 651 | foo 000000000000 |
|
566 | 652 | foobar 9b140be10808 |
|
567 | 653 | $ hg pull -B Z http://localhost:$HGPORT/ |
|
568 | 654 | pulling from http://localhost:$HGPORT/ |
|
569 | 655 | no changes found |
|
570 | 656 | divergent bookmark @ stored as @1 |
|
571 | 657 | divergent bookmark X stored as X@1 |
|
572 | 658 | adding remote bookmark Z |
|
573 | 659 | adding remote bookmark foo |
|
574 | 660 | adding remote bookmark foobar |
|
575 | 661 | $ hg clone http://localhost:$HGPORT/ cloned-bookmarks |
|
576 | 662 | requesting all changes |
|
577 | 663 | adding changesets |
|
578 | 664 | adding manifests |
|
579 | 665 | adding file changes |
|
580 | 666 | added 5 changesets with 5 changes to 3 files (+2 heads) |
|
581 | 667 | 2 new obsolescence markers |
|
582 | 668 | new changesets 4e3505fd9583:c922c0139ca0 |
|
583 | 669 | updating to bookmark @ |
|
584 | 670 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
585 | 671 | $ hg -R cloned-bookmarks bookmarks |
|
586 | 672 | * @ 1:9b140be10808 |
|
587 | 673 | X 1:9b140be10808 |
|
588 | 674 | Y 4:c922c0139ca0 |
|
589 | 675 | Z 2:0d2164f0ce0d |
|
590 | 676 | foo -1:000000000000 |
|
591 | 677 | foobar 1:9b140be10808 |
|
592 | 678 | |
|
593 | 679 | $ cd .. |
|
594 | 680 | |
|
595 | 681 | Test to show result of bookmarks comparison |
|
596 | 682 | |
|
597 | 683 | $ mkdir bmcomparison |
|
598 | 684 | $ cd bmcomparison |
|
599 | 685 | |
|
600 | 686 | $ hg init source |
|
601 | 687 | $ hg -R source debugbuilddag '+2*2*3*4' |
|
602 | 688 | $ hg -R source log -G --template '{rev}:{node|short}' |
|
603 | 689 | o 4:e7bd5218ca15 |
|
604 | 690 | | |
|
605 | 691 | | o 3:6100d3090acf |
|
606 | 692 | |/ |
|
607 | 693 | | o 2:fa942426a6fd |
|
608 | 694 | |/ |
|
609 | 695 | | o 1:66f7d451a68b |
|
610 | 696 | |/ |
|
611 | 697 | o 0:1ea73414a91b |
|
612 | 698 | |
|
613 | 699 | $ hg -R source bookmarks -r 0 SAME |
|
614 | 700 | $ hg -R source bookmarks -r 0 ADV_ON_REPO1 |
|
615 | 701 | $ hg -R source bookmarks -r 0 ADV_ON_REPO2 |
|
616 | 702 | $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1 |
|
617 | 703 | $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2 |
|
618 | 704 | $ hg -R source bookmarks -r 1 DIVERGED |
|
619 | 705 | |
|
620 | 706 | $ hg clone -U source repo1 |
|
621 | 707 | |
|
622 | 708 | (test that incoming/outgoing exit with 1, if there is no bookmark to |
|
623 | 709 | be exchanged) |
|
624 | 710 | |
|
625 | 711 | $ hg -R repo1 incoming -B |
|
626 | 712 | comparing with $TESTTMP/bmcomparison/source (glob) |
|
627 | 713 | searching for changed bookmarks |
|
628 | 714 | no changed bookmarks found |
|
629 | 715 | [1] |
|
630 | 716 | $ hg -R repo1 outgoing -B |
|
631 | 717 | comparing with $TESTTMP/bmcomparison/source (glob) |
|
632 | 718 | searching for changed bookmarks |
|
633 | 719 | no changed bookmarks found |
|
634 | 720 | [1] |
|
635 | 721 | |
|
636 | 722 | $ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1 |
|
637 | 723 | $ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1 |
|
638 | 724 | $ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1 |
|
639 | 725 | $ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED |
|
640 | 726 | $ hg -R repo1 -q --config extensions.mq= strip 4 |
|
641 | 727 | $ hg -R repo1 log -G --template '{node|short} ({bookmarks})' |
|
642 | 728 | o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED) |
|
643 | 729 | | |
|
644 | 730 | | o fa942426a6fd (ADV_ON_REPO1) |
|
645 | 731 | |/ |
|
646 | 732 | | o 66f7d451a68b (ADD_ON_REPO1 DIVERGED) |
|
647 | 733 | |/ |
|
648 | 734 | o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME) |
|
649 | 735 | |
|
650 | 736 | |
|
651 | 737 | $ hg clone -U source repo2 |
|
652 | 738 | $ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2 |
|
653 | 739 | $ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2 |
|
654 | 740 | $ hg -R repo2 bookmarks -f -r 2 DIVERGED |
|
655 | 741 | $ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2 |
|
656 | 742 | $ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED |
|
657 | 743 | $ hg -R repo2 -q --config extensions.mq= strip 3 |
|
658 | 744 | $ hg -R repo2 log -G --template '{node|short} ({bookmarks})' |
|
659 | 745 | o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED) |
|
660 | 746 | | |
|
661 | 747 | | o fa942426a6fd (DIVERGED) |
|
662 | 748 | |/ |
|
663 | 749 | | o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2) |
|
664 | 750 | |/ |
|
665 | 751 | o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME) |
|
666 | 752 | |
|
667 | 753 | |
|
668 | 754 | (test that difference of bookmarks between repositories are fully shown) |
|
669 | 755 | |
|
670 | 756 | $ hg -R repo1 incoming -B repo2 -v |
|
671 | 757 | comparing with repo2 |
|
672 | 758 | searching for changed bookmarks |
|
673 | 759 | ADD_ON_REPO2 66f7d451a68b added |
|
674 | 760 | ADV_ON_REPO2 66f7d451a68b advanced |
|
675 | 761 | DIFF_ADV_ON_REPO2 e7bd5218ca15 changed |
|
676 | 762 | DIFF_DIVERGED e7bd5218ca15 changed |
|
677 | 763 | DIVERGED fa942426a6fd diverged |
|
678 | 764 | $ hg -R repo1 outgoing -B repo2 -v |
|
679 | 765 | comparing with repo2 |
|
680 | 766 | searching for changed bookmarks |
|
681 | 767 | ADD_ON_REPO1 66f7d451a68b added |
|
682 | 768 | ADD_ON_REPO2 deleted |
|
683 | 769 | ADV_ON_REPO1 fa942426a6fd advanced |
|
684 | 770 | DIFF_ADV_ON_REPO1 6100d3090acf advanced |
|
685 | 771 | DIFF_ADV_ON_REPO2 1ea73414a91b changed |
|
686 | 772 | DIFF_DIVERGED 6100d3090acf changed |
|
687 | 773 | DIVERGED 66f7d451a68b diverged |
|
688 | 774 | |
|
689 | 775 | $ hg -R repo2 incoming -B repo1 -v |
|
690 | 776 | comparing with repo1 |
|
691 | 777 | searching for changed bookmarks |
|
692 | 778 | ADD_ON_REPO1 66f7d451a68b added |
|
693 | 779 | ADV_ON_REPO1 fa942426a6fd advanced |
|
694 | 780 | DIFF_ADV_ON_REPO1 6100d3090acf changed |
|
695 | 781 | DIFF_DIVERGED 6100d3090acf changed |
|
696 | 782 | DIVERGED 66f7d451a68b diverged |
|
697 | 783 | $ hg -R repo2 outgoing -B repo1 -v |
|
698 | 784 | comparing with repo1 |
|
699 | 785 | searching for changed bookmarks |
|
700 | 786 | ADD_ON_REPO1 deleted |
|
701 | 787 | ADD_ON_REPO2 66f7d451a68b added |
|
702 | 788 | ADV_ON_REPO2 66f7d451a68b advanced |
|
703 | 789 | DIFF_ADV_ON_REPO1 1ea73414a91b changed |
|
704 | 790 | DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced |
|
705 | 791 | DIFF_DIVERGED e7bd5218ca15 changed |
|
706 | 792 | DIVERGED fa942426a6fd diverged |
|
707 | 793 | |
|
708 | 794 | $ cd .. |
|
709 | 795 | |
|
710 | 796 | Pushing a bookmark should only push the changes required by that |
|
711 | 797 | bookmark, not all outgoing changes: |
|
712 | 798 | $ hg clone http://localhost:$HGPORT/ addmarks |
|
713 | 799 | requesting all changes |
|
714 | 800 | adding changesets |
|
715 | 801 | adding manifests |
|
716 | 802 | adding file changes |
|
717 | 803 | added 5 changesets with 5 changes to 3 files (+2 heads) |
|
718 | 804 | 2 new obsolescence markers |
|
719 | 805 | new changesets 4e3505fd9583:c922c0139ca0 |
|
720 | 806 | updating to bookmark @ |
|
721 | 807 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
722 | 808 | $ cd addmarks |
|
723 | 809 | $ echo foo > foo |
|
724 | 810 | $ hg add foo |
|
725 | 811 | $ hg commit -m 'add foo' |
|
726 | 812 | $ echo bar > bar |
|
727 | 813 | $ hg add bar |
|
728 | 814 | $ hg commit -m 'add bar' |
|
729 | 815 | $ hg co "tip^" |
|
730 | 816 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
731 | 817 | (leaving bookmark @) |
|
732 | 818 | $ hg book add-foo |
|
733 | 819 | $ hg book -r tip add-bar |
|
734 | 820 | Note: this push *must* push only a single changeset, as that's the point |
|
735 | 821 | of this test. |
|
736 | 822 | $ hg push -B add-foo --traceback |
|
737 | 823 | pushing to http://localhost:$HGPORT/ |
|
738 | 824 | searching for changes |
|
739 | 825 | remote: adding changesets |
|
740 | 826 | remote: adding manifests |
|
741 | 827 | remote: adding file changes |
|
742 | 828 | remote: added 1 changesets with 1 changes to 1 files |
|
743 | 829 | exporting bookmark add-foo |
|
744 | 830 | |
|
745 | 831 | pushing a new bookmark on a new head does not require -f if -B is specified |
|
746 | 832 | |
|
747 | 833 | $ hg up -q X |
|
748 | 834 | $ hg book W |
|
749 | 835 | $ echo c5 > f2 |
|
750 | 836 | $ hg ci -Am5 |
|
751 | 837 | created new head |
|
752 | 838 | $ hg push -B . |
|
753 | 839 | pushing to http://localhost:$HGPORT/ |
|
754 | 840 | searching for changes |
|
755 | 841 | remote: adding changesets |
|
756 | 842 | remote: adding manifests |
|
757 | 843 | remote: adding file changes |
|
758 | 844 | remote: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
759 | 845 | exporting bookmark W |
|
760 | 846 | $ hg -R ../b id -r W |
|
761 | 847 | cc978a373a53 tip W |
|
762 | 848 | |
|
763 | 849 | pushing an existing but divergent bookmark with -B still requires -f |
|
764 | 850 | |
|
765 | 851 | $ hg clone -q . ../r |
|
766 | 852 | $ hg up -q X |
|
767 | 853 | $ echo 1 > f2 |
|
768 | 854 | $ hg ci -qAml |
|
769 | 855 | |
|
770 | 856 | $ cd ../r |
|
771 | 857 | $ hg up -q X |
|
772 | 858 | $ echo 2 > f2 |
|
773 | 859 | $ hg ci -qAmr |
|
774 | 860 | $ hg push -B X |
|
775 | 861 | pushing to $TESTTMP/addmarks (glob) |
|
776 | 862 | searching for changes |
|
777 | 863 | remote has heads on branch 'default' that are not known locally: a2a606d9ff1b |
|
778 | 864 | abort: push creates new remote head 54694f811df9 with bookmark 'X'! |
|
779 | 865 | (pull and merge or see 'hg help push' for details about pushing new heads) |
|
780 | 866 | [255] |
|
781 | 867 | $ cd ../addmarks |
|
782 | 868 | |
|
783 | 869 | Check summary output for incoming/outgoing bookmarks |
|
784 | 870 | |
|
785 | 871 | $ hg bookmarks -d X |
|
786 | 872 | $ hg bookmarks -d Y |
|
787 | 873 | $ hg summary --remote | grep '^remote:' |
|
788 | 874 | remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob) |
|
789 | 875 | |
|
790 | 876 | $ cd .. |
|
791 | 877 | |
|
792 | 878 | pushing an unchanged bookmark should result in no changes |
|
793 | 879 | |
|
794 | 880 | $ hg init unchanged-a |
|
795 | 881 | $ hg init unchanged-b |
|
796 | 882 | $ cd unchanged-a |
|
797 | 883 | $ echo initial > foo |
|
798 | 884 | $ hg commit -A -m initial |
|
799 | 885 | adding foo |
|
800 | 886 | $ hg bookmark @ |
|
801 | 887 | $ hg push -B @ ../unchanged-b |
|
802 | 888 | pushing to ../unchanged-b |
|
803 | 889 | searching for changes |
|
804 | 890 | adding changesets |
|
805 | 891 | adding manifests |
|
806 | 892 | adding file changes |
|
807 | 893 | added 1 changesets with 1 changes to 1 files |
|
808 | 894 | exporting bookmark @ |
|
809 | 895 | |
|
810 | 896 | $ hg push -B @ ../unchanged-b |
|
811 | 897 | pushing to ../unchanged-b |
|
812 | 898 | searching for changes |
|
813 | 899 | no changes found |
|
814 | 900 | [1] |
|
815 | 901 | |
|
816 | 902 | |
|
817 | 903 | Check hook preventing push (issue4455) |
|
818 | 904 | ====================================== |
|
819 | 905 | |
|
820 | 906 | $ hg bookmarks |
|
821 | 907 | * @ 0:55482a6fb4b1 |
|
822 | 908 | $ hg log -G |
|
823 | 909 | @ 0:55482a6fb4b1 initial |
|
824 | 910 | |
|
825 | 911 | $ hg init ../issue4455-dest |
|
826 | 912 | $ hg push ../issue4455-dest # changesets only |
|
827 | 913 | pushing to ../issue4455-dest |
|
828 | 914 | searching for changes |
|
829 | 915 | adding changesets |
|
830 | 916 | adding manifests |
|
831 | 917 | adding file changes |
|
832 | 918 | added 1 changesets with 1 changes to 1 files |
|
833 | 919 | $ cat >> .hg/hgrc << EOF |
|
834 | 920 | > [paths] |
|
835 | 921 | > local=../issue4455-dest/ |
|
836 | 922 | > ssh=ssh://user@dummy/issue4455-dest |
|
837 | 923 | > http=http://localhost:$HGPORT/ |
|
838 | 924 | > [ui] |
|
839 | 925 | > ssh=$PYTHON "$TESTDIR/dummyssh" |
|
840 | 926 | > EOF |
|
841 | 927 | $ cat >> ../issue4455-dest/.hg/hgrc << EOF |
|
842 | 928 | > [hooks] |
|
843 | 929 | > prepushkey=false |
|
844 | 930 | > [web] |
|
845 | 931 | > push_ssl = false |
|
846 | 932 | > allow_push = * |
|
847 | 933 | > EOF |
|
848 | 934 | $ killdaemons.py |
|
849 | 935 | $ hg serve -R ../issue4455-dest -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log |
|
850 | 936 | $ cat ../issue4455.pid >> $DAEMON_PIDS |
|
851 | 937 | |
|
852 | 938 | Local push |
|
853 | 939 | ---------- |
|
854 | 940 | |
|
855 | 941 | $ hg push -B @ local |
|
856 | 942 | pushing to $TESTTMP/issue4455-dest (glob) |
|
857 | 943 | searching for changes |
|
858 | 944 | no changes found |
|
859 | 945 | pushkey-abort: prepushkey hook exited with status 1 |
|
860 | 946 | abort: exporting bookmark @ failed! |
|
861 | 947 | [255] |
|
862 | 948 | $ hg -R ../issue4455-dest/ bookmarks |
|
863 | 949 | no bookmarks set |
|
864 | 950 | |
|
865 | 951 | Using ssh |
|
866 | 952 | --------- |
|
867 | 953 | |
|
868 | 954 | $ hg push -B @ ssh # bundle2+ |
|
869 | 955 | pushing to ssh://user@dummy/issue4455-dest |
|
870 | 956 | searching for changes |
|
871 | 957 | no changes found |
|
872 | 958 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
873 | 959 | abort: exporting bookmark @ failed! |
|
874 | 960 | [255] |
|
875 | 961 | $ hg -R ../issue4455-dest/ bookmarks |
|
876 | 962 | no bookmarks set |
|
877 | 963 | |
|
878 | 964 | $ hg push -B @ ssh --config devel.legacy.exchange=bundle1 |
|
879 | 965 | pushing to ssh://user@dummy/issue4455-dest |
|
880 | 966 | searching for changes |
|
881 | 967 | no changes found |
|
882 | 968 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
883 | 969 | exporting bookmark @ failed! |
|
884 | 970 | [1] |
|
885 | 971 | $ hg -R ../issue4455-dest/ bookmarks |
|
886 | 972 | no bookmarks set |
|
887 | 973 | |
|
888 | 974 | Using http |
|
889 | 975 | ---------- |
|
890 | 976 | |
|
891 | 977 | $ hg push -B @ http # bundle2+ |
|
892 | 978 | pushing to http://localhost:$HGPORT/ |
|
893 | 979 | searching for changes |
|
894 | 980 | no changes found |
|
895 | 981 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
896 | 982 | abort: exporting bookmark @ failed! |
|
897 | 983 | [255] |
|
898 | 984 | $ hg -R ../issue4455-dest/ bookmarks |
|
899 | 985 | no bookmarks set |
|
900 | 986 | |
|
901 | 987 | $ hg push -B @ http --config devel.legacy.exchange=bundle1 |
|
902 | 988 | pushing to http://localhost:$HGPORT/ |
|
903 | 989 | searching for changes |
|
904 | 990 | no changes found |
|
905 | 991 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
906 | 992 | exporting bookmark @ failed! |
|
907 | 993 | [1] |
|
908 | 994 | $ hg -R ../issue4455-dest/ bookmarks |
|
909 | 995 | no bookmarks set |
General Comments 0
You need to be logged in to leave comments.
Login now