##// END OF EJS Templates
tests: add test to demonstrate issue6159...
Navaneeth Suresh -
r43081:cf9dbc73 stable
parent child Browse files
Show More
@@ -1,1324 +1,1382
1 #testcases b2-pushkey b2-binary
1 #testcases b2-pushkey b2-binary
2
2
3 #if b2-pushkey
3 #if b2-pushkey
4 $ cat << EOF >> $HGRCPATH
4 $ cat << EOF >> $HGRCPATH
5 > [devel]
5 > [devel]
6 > legacy.exchange=bookmarks
6 > legacy.exchange=bookmarks
7 > EOF
7 > EOF
8 #endif
8 #endif
9
9
10 #require serve
10 #require serve
11
11
12 $ cat << EOF >> $HGRCPATH
12 $ cat << EOF >> $HGRCPATH
13 > [ui]
13 > [ui]
14 > logtemplate={rev}:{node|short} {desc|firstline}
14 > logtemplate={rev}:{node|short} {desc|firstline}
15 > [phases]
15 > [phases]
16 > publish=False
16 > publish=False
17 > [experimental]
17 > [experimental]
18 > evolution.createmarkers=True
18 > evolution.createmarkers=True
19 > evolution.exchange=True
19 > evolution.exchange=True
20 > EOF
20 > EOF
21
21
22 $ cat > $TESTTMP/hook.sh <<'EOF'
22 $ cat > $TESTTMP/hook.sh <<'EOF'
23 > echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE"
23 > echo "test-hook-bookmark: $HG_BOOKMARK: $HG_OLDNODE -> $HG_NODE"
24 > EOF
24 > EOF
25 $ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh"
25 $ TESTHOOK="hooks.txnclose-bookmark.test=sh $TESTTMP/hook.sh"
26
26
27 initialize
27 initialize
28
28
29 $ hg init a
29 $ hg init a
30 $ cd a
30 $ cd a
31 $ echo 'test' > test
31 $ echo 'test' > test
32 $ hg commit -Am'test'
32 $ hg commit -Am'test'
33 adding test
33 adding test
34
34
35 set bookmarks
35 set bookmarks
36
36
37 $ hg bookmark X
37 $ hg bookmark X
38 $ hg bookmark Y
38 $ hg bookmark Y
39 $ hg bookmark Z
39 $ hg bookmark Z
40
40
41 import bookmark by name
41 import bookmark by name
42
42
43 $ hg init ../b
43 $ hg init ../b
44 $ cd ../b
44 $ cd ../b
45 $ hg book Y
45 $ hg book Y
46 $ hg book
46 $ hg book
47 * Y -1:000000000000
47 * Y -1:000000000000
48 $ hg pull ../a --config "$TESTHOOK"
48 $ hg pull ../a --config "$TESTHOOK"
49 pulling from ../a
49 pulling from ../a
50 requesting all changes
50 requesting all changes
51 adding changesets
51 adding changesets
52 adding manifests
52 adding manifests
53 adding file changes
53 adding file changes
54 added 1 changesets with 1 changes to 1 files
54 added 1 changesets with 1 changes to 1 files
55 adding remote bookmark X
55 adding remote bookmark X
56 updating bookmark Y
56 updating bookmark Y
57 adding remote bookmark Z
57 adding remote bookmark Z
58 new changesets 4e3505fd9583 (1 drafts)
58 new changesets 4e3505fd9583 (1 drafts)
59 test-hook-bookmark: X: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77
59 test-hook-bookmark: X: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77
60 test-hook-bookmark: Y: 0000000000000000000000000000000000000000 -> 4e3505fd95835d721066b76e75dbb8cc554d7f77
60 test-hook-bookmark: Y: 0000000000000000000000000000000000000000 -> 4e3505fd95835d721066b76e75dbb8cc554d7f77
61 test-hook-bookmark: Z: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77
61 test-hook-bookmark: Z: -> 4e3505fd95835d721066b76e75dbb8cc554d7f77
62 (run 'hg update' to get a working copy)
62 (run 'hg update' to get a working copy)
63 $ hg bookmarks
63 $ hg bookmarks
64 X 0:4e3505fd9583
64 X 0:4e3505fd9583
65 * Y 0:4e3505fd9583
65 * Y 0:4e3505fd9583
66 Z 0:4e3505fd9583
66 Z 0:4e3505fd9583
67 $ hg debugpushkey ../a namespaces
67 $ hg debugpushkey ../a namespaces
68 bookmarks
68 bookmarks
69 namespaces
69 namespaces
70 obsolete
70 obsolete
71 phases
71 phases
72 $ hg debugpushkey ../a bookmarks
72 $ hg debugpushkey ../a bookmarks
73 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
73 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
74 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
74 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
75 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
75 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
76
76
77 delete the bookmark to re-pull it
77 delete the bookmark to re-pull it
78
78
79 $ hg book -d X
79 $ hg book -d X
80 $ hg pull -B X ../a
80 $ hg pull -B X ../a
81 pulling from ../a
81 pulling from ../a
82 no changes found
82 no changes found
83 adding remote bookmark X
83 adding remote bookmark X
84
84
85 finally no-op pull
85 finally no-op pull
86
86
87 $ hg pull -B X ../a
87 $ hg pull -B X ../a
88 pulling from ../a
88 pulling from ../a
89 no changes found
89 no changes found
90 $ hg bookmark
90 $ hg bookmark
91 X 0:4e3505fd9583
91 X 0:4e3505fd9583
92 * Y 0:4e3505fd9583
92 * Y 0:4e3505fd9583
93 Z 0:4e3505fd9583
93 Z 0:4e3505fd9583
94
94
95 export bookmark by name
95 export bookmark by name
96
96
97 $ hg bookmark W
97 $ hg bookmark W
98 $ hg bookmark foo
98 $ hg bookmark foo
99 $ hg bookmark foobar
99 $ hg bookmark foobar
100 $ hg push -B W ../a
100 $ hg push -B W ../a
101 pushing to ../a
101 pushing to ../a
102 searching for changes
102 searching for changes
103 no changes found
103 no changes found
104 exporting bookmark W
104 exporting bookmark W
105 [1]
105 [1]
106 $ hg -R ../a bookmarks
106 $ hg -R ../a bookmarks
107 W -1:000000000000
107 W -1:000000000000
108 X 0:4e3505fd9583
108 X 0:4e3505fd9583
109 Y 0:4e3505fd9583
109 Y 0:4e3505fd9583
110 * Z 0:4e3505fd9583
110 * Z 0:4e3505fd9583
111
111
112 delete a remote bookmark
112 delete a remote bookmark
113
113
114 $ hg book -d W
114 $ hg book -d W
115
115
116 #if b2-pushkey
116 #if b2-pushkey
117
117
118 $ hg push -B W ../a --config "$TESTHOOK" --debug --config devel.bundle2.debug=yes
118 $ hg push -B W ../a --config "$TESTHOOK" --debug --config devel.bundle2.debug=yes
119 pushing to ../a
119 pushing to ../a
120 query 1; heads
120 query 1; heads
121 searching for changes
121 searching for changes
122 all remote heads known locally
122 all remote heads known locally
123 listing keys for "phases"
123 listing keys for "phases"
124 checking for updated bookmarks
124 checking for updated bookmarks
125 listing keys for "bookmarks"
125 listing keys for "bookmarks"
126 no changes found
126 no changes found
127 bundle2-output-bundle: "HG20", 4 parts total
127 bundle2-output-bundle: "HG20", 4 parts total
128 bundle2-output: start emission of HG20 stream
128 bundle2-output: start emission of HG20 stream
129 bundle2-output: bundle parameter:
129 bundle2-output: bundle parameter:
130 bundle2-output: start of parts
130 bundle2-output: start of parts
131 bundle2-output: bundle part: "replycaps"
131 bundle2-output: bundle part: "replycaps"
132 bundle2-output-part: "replycaps" 222 bytes payload
132 bundle2-output-part: "replycaps" 222 bytes payload
133 bundle2-output: part 0: "REPLYCAPS"
133 bundle2-output: part 0: "REPLYCAPS"
134 bundle2-output: header chunk size: 16
134 bundle2-output: header chunk size: 16
135 bundle2-output: payload chunk size: 222
135 bundle2-output: payload chunk size: 222
136 bundle2-output: closing payload chunk
136 bundle2-output: closing payload chunk
137 bundle2-output: bundle part: "check:bookmarks"
137 bundle2-output: bundle part: "check:bookmarks"
138 bundle2-output-part: "check:bookmarks" 23 bytes payload
138 bundle2-output-part: "check:bookmarks" 23 bytes payload
139 bundle2-output: part 1: "CHECK:BOOKMARKS"
139 bundle2-output: part 1: "CHECK:BOOKMARKS"
140 bundle2-output: header chunk size: 22
140 bundle2-output: header chunk size: 22
141 bundle2-output: payload chunk size: 23
141 bundle2-output: payload chunk size: 23
142 bundle2-output: closing payload chunk
142 bundle2-output: closing payload chunk
143 bundle2-output: bundle part: "check:phases"
143 bundle2-output: bundle part: "check:phases"
144 bundle2-output-part: "check:phases" 24 bytes payload
144 bundle2-output-part: "check:phases" 24 bytes payload
145 bundle2-output: part 2: "CHECK:PHASES"
145 bundle2-output: part 2: "CHECK:PHASES"
146 bundle2-output: header chunk size: 19
146 bundle2-output: header chunk size: 19
147 bundle2-output: payload chunk size: 24
147 bundle2-output: payload chunk size: 24
148 bundle2-output: closing payload chunk
148 bundle2-output: closing payload chunk
149 bundle2-output: bundle part: "pushkey"
149 bundle2-output: bundle part: "pushkey"
150 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
150 bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
151 bundle2-output: part 3: "PUSHKEY"
151 bundle2-output: part 3: "PUSHKEY"
152 bundle2-output: header chunk size: 90
152 bundle2-output: header chunk size: 90
153 bundle2-output: closing payload chunk
153 bundle2-output: closing payload chunk
154 bundle2-output: end of bundle
154 bundle2-output: end of bundle
155 bundle2-input: start processing of HG20 stream
155 bundle2-input: start processing of HG20 stream
156 bundle2-input: reading bundle2 stream parameters
156 bundle2-input: reading bundle2 stream parameters
157 bundle2-input-bundle: with-transaction
157 bundle2-input-bundle: with-transaction
158 bundle2-input: start extraction of bundle2 parts
158 bundle2-input: start extraction of bundle2 parts
159 bundle2-input: part header size: 16
159 bundle2-input: part header size: 16
160 bundle2-input: part type: "REPLYCAPS"
160 bundle2-input: part type: "REPLYCAPS"
161 bundle2-input: part id: "0"
161 bundle2-input: part id: "0"
162 bundle2-input: part parameters: 0
162 bundle2-input: part parameters: 0
163 bundle2-input: found a handler for part replycaps
163 bundle2-input: found a handler for part replycaps
164 bundle2-input-part: "replycaps" supported
164 bundle2-input-part: "replycaps" supported
165 bundle2-input: payload chunk size: 222
165 bundle2-input: payload chunk size: 222
166 bundle2-input: payload chunk size: 0
166 bundle2-input: payload chunk size: 0
167 bundle2-input-part: total payload size 222
167 bundle2-input-part: total payload size 222
168 bundle2-input: part header size: 22
168 bundle2-input: part header size: 22
169 bundle2-input: part type: "CHECK:BOOKMARKS"
169 bundle2-input: part type: "CHECK:BOOKMARKS"
170 bundle2-input: part id: "1"
170 bundle2-input: part id: "1"
171 bundle2-input: part parameters: 0
171 bundle2-input: part parameters: 0
172 bundle2-input: found a handler for part check:bookmarks
172 bundle2-input: found a handler for part check:bookmarks
173 bundle2-input-part: "check:bookmarks" supported
173 bundle2-input-part: "check:bookmarks" supported
174 bundle2-input: payload chunk size: 23
174 bundle2-input: payload chunk size: 23
175 bundle2-input: payload chunk size: 0
175 bundle2-input: payload chunk size: 0
176 bundle2-input-part: total payload size 23
176 bundle2-input-part: total payload size 23
177 bundle2-input: part header size: 19
177 bundle2-input: part header size: 19
178 bundle2-input: part type: "CHECK:PHASES"
178 bundle2-input: part type: "CHECK:PHASES"
179 bundle2-input: part id: "2"
179 bundle2-input: part id: "2"
180 bundle2-input: part parameters: 0
180 bundle2-input: part parameters: 0
181 bundle2-input: found a handler for part check:phases
181 bundle2-input: found a handler for part check:phases
182 bundle2-input-part: "check:phases" supported
182 bundle2-input-part: "check:phases" supported
183 bundle2-input: payload chunk size: 24
183 bundle2-input: payload chunk size: 24
184 bundle2-input: payload chunk size: 0
184 bundle2-input: payload chunk size: 0
185 bundle2-input-part: total payload size 24
185 bundle2-input-part: total payload size 24
186 bundle2-input: part header size: 90
186 bundle2-input: part header size: 90
187 bundle2-input: part type: "PUSHKEY"
187 bundle2-input: part type: "PUSHKEY"
188 bundle2-input: part id: "3"
188 bundle2-input: part id: "3"
189 bundle2-input: part parameters: 4
189 bundle2-input: part parameters: 4
190 bundle2-input: found a handler for part pushkey
190 bundle2-input: found a handler for part pushkey
191 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
191 bundle2-input-part: "pushkey" (params: 4 mandatory) supported
192 pushing key for "bookmarks:W"
192 pushing key for "bookmarks:W"
193 bundle2-input: payload chunk size: 0
193 bundle2-input: payload chunk size: 0
194 bundle2-input: part header size: 0
194 bundle2-input: part header size: 0
195 bundle2-input: end of bundle2 stream
195 bundle2-input: end of bundle2 stream
196 bundle2-input-bundle: 3 parts total
196 bundle2-input-bundle: 3 parts total
197 running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh
197 running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh
198 test-hook-bookmark: W: 0000000000000000000000000000000000000000 ->
198 test-hook-bookmark: W: 0000000000000000000000000000000000000000 ->
199 bundle2-output-bundle: "HG20", 1 parts total
199 bundle2-output-bundle: "HG20", 1 parts total
200 bundle2-output: start emission of HG20 stream
200 bundle2-output: start emission of HG20 stream
201 bundle2-output: bundle parameter:
201 bundle2-output: bundle parameter:
202 bundle2-output: start of parts
202 bundle2-output: start of parts
203 bundle2-output: bundle part: "reply:pushkey"
203 bundle2-output: bundle part: "reply:pushkey"
204 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
204 bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
205 bundle2-output: part 0: "REPLY:PUSHKEY"
205 bundle2-output: part 0: "REPLY:PUSHKEY"
206 bundle2-output: header chunk size: 43
206 bundle2-output: header chunk size: 43
207 bundle2-output: closing payload chunk
207 bundle2-output: closing payload chunk
208 bundle2-output: end of bundle
208 bundle2-output: end of bundle
209 bundle2-input: start processing of HG20 stream
209 bundle2-input: start processing of HG20 stream
210 bundle2-input: reading bundle2 stream parameters
210 bundle2-input: reading bundle2 stream parameters
211 bundle2-input-bundle: no-transaction
211 bundle2-input-bundle: no-transaction
212 bundle2-input: start extraction of bundle2 parts
212 bundle2-input: start extraction of bundle2 parts
213 bundle2-input: part header size: 43
213 bundle2-input: part header size: 43
214 bundle2-input: part type: "REPLY:PUSHKEY"
214 bundle2-input: part type: "REPLY:PUSHKEY"
215 bundle2-input: part id: "0"
215 bundle2-input: part id: "0"
216 bundle2-input: part parameters: 2
216 bundle2-input: part parameters: 2
217 bundle2-input: found a handler for part reply:pushkey
217 bundle2-input: found a handler for part reply:pushkey
218 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
218 bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
219 bundle2-input: payload chunk size: 0
219 bundle2-input: payload chunk size: 0
220 bundle2-input: part header size: 0
220 bundle2-input: part header size: 0
221 bundle2-input: end of bundle2 stream
221 bundle2-input: end of bundle2 stream
222 bundle2-input-bundle: 0 parts total
222 bundle2-input-bundle: 0 parts total
223 deleting remote bookmark W
223 deleting remote bookmark W
224 listing keys for "phases"
224 listing keys for "phases"
225 [1]
225 [1]
226
226
227 #endif
227 #endif
228 #if b2-binary
228 #if b2-binary
229
229
230 $ hg push -B W ../a --config "$TESTHOOK" --debug --config devel.bundle2.debug=yes
230 $ hg push -B W ../a --config "$TESTHOOK" --debug --config devel.bundle2.debug=yes
231 pushing to ../a
231 pushing to ../a
232 query 1; heads
232 query 1; heads
233 searching for changes
233 searching for changes
234 all remote heads known locally
234 all remote heads known locally
235 listing keys for "phases"
235 listing keys for "phases"
236 checking for updated bookmarks
236 checking for updated bookmarks
237 listing keys for "bookmarks"
237 listing keys for "bookmarks"
238 no changes found
238 no changes found
239 bundle2-output-bundle: "HG20", 4 parts total
239 bundle2-output-bundle: "HG20", 4 parts total
240 bundle2-output: start emission of HG20 stream
240 bundle2-output: start emission of HG20 stream
241 bundle2-output: bundle parameter:
241 bundle2-output: bundle parameter:
242 bundle2-output: start of parts
242 bundle2-output: start of parts
243 bundle2-output: bundle part: "replycaps"
243 bundle2-output: bundle part: "replycaps"
244 bundle2-output-part: "replycaps" 222 bytes payload
244 bundle2-output-part: "replycaps" 222 bytes payload
245 bundle2-output: part 0: "REPLYCAPS"
245 bundle2-output: part 0: "REPLYCAPS"
246 bundle2-output: header chunk size: 16
246 bundle2-output: header chunk size: 16
247 bundle2-output: payload chunk size: 222
247 bundle2-output: payload chunk size: 222
248 bundle2-output: closing payload chunk
248 bundle2-output: closing payload chunk
249 bundle2-output: bundle part: "check:bookmarks"
249 bundle2-output: bundle part: "check:bookmarks"
250 bundle2-output-part: "check:bookmarks" 23 bytes payload
250 bundle2-output-part: "check:bookmarks" 23 bytes payload
251 bundle2-output: part 1: "CHECK:BOOKMARKS"
251 bundle2-output: part 1: "CHECK:BOOKMARKS"
252 bundle2-output: header chunk size: 22
252 bundle2-output: header chunk size: 22
253 bundle2-output: payload chunk size: 23
253 bundle2-output: payload chunk size: 23
254 bundle2-output: closing payload chunk
254 bundle2-output: closing payload chunk
255 bundle2-output: bundle part: "check:phases"
255 bundle2-output: bundle part: "check:phases"
256 bundle2-output-part: "check:phases" 24 bytes payload
256 bundle2-output-part: "check:phases" 24 bytes payload
257 bundle2-output: part 2: "CHECK:PHASES"
257 bundle2-output: part 2: "CHECK:PHASES"
258 bundle2-output: header chunk size: 19
258 bundle2-output: header chunk size: 19
259 bundle2-output: payload chunk size: 24
259 bundle2-output: payload chunk size: 24
260 bundle2-output: closing payload chunk
260 bundle2-output: closing payload chunk
261 bundle2-output: bundle part: "bookmarks"
261 bundle2-output: bundle part: "bookmarks"
262 bundle2-output-part: "bookmarks" 23 bytes payload
262 bundle2-output-part: "bookmarks" 23 bytes payload
263 bundle2-output: part 3: "BOOKMARKS"
263 bundle2-output: part 3: "BOOKMARKS"
264 bundle2-output: header chunk size: 16
264 bundle2-output: header chunk size: 16
265 bundle2-output: payload chunk size: 23
265 bundle2-output: payload chunk size: 23
266 bundle2-output: closing payload chunk
266 bundle2-output: closing payload chunk
267 bundle2-output: end of bundle
267 bundle2-output: end of bundle
268 bundle2-input: start processing of HG20 stream
268 bundle2-input: start processing of HG20 stream
269 bundle2-input: reading bundle2 stream parameters
269 bundle2-input: reading bundle2 stream parameters
270 bundle2-input-bundle: with-transaction
270 bundle2-input-bundle: with-transaction
271 bundle2-input: start extraction of bundle2 parts
271 bundle2-input: start extraction of bundle2 parts
272 bundle2-input: part header size: 16
272 bundle2-input: part header size: 16
273 bundle2-input: part type: "REPLYCAPS"
273 bundle2-input: part type: "REPLYCAPS"
274 bundle2-input: part id: "0"
274 bundle2-input: part id: "0"
275 bundle2-input: part parameters: 0
275 bundle2-input: part parameters: 0
276 bundle2-input: found a handler for part replycaps
276 bundle2-input: found a handler for part replycaps
277 bundle2-input-part: "replycaps" supported
277 bundle2-input-part: "replycaps" supported
278 bundle2-input: payload chunk size: 222
278 bundle2-input: payload chunk size: 222
279 bundle2-input: payload chunk size: 0
279 bundle2-input: payload chunk size: 0
280 bundle2-input-part: total payload size 222
280 bundle2-input-part: total payload size 222
281 bundle2-input: part header size: 22
281 bundle2-input: part header size: 22
282 bundle2-input: part type: "CHECK:BOOKMARKS"
282 bundle2-input: part type: "CHECK:BOOKMARKS"
283 bundle2-input: part id: "1"
283 bundle2-input: part id: "1"
284 bundle2-input: part parameters: 0
284 bundle2-input: part parameters: 0
285 bundle2-input: found a handler for part check:bookmarks
285 bundle2-input: found a handler for part check:bookmarks
286 bundle2-input-part: "check:bookmarks" supported
286 bundle2-input-part: "check:bookmarks" supported
287 bundle2-input: payload chunk size: 23
287 bundle2-input: payload chunk size: 23
288 bundle2-input: payload chunk size: 0
288 bundle2-input: payload chunk size: 0
289 bundle2-input-part: total payload size 23
289 bundle2-input-part: total payload size 23
290 bundle2-input: part header size: 19
290 bundle2-input: part header size: 19
291 bundle2-input: part type: "CHECK:PHASES"
291 bundle2-input: part type: "CHECK:PHASES"
292 bundle2-input: part id: "2"
292 bundle2-input: part id: "2"
293 bundle2-input: part parameters: 0
293 bundle2-input: part parameters: 0
294 bundle2-input: found a handler for part check:phases
294 bundle2-input: found a handler for part check:phases
295 bundle2-input-part: "check:phases" supported
295 bundle2-input-part: "check:phases" supported
296 bundle2-input: payload chunk size: 24
296 bundle2-input: payload chunk size: 24
297 bundle2-input: payload chunk size: 0
297 bundle2-input: payload chunk size: 0
298 bundle2-input-part: total payload size 24
298 bundle2-input-part: total payload size 24
299 bundle2-input: part header size: 16
299 bundle2-input: part header size: 16
300 bundle2-input: part type: "BOOKMARKS"
300 bundle2-input: part type: "BOOKMARKS"
301 bundle2-input: part id: "3"
301 bundle2-input: part id: "3"
302 bundle2-input: part parameters: 0
302 bundle2-input: part parameters: 0
303 bundle2-input: found a handler for part bookmarks
303 bundle2-input: found a handler for part bookmarks
304 bundle2-input-part: "bookmarks" supported
304 bundle2-input-part: "bookmarks" supported
305 bundle2-input: payload chunk size: 23
305 bundle2-input: payload chunk size: 23
306 bundle2-input: payload chunk size: 0
306 bundle2-input: payload chunk size: 0
307 bundle2-input-part: total payload size 23
307 bundle2-input-part: total payload size 23
308 bundle2-input: part header size: 0
308 bundle2-input: part header size: 0
309 bundle2-input: end of bundle2 stream
309 bundle2-input: end of bundle2 stream
310 bundle2-input-bundle: 3 parts total
310 bundle2-input-bundle: 3 parts total
311 running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh
311 running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh
312 test-hook-bookmark: W: 0000000000000000000000000000000000000000 ->
312 test-hook-bookmark: W: 0000000000000000000000000000000000000000 ->
313 bundle2-output-bundle: "HG20", 0 parts total
313 bundle2-output-bundle: "HG20", 0 parts total
314 bundle2-output: start emission of HG20 stream
314 bundle2-output: start emission of HG20 stream
315 bundle2-output: bundle parameter:
315 bundle2-output: bundle parameter:
316 bundle2-output: start of parts
316 bundle2-output: start of parts
317 bundle2-output: end of bundle
317 bundle2-output: end of bundle
318 bundle2-input: start processing of HG20 stream
318 bundle2-input: start processing of HG20 stream
319 bundle2-input: reading bundle2 stream parameters
319 bundle2-input: reading bundle2 stream parameters
320 bundle2-input-bundle: no-transaction
320 bundle2-input-bundle: no-transaction
321 bundle2-input: start extraction of bundle2 parts
321 bundle2-input: start extraction of bundle2 parts
322 bundle2-input: part header size: 0
322 bundle2-input: part header size: 0
323 bundle2-input: end of bundle2 stream
323 bundle2-input: end of bundle2 stream
324 bundle2-input-bundle: 0 parts total
324 bundle2-input-bundle: 0 parts total
325 deleting remote bookmark W
325 deleting remote bookmark W
326 listing keys for "phases"
326 listing keys for "phases"
327 [1]
327 [1]
328
328
329 #endif
329 #endif
330
330
331 export the active bookmark
331 export the active bookmark
332
332
333 $ hg bookmark V
333 $ hg bookmark V
334 $ hg push -B . ../a
334 $ hg push -B . ../a
335 pushing to ../a
335 pushing to ../a
336 searching for changes
336 searching for changes
337 no changes found
337 no changes found
338 exporting bookmark V
338 exporting bookmark V
339 [1]
339 [1]
340
340
341 exporting the active bookmark with 'push -B .'
341 exporting the active bookmark with 'push -B .'
342 demand that one of the bookmarks is activated
342 demand that one of the bookmarks is activated
343
343
344 $ hg update -r default
344 $ hg update -r default
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 (leaving bookmark V)
346 (leaving bookmark V)
347 $ hg push -B . ../a
347 $ hg push -B . ../a
348 abort: no active bookmark!
348 abort: no active bookmark!
349 [255]
349 [255]
350 $ hg update -r V
350 $ hg update -r V
351 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
351 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
352 (activating bookmark V)
352 (activating bookmark V)
353
353
354 delete the bookmark
354 delete the bookmark
355
355
356 $ hg book -d V
356 $ hg book -d V
357 $ hg push -B V ../a
357 $ hg push -B V ../a
358 pushing to ../a
358 pushing to ../a
359 searching for changes
359 searching for changes
360 no changes found
360 no changes found
361 deleting remote bookmark V
361 deleting remote bookmark V
362 [1]
362 [1]
363 $ hg up foobar
363 $ hg up foobar
364 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
364 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
365 (activating bookmark foobar)
365 (activating bookmark foobar)
366
366
367 push/pull name that doesn't exist
367 push/pull name that doesn't exist
368
368
369 $ hg push -B badname ../a
369 $ hg push -B badname ../a
370 pushing to ../a
370 pushing to ../a
371 searching for changes
371 searching for changes
372 bookmark badname does not exist on the local or remote repository!
372 bookmark badname does not exist on the local or remote repository!
373 no changes found
373 no changes found
374 [2]
374 [2]
375 $ hg pull -B anotherbadname ../a
375 $ hg pull -B anotherbadname ../a
376 pulling from ../a
376 pulling from ../a
377 abort: remote bookmark anotherbadname not found!
377 abort: remote bookmark anotherbadname not found!
378 [255]
378 [255]
379
379
380 divergent bookmarks
380 divergent bookmarks
381
381
382 $ cd ../a
382 $ cd ../a
383 $ echo c1 > f1
383 $ echo c1 > f1
384 $ hg ci -Am1
384 $ hg ci -Am1
385 adding f1
385 adding f1
386 $ hg book -f @
386 $ hg book -f @
387 $ hg book -f X
387 $ hg book -f X
388 $ hg book
388 $ hg book
389 @ 1:0d2164f0ce0d
389 @ 1:0d2164f0ce0d
390 * X 1:0d2164f0ce0d
390 * X 1:0d2164f0ce0d
391 Y 0:4e3505fd9583
391 Y 0:4e3505fd9583
392 Z 1:0d2164f0ce0d
392 Z 1:0d2164f0ce0d
393
393
394 $ cd ../b
394 $ cd ../b
395 $ hg up
395 $ hg up
396 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
397 updating bookmark foobar
397 updating bookmark foobar
398 $ echo c2 > f2
398 $ echo c2 > f2
399 $ hg ci -Am2
399 $ hg ci -Am2
400 adding f2
400 adding f2
401 $ hg book -if @
401 $ hg book -if @
402 $ hg book -if X
402 $ hg book -if X
403 $ hg book
403 $ hg book
404 @ 1:9b140be10808
404 @ 1:9b140be10808
405 X 1:9b140be10808
405 X 1:9b140be10808
406 Y 0:4e3505fd9583
406 Y 0:4e3505fd9583
407 Z 0:4e3505fd9583
407 Z 0:4e3505fd9583
408 foo -1:000000000000
408 foo -1:000000000000
409 * foobar 1:9b140be10808
409 * foobar 1:9b140be10808
410
410
411 $ hg pull --config paths.foo=../a foo --config "$TESTHOOK"
411 $ hg pull --config paths.foo=../a foo --config "$TESTHOOK"
412 pulling from $TESTTMP/a
412 pulling from $TESTTMP/a
413 searching for changes
413 searching for changes
414 adding changesets
414 adding changesets
415 adding manifests
415 adding manifests
416 adding file changes
416 adding file changes
417 added 1 changesets with 1 changes to 1 files (+1 heads)
417 added 1 changesets with 1 changes to 1 files (+1 heads)
418 divergent bookmark @ stored as @foo
418 divergent bookmark @ stored as @foo
419 divergent bookmark X stored as X@foo
419 divergent bookmark X stored as X@foo
420 updating bookmark Z
420 updating bookmark Z
421 new changesets 0d2164f0ce0d (1 drafts)
421 new changesets 0d2164f0ce0d (1 drafts)
422 test-hook-bookmark: @foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
422 test-hook-bookmark: @foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
423 test-hook-bookmark: X@foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
423 test-hook-bookmark: X@foo: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
424 test-hook-bookmark: Z: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
424 test-hook-bookmark: Z: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
425 (run 'hg heads' to see heads, 'hg merge' to merge)
425 (run 'hg heads' to see heads, 'hg merge' to merge)
426 $ hg book
426 $ hg book
427 @ 1:9b140be10808
427 @ 1:9b140be10808
428 @foo 2:0d2164f0ce0d
428 @foo 2:0d2164f0ce0d
429 X 1:9b140be10808
429 X 1:9b140be10808
430 X@foo 2:0d2164f0ce0d
430 X@foo 2:0d2164f0ce0d
431 Y 0:4e3505fd9583
431 Y 0:4e3505fd9583
432 Z 2:0d2164f0ce0d
432 Z 2:0d2164f0ce0d
433 foo -1:000000000000
433 foo -1:000000000000
434 * foobar 1:9b140be10808
434 * foobar 1:9b140be10808
435
435
436 (test that too many divergence of bookmark)
436 (test that too many divergence of bookmark)
437
437
438 $ "$PYTHON" $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done
438 $ "$PYTHON" $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done
439 $ hg pull ../a
439 $ hg pull ../a
440 pulling from ../a
440 pulling from ../a
441 searching for changes
441 searching for changes
442 no changes found
442 no changes found
443 warning: failed to assign numbered name to divergent bookmark X
443 warning: failed to assign numbered name to divergent bookmark X
444 divergent bookmark @ stored as @1
444 divergent bookmark @ stored as @1
445 $ hg bookmarks | grep '^ X' | grep -v ':000000000000'
445 $ hg bookmarks | grep '^ X' | grep -v ':000000000000'
446 X 1:9b140be10808
446 X 1:9b140be10808
447 X@foo 2:0d2164f0ce0d
447 X@foo 2:0d2164f0ce0d
448
448
449 (test that remotely diverged bookmarks are reused if they aren't changed)
449 (test that remotely diverged bookmarks are reused if they aren't changed)
450
450
451 $ hg bookmarks | grep '^ @'
451 $ hg bookmarks | grep '^ @'
452 @ 1:9b140be10808
452 @ 1:9b140be10808
453 @1 2:0d2164f0ce0d
453 @1 2:0d2164f0ce0d
454 @foo 2:0d2164f0ce0d
454 @foo 2:0d2164f0ce0d
455 $ hg pull ../a
455 $ hg pull ../a
456 pulling from ../a
456 pulling from ../a
457 searching for changes
457 searching for changes
458 no changes found
458 no changes found
459 warning: failed to assign numbered name to divergent bookmark X
459 warning: failed to assign numbered name to divergent bookmark X
460 divergent bookmark @ stored as @1
460 divergent bookmark @ stored as @1
461 $ hg bookmarks | grep '^ @'
461 $ hg bookmarks | grep '^ @'
462 @ 1:9b140be10808
462 @ 1:9b140be10808
463 @1 2:0d2164f0ce0d
463 @1 2:0d2164f0ce0d
464 @foo 2:0d2164f0ce0d
464 @foo 2:0d2164f0ce0d
465
465
466 $ "$PYTHON" $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
466 $ "$PYTHON" $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
467 $ hg bookmarks -d "@1"
467 $ hg bookmarks -d "@1"
468
468
469 $ hg push -f ../a
469 $ hg push -f ../a
470 pushing to ../a
470 pushing to ../a
471 searching for changes
471 searching for changes
472 adding changesets
472 adding changesets
473 adding manifests
473 adding manifests
474 adding file changes
474 adding file changes
475 added 1 changesets with 1 changes to 1 files (+1 heads)
475 added 1 changesets with 1 changes to 1 files (+1 heads)
476 $ hg -R ../a book
476 $ hg -R ../a book
477 @ 1:0d2164f0ce0d
477 @ 1:0d2164f0ce0d
478 * X 1:0d2164f0ce0d
478 * X 1:0d2164f0ce0d
479 Y 0:4e3505fd9583
479 Y 0:4e3505fd9583
480 Z 1:0d2164f0ce0d
480 Z 1:0d2164f0ce0d
481
481
482 explicit pull should overwrite the local version (issue4439)
482 explicit pull should overwrite the local version (issue4439)
483
483
484 $ hg update -r X
484 $ hg update -r X
485 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
485 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 (activating bookmark X)
486 (activating bookmark X)
487 $ hg pull --config paths.foo=../a foo -B . --config "$TESTHOOK"
487 $ hg pull --config paths.foo=../a foo -B . --config "$TESTHOOK"
488 pulling from $TESTTMP/a
488 pulling from $TESTTMP/a
489 no changes found
489 no changes found
490 divergent bookmark @ stored as @foo
490 divergent bookmark @ stored as @foo
491 importing bookmark X
491 importing bookmark X
492 test-hook-bookmark: @foo: 0d2164f0ce0d8f1d6f94351eba04b794909be66c -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
492 test-hook-bookmark: @foo: 0d2164f0ce0d8f1d6f94351eba04b794909be66c -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
493 test-hook-bookmark: X: 9b140be1080824d768c5a4691a564088eede71f9 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
493 test-hook-bookmark: X: 9b140be1080824d768c5a4691a564088eede71f9 -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
494
494
495 reinstall state for further testing:
495 reinstall state for further testing:
496
496
497 $ hg book -fr 9b140be10808 X
497 $ hg book -fr 9b140be10808 X
498
498
499 revsets should not ignore divergent bookmarks
499 revsets should not ignore divergent bookmarks
500
500
501 $ hg bookmark -fr 1 Z
501 $ hg bookmark -fr 1 Z
502 $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n'
502 $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n'
503 0:4e3505fd9583 Y
503 0:4e3505fd9583 Y
504 1:9b140be10808 @ X Z foobar
504 1:9b140be10808 @ X Z foobar
505 2:0d2164f0ce0d @foo X@foo
505 2:0d2164f0ce0d @foo X@foo
506 $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
506 $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
507 2:0d2164f0ce0d @foo X@foo
507 2:0d2164f0ce0d @foo X@foo
508 $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
508 $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
509 2:0d2164f0ce0d @foo X@foo
509 2:0d2164f0ce0d @foo X@foo
510
510
511 update a remote bookmark from a non-head to a head
511 update a remote bookmark from a non-head to a head
512
512
513 $ hg up -q Y
513 $ hg up -q Y
514 $ echo c3 > f2
514 $ echo c3 > f2
515 $ hg ci -Am3
515 $ hg ci -Am3
516 adding f2
516 adding f2
517 created new head
517 created new head
518 $ hg push ../a --config "$TESTHOOK"
518 $ hg push ../a --config "$TESTHOOK"
519 pushing to ../a
519 pushing to ../a
520 searching for changes
520 searching for changes
521 adding changesets
521 adding changesets
522 adding manifests
522 adding manifests
523 adding file changes
523 adding file changes
524 added 1 changesets with 1 changes to 1 files (+1 heads)
524 added 1 changesets with 1 changes to 1 files (+1 heads)
525 test-hook-bookmark: Y: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f
525 test-hook-bookmark: Y: 4e3505fd95835d721066b76e75dbb8cc554d7f77 -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f
526 updating bookmark Y
526 updating bookmark Y
527 $ hg -R ../a book
527 $ hg -R ../a book
528 @ 1:0d2164f0ce0d
528 @ 1:0d2164f0ce0d
529 * X 1:0d2164f0ce0d
529 * X 1:0d2164f0ce0d
530 Y 3:f6fc62dde3c0
530 Y 3:f6fc62dde3c0
531 Z 1:0d2164f0ce0d
531 Z 1:0d2164f0ce0d
532
532
533 update a bookmark in the middle of a client pulling changes
533 update a bookmark in the middle of a client pulling changes
534
534
535 $ cd ..
535 $ cd ..
536 $ hg clone -q a pull-race
536 $ hg clone -q a pull-race
537
537
538 We want to use http because it is stateless and therefore more susceptible to
538 We want to use http because it is stateless and therefore more susceptible to
539 race conditions
539 race conditions
540
540
541 $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
541 $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
542 $ cat pull-race.pid >> $DAEMON_PIDS
542 $ cat pull-race.pid >> $DAEMON_PIDS
543
543
544 $ cat <<EOF > $TESTTMP/out_makecommit.sh
544 $ cat <<EOF > $TESTTMP/out_makecommit.sh
545 > #!/bin/sh
545 > #!/bin/sh
546 > hg ci -Am5
546 > hg ci -Am5
547 > echo committed in pull-race
547 > echo committed in pull-race
548 > EOF
548 > EOF
549
549
550 $ hg clone -q http://localhost:$HGPORT/ pull-race2 --config "$TESTHOOK"
550 $ hg clone -q http://localhost:$HGPORT/ pull-race2 --config "$TESTHOOK"
551 test-hook-bookmark: @: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
551 test-hook-bookmark: @: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
552 test-hook-bookmark: X: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
552 test-hook-bookmark: X: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
553 test-hook-bookmark: Y: -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f
553 test-hook-bookmark: Y: -> f6fc62dde3c0771e29704af56ba4d8af77abcc2f
554 test-hook-bookmark: Z: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
554 test-hook-bookmark: Z: -> 0d2164f0ce0d8f1d6f94351eba04b794909be66c
555 $ cd pull-race
555 $ cd pull-race
556 $ hg up -q Y
556 $ hg up -q Y
557 $ echo c4 > f2
557 $ echo c4 > f2
558 $ hg ci -Am4
558 $ hg ci -Am4
559 $ echo c5 > f3
559 $ echo c5 > f3
560 $ cat <<EOF > .hg/hgrc
560 $ cat <<EOF > .hg/hgrc
561 > [hooks]
561 > [hooks]
562 > outgoing.makecommit = sh $TESTTMP/out_makecommit.sh
562 > outgoing.makecommit = sh $TESTTMP/out_makecommit.sh
563 > EOF
563 > EOF
564
564
565 (new config needs a server restart)
565 (new config needs a server restart)
566
566
567 $ cd ..
567 $ cd ..
568 $ killdaemons.py
568 $ killdaemons.py
569 $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
569 $ hg serve -R pull-race -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log
570 $ cat pull-race.pid >> $DAEMON_PIDS
570 $ cat pull-race.pid >> $DAEMON_PIDS
571 $ cd pull-race2
571 $ cd pull-race2
572 $ hg -R $TESTTMP/pull-race book
572 $ hg -R $TESTTMP/pull-race book
573 @ 1:0d2164f0ce0d
573 @ 1:0d2164f0ce0d
574 X 1:0d2164f0ce0d
574 X 1:0d2164f0ce0d
575 * Y 4:b0a5eff05604
575 * Y 4:b0a5eff05604
576 Z 1:0d2164f0ce0d
576 Z 1:0d2164f0ce0d
577 $ hg pull
577 $ hg pull
578 pulling from http://localhost:$HGPORT/
578 pulling from http://localhost:$HGPORT/
579 searching for changes
579 searching for changes
580 adding changesets
580 adding changesets
581 adding manifests
581 adding manifests
582 adding file changes
582 adding file changes
583 added 1 changesets with 1 changes to 1 files
583 added 1 changesets with 1 changes to 1 files
584 updating bookmark Y
584 updating bookmark Y
585 new changesets b0a5eff05604 (1 drafts)
585 new changesets b0a5eff05604 (1 drafts)
586 (run 'hg update' to get a working copy)
586 (run 'hg update' to get a working copy)
587 $ hg book
587 $ hg book
588 * @ 1:0d2164f0ce0d
588 * @ 1:0d2164f0ce0d
589 X 1:0d2164f0ce0d
589 X 1:0d2164f0ce0d
590 Y 4:b0a5eff05604
590 Y 4:b0a5eff05604
591 Z 1:0d2164f0ce0d
591 Z 1:0d2164f0ce0d
592
592
593 Update a bookmark right after the initial lookup -B (issue4689)
593 Update a bookmark right after the initial lookup -B (issue4689)
594
594
595 $ echo c6 > ../pull-race/f3 # to be committed during the race
595 $ echo c6 > ../pull-race/f3 # to be committed during the race
596 $ cat <<EOF > $TESTTMP/listkeys_makecommit.sh
596 $ cat <<EOF > $TESTTMP/listkeys_makecommit.sh
597 > #!/bin/sh
597 > #!/bin/sh
598 > if hg st | grep -q M; then
598 > if hg st | grep -q M; then
599 > hg commit -m race
599 > hg commit -m race
600 > echo committed in pull-race
600 > echo committed in pull-race
601 > else
601 > else
602 > exit 0
602 > exit 0
603 > fi
603 > fi
604 > EOF
604 > EOF
605 $ cat <<EOF > ../pull-race/.hg/hgrc
605 $ cat <<EOF > ../pull-race/.hg/hgrc
606 > [hooks]
606 > [hooks]
607 > # If anything to commit, commit it right after the first key listing used
607 > # If anything to commit, commit it right after the first key listing used
608 > # during lookup. This makes the commit appear before the actual getbundle
608 > # during lookup. This makes the commit appear before the actual getbundle
609 > # call.
609 > # call.
610 > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh
610 > listkeys.makecommit= sh $TESTTMP/listkeys_makecommit.sh
611 > EOF
611 > EOF
612 $ restart_server() {
612 $ restart_server() {
613 > "$TESTDIR/killdaemons.py" $DAEMON_PIDS
613 > "$TESTDIR/killdaemons.py" $DAEMON_PIDS
614 > hg serve -R ../pull-race -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log
614 > hg serve -R ../pull-race -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log
615 > cat ../pull-race.pid >> $DAEMON_PIDS
615 > cat ../pull-race.pid >> $DAEMON_PIDS
616 > }
616 > }
617 $ restart_server # new config need server restart
617 $ restart_server # new config need server restart
618 $ hg -R $TESTTMP/pull-race book
618 $ hg -R $TESTTMP/pull-race book
619 @ 1:0d2164f0ce0d
619 @ 1:0d2164f0ce0d
620 X 1:0d2164f0ce0d
620 X 1:0d2164f0ce0d
621 * Y 5:35d1ef0a8d1b
621 * Y 5:35d1ef0a8d1b
622 Z 1:0d2164f0ce0d
622 Z 1:0d2164f0ce0d
623 $ hg update -r Y
623 $ hg update -r Y
624 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
624 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
625 (activating bookmark Y)
625 (activating bookmark Y)
626 $ hg pull -B .
626 $ hg pull -B .
627 pulling from http://localhost:$HGPORT/
627 pulling from http://localhost:$HGPORT/
628 searching for changes
628 searching for changes
629 adding changesets
629 adding changesets
630 adding manifests
630 adding manifests
631 adding file changes
631 adding file changes
632 added 1 changesets with 1 changes to 1 files
632 added 1 changesets with 1 changes to 1 files
633 updating bookmark Y
633 updating bookmark Y
634 new changesets 35d1ef0a8d1b (1 drafts)
634 new changesets 35d1ef0a8d1b (1 drafts)
635 (run 'hg update' to get a working copy)
635 (run 'hg update' to get a working copy)
636 $ hg book
636 $ hg book
637 @ 1:0d2164f0ce0d
637 @ 1:0d2164f0ce0d
638 X 1:0d2164f0ce0d
638 X 1:0d2164f0ce0d
639 * Y 5:35d1ef0a8d1b
639 * Y 5:35d1ef0a8d1b
640 Z 1:0d2164f0ce0d
640 Z 1:0d2164f0ce0d
641
641
642 Update a bookmark right after the initial lookup -r (issue4700)
642 Update a bookmark right after the initial lookup -r (issue4700)
643
643
644 $ echo c7 > ../pull-race/f3 # to be committed during the race
644 $ echo c7 > ../pull-race/f3 # to be committed during the race
645 $ cat <<EOF > ../lookuphook.py
645 $ cat <<EOF > ../lookuphook.py
646 > """small extensions adding a hook after wireprotocol lookup to test race"""
646 > """small extensions adding a hook after wireprotocol lookup to test race"""
647 > import functools
647 > import functools
648 > from mercurial import wireprotov1server, wireprotov2server
648 > from mercurial import wireprotov1server, wireprotov2server
649 >
649 >
650 > def wrappedlookup(orig, repo, *args, **kwargs):
650 > def wrappedlookup(orig, repo, *args, **kwargs):
651 > ret = orig(repo, *args, **kwargs)
651 > ret = orig(repo, *args, **kwargs)
652 > repo.hook(b'lookup')
652 > repo.hook(b'lookup')
653 > return ret
653 > return ret
654 > for table in [wireprotov1server.commands, wireprotov2server.COMMANDS]:
654 > for table in [wireprotov1server.commands, wireprotov2server.COMMANDS]:
655 > table[b'lookup'].func = functools.partial(wrappedlookup, table[b'lookup'].func)
655 > table[b'lookup'].func = functools.partial(wrappedlookup, table[b'lookup'].func)
656 > EOF
656 > EOF
657 $ cat <<EOF > ../pull-race/.hg/hgrc
657 $ cat <<EOF > ../pull-race/.hg/hgrc
658 > [extensions]
658 > [extensions]
659 > lookuphook=$TESTTMP/lookuphook.py
659 > lookuphook=$TESTTMP/lookuphook.py
660 > [hooks]
660 > [hooks]
661 > lookup.makecommit= sh $TESTTMP/listkeys_makecommit.sh
661 > lookup.makecommit= sh $TESTTMP/listkeys_makecommit.sh
662 > EOF
662 > EOF
663 $ restart_server # new config need server restart
663 $ restart_server # new config need server restart
664 $ hg -R $TESTTMP/pull-race book
664 $ hg -R $TESTTMP/pull-race book
665 @ 1:0d2164f0ce0d
665 @ 1:0d2164f0ce0d
666 X 1:0d2164f0ce0d
666 X 1:0d2164f0ce0d
667 * Y 6:0d60821d2197
667 * Y 6:0d60821d2197
668 Z 1:0d2164f0ce0d
668 Z 1:0d2164f0ce0d
669 $ hg pull -r Y
669 $ hg pull -r Y
670 pulling from http://localhost:$HGPORT/
670 pulling from http://localhost:$HGPORT/
671 searching for changes
671 searching for changes
672 adding changesets
672 adding changesets
673 adding manifests
673 adding manifests
674 adding file changes
674 adding file changes
675 added 1 changesets with 1 changes to 1 files
675 added 1 changesets with 1 changes to 1 files
676 updating bookmark Y
676 updating bookmark Y
677 new changesets 0d60821d2197 (1 drafts)
677 new changesets 0d60821d2197 (1 drafts)
678 (run 'hg update' to get a working copy)
678 (run 'hg update' to get a working copy)
679 $ hg book
679 $ hg book
680 @ 1:0d2164f0ce0d
680 @ 1:0d2164f0ce0d
681 X 1:0d2164f0ce0d
681 X 1:0d2164f0ce0d
682 * Y 6:0d60821d2197
682 * Y 6:0d60821d2197
683 Z 1:0d2164f0ce0d
683 Z 1:0d2164f0ce0d
684 $ hg -R $TESTTMP/pull-race book
684 $ hg -R $TESTTMP/pull-race book
685 @ 1:0d2164f0ce0d
685 @ 1:0d2164f0ce0d
686 X 1:0d2164f0ce0d
686 X 1:0d2164f0ce0d
687 * Y 7:714424d9e8b8
687 * Y 7:714424d9e8b8
688 Z 1:0d2164f0ce0d
688 Z 1:0d2164f0ce0d
689
689
690 (done with this section of the test)
690 (done with this section of the test)
691
691
692 $ killdaemons.py
692 $ killdaemons.py
693 $ cd ../b
693 $ cd ../b
694
694
695 diverging a remote bookmark fails
695 diverging a remote bookmark fails
696
696
697 $ hg up -q 4e3505fd9583
697 $ hg up -q 4e3505fd9583
698 $ echo c4 > f2
698 $ echo c4 > f2
699 $ hg ci -Am4
699 $ hg ci -Am4
700 adding f2
700 adding f2
701 created new head
701 created new head
702 $ echo c5 > f2
702 $ echo c5 > f2
703 $ hg ci -Am5
703 $ hg ci -Am5
704 $ hg log -G
704 $ hg log -G
705 @ 5:c922c0139ca0 5
705 @ 5:c922c0139ca0 5
706 |
706 |
707 o 4:4efff6d98829 4
707 o 4:4efff6d98829 4
708 |
708 |
709 | o 3:f6fc62dde3c0 3
709 | o 3:f6fc62dde3c0 3
710 |/
710 |/
711 | o 2:0d2164f0ce0d 1
711 | o 2:0d2164f0ce0d 1
712 |/
712 |/
713 | o 1:9b140be10808 2
713 | o 1:9b140be10808 2
714 |/
714 |/
715 o 0:4e3505fd9583 test
715 o 0:4e3505fd9583 test
716
716
717
717
718 $ hg book -f Y
718 $ hg book -f Y
719
719
720 $ cat <<EOF > ../a/.hg/hgrc
720 $ cat <<EOF > ../a/.hg/hgrc
721 > [web]
721 > [web]
722 > push_ssl = false
722 > push_ssl = false
723 > allow_push = *
723 > allow_push = *
724 > EOF
724 > EOF
725
725
726 $ hg serve -R ../a -p $HGPORT2 -d --pid-file=../hg2.pid
726 $ hg serve -R ../a -p $HGPORT2 -d --pid-file=../hg2.pid
727 $ cat ../hg2.pid >> $DAEMON_PIDS
727 $ cat ../hg2.pid >> $DAEMON_PIDS
728
728
729 $ hg push http://localhost:$HGPORT2/
729 $ hg push http://localhost:$HGPORT2/
730 pushing to http://localhost:$HGPORT2/
730 pushing to http://localhost:$HGPORT2/
731 searching for changes
731 searching for changes
732 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
732 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
733 (merge or see 'hg help push' for details about pushing new heads)
733 (merge or see 'hg help push' for details about pushing new heads)
734 [255]
734 [255]
735 $ hg -R ../a book
735 $ hg -R ../a book
736 @ 1:0d2164f0ce0d
736 @ 1:0d2164f0ce0d
737 * X 1:0d2164f0ce0d
737 * X 1:0d2164f0ce0d
738 Y 3:f6fc62dde3c0
738 Y 3:f6fc62dde3c0
739 Z 1:0d2164f0ce0d
739 Z 1:0d2164f0ce0d
740
740
741
741
742 Unrelated marker does not alter the decision
742 Unrelated marker does not alter the decision
743
743
744 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
744 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
745 $ hg push http://localhost:$HGPORT2/
745 $ hg push http://localhost:$HGPORT2/
746 pushing to http://localhost:$HGPORT2/
746 pushing to http://localhost:$HGPORT2/
747 searching for changes
747 searching for changes
748 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
748 abort: push creates new remote head c922c0139ca0 with bookmark 'Y'!
749 (merge or see 'hg help push' for details about pushing new heads)
749 (merge or see 'hg help push' for details about pushing new heads)
750 [255]
750 [255]
751 $ hg -R ../a book
751 $ hg -R ../a book
752 @ 1:0d2164f0ce0d
752 @ 1:0d2164f0ce0d
753 * X 1:0d2164f0ce0d
753 * X 1:0d2164f0ce0d
754 Y 3:f6fc62dde3c0
754 Y 3:f6fc62dde3c0
755 Z 1:0d2164f0ce0d
755 Z 1:0d2164f0ce0d
756
756
757 Update to a successor works
757 Update to a successor works
758
758
759 $ hg id --debug -r 3
759 $ hg id --debug -r 3
760 f6fc62dde3c0771e29704af56ba4d8af77abcc2f
760 f6fc62dde3c0771e29704af56ba4d8af77abcc2f
761 $ hg id --debug -r 4
761 $ hg id --debug -r 4
762 4efff6d98829d9c824c621afd6e3f01865f5439f
762 4efff6d98829d9c824c621afd6e3f01865f5439f
763 $ hg id --debug -r 5
763 $ hg id --debug -r 5
764 c922c0139ca03858f655e4a2af4dd02796a63969 tip Y
764 c922c0139ca03858f655e4a2af4dd02796a63969 tip Y
765 $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc
765 $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc
766 obsoleted 1 changesets
766 obsoleted 1 changesets
767 $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f
767 $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f
768 $ hg push http://localhost:$HGPORT2/
768 $ hg push http://localhost:$HGPORT2/
769 pushing to http://localhost:$HGPORT2/
769 pushing to http://localhost:$HGPORT2/
770 searching for changes
770 searching for changes
771 remote: adding changesets
771 remote: adding changesets
772 remote: adding manifests
772 remote: adding manifests
773 remote: adding file changes
773 remote: adding file changes
774 remote: added 2 changesets with 2 changes to 1 files (+1 heads)
774 remote: added 2 changesets with 2 changes to 1 files (+1 heads)
775 remote: 2 new obsolescence markers
775 remote: 2 new obsolescence markers
776 remote: obsoleted 1 changesets
776 remote: obsoleted 1 changesets
777 updating bookmark Y
777 updating bookmark Y
778 $ hg -R ../a book
778 $ hg -R ../a book
779 @ 1:0d2164f0ce0d
779 @ 1:0d2164f0ce0d
780 * X 1:0d2164f0ce0d
780 * X 1:0d2164f0ce0d
781 Y 5:c922c0139ca0
781 Y 5:c922c0139ca0
782 Z 1:0d2164f0ce0d
782 Z 1:0d2164f0ce0d
783
783
784 hgweb
784 hgweb
785
785
786 $ cat <<EOF > .hg/hgrc
786 $ cat <<EOF > .hg/hgrc
787 > [web]
787 > [web]
788 > push_ssl = false
788 > push_ssl = false
789 > allow_push = *
789 > allow_push = *
790 > EOF
790 > EOF
791
791
792 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
792 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
793 $ cat ../hg.pid >> $DAEMON_PIDS
793 $ cat ../hg.pid >> $DAEMON_PIDS
794 $ cd ../a
794 $ cd ../a
795
795
796 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
796 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
797 bookmarks
797 bookmarks
798 namespaces
798 namespaces
799 obsolete
799 obsolete
800 phases
800 phases
801 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
801 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
802 @ 9b140be1080824d768c5a4691a564088eede71f9
802 @ 9b140be1080824d768c5a4691a564088eede71f9
803 X 9b140be1080824d768c5a4691a564088eede71f9
803 X 9b140be1080824d768c5a4691a564088eede71f9
804 Y c922c0139ca03858f655e4a2af4dd02796a63969
804 Y c922c0139ca03858f655e4a2af4dd02796a63969
805 Z 9b140be1080824d768c5a4691a564088eede71f9
805 Z 9b140be1080824d768c5a4691a564088eede71f9
806 foo 0000000000000000000000000000000000000000
806 foo 0000000000000000000000000000000000000000
807 foobar 9b140be1080824d768c5a4691a564088eede71f9
807 foobar 9b140be1080824d768c5a4691a564088eede71f9
808 $ hg out -B http://localhost:$HGPORT/
808 $ hg out -B http://localhost:$HGPORT/
809 comparing with http://localhost:$HGPORT/
809 comparing with http://localhost:$HGPORT/
810 searching for changed bookmarks
810 searching for changed bookmarks
811 @ 0d2164f0ce0d
811 @ 0d2164f0ce0d
812 X 0d2164f0ce0d
812 X 0d2164f0ce0d
813 Z 0d2164f0ce0d
813 Z 0d2164f0ce0d
814 foo
814 foo
815 foobar
815 foobar
816 $ hg push -B Z http://localhost:$HGPORT/
816 $ hg push -B Z http://localhost:$HGPORT/
817 pushing to http://localhost:$HGPORT/
817 pushing to http://localhost:$HGPORT/
818 searching for changes
818 searching for changes
819 no changes found
819 no changes found
820 updating bookmark Z
820 updating bookmark Z
821 [1]
821 [1]
822 $ hg book -d Z
822 $ hg book -d Z
823 $ hg in -B http://localhost:$HGPORT/
823 $ hg in -B http://localhost:$HGPORT/
824 comparing with http://localhost:$HGPORT/
824 comparing with http://localhost:$HGPORT/
825 searching for changed bookmarks
825 searching for changed bookmarks
826 @ 9b140be10808
826 @ 9b140be10808
827 X 9b140be10808
827 X 9b140be10808
828 Z 0d2164f0ce0d
828 Z 0d2164f0ce0d
829 foo 000000000000
829 foo 000000000000
830 foobar 9b140be10808
830 foobar 9b140be10808
831 $ hg pull -B Z http://localhost:$HGPORT/
831 $ hg pull -B Z http://localhost:$HGPORT/
832 pulling from http://localhost:$HGPORT/
832 pulling from http://localhost:$HGPORT/
833 no changes found
833 no changes found
834 divergent bookmark @ stored as @1
834 divergent bookmark @ stored as @1
835 divergent bookmark X stored as X@1
835 divergent bookmark X stored as X@1
836 adding remote bookmark Z
836 adding remote bookmark Z
837 adding remote bookmark foo
837 adding remote bookmark foo
838 adding remote bookmark foobar
838 adding remote bookmark foobar
839 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
839 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
840 requesting all changes
840 requesting all changes
841 adding changesets
841 adding changesets
842 adding manifests
842 adding manifests
843 adding file changes
843 adding file changes
844 added 5 changesets with 5 changes to 3 files (+2 heads)
844 added 5 changesets with 5 changes to 3 files (+2 heads)
845 2 new obsolescence markers
845 2 new obsolescence markers
846 new changesets 4e3505fd9583:c922c0139ca0 (5 drafts)
846 new changesets 4e3505fd9583:c922c0139ca0 (5 drafts)
847 updating to bookmark @
847 updating to bookmark @
848 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
848 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
849 $ hg -R cloned-bookmarks bookmarks
849 $ hg -R cloned-bookmarks bookmarks
850 * @ 1:9b140be10808
850 * @ 1:9b140be10808
851 X 1:9b140be10808
851 X 1:9b140be10808
852 Y 4:c922c0139ca0
852 Y 4:c922c0139ca0
853 Z 2:0d2164f0ce0d
853 Z 2:0d2164f0ce0d
854 foo -1:000000000000
854 foo -1:000000000000
855 foobar 1:9b140be10808
855 foobar 1:9b140be10808
856
856
857 $ cd ..
857 $ cd ..
858
858
859 Test to show result of bookmarks comparison
859 Test to show result of bookmarks comparison
860
860
861 $ mkdir bmcomparison
861 $ mkdir bmcomparison
862 $ cd bmcomparison
862 $ cd bmcomparison
863
863
864 $ hg init source
864 $ hg init source
865 $ hg -R source debugbuilddag '+2*2*3*4'
865 $ hg -R source debugbuilddag '+2*2*3*4'
866 $ hg -R source log -G --template '{rev}:{node|short}'
866 $ hg -R source log -G --template '{rev}:{node|short}'
867 o 4:e7bd5218ca15
867 o 4:e7bd5218ca15
868 |
868 |
869 | o 3:6100d3090acf
869 | o 3:6100d3090acf
870 |/
870 |/
871 | o 2:fa942426a6fd
871 | o 2:fa942426a6fd
872 |/
872 |/
873 | o 1:66f7d451a68b
873 | o 1:66f7d451a68b
874 |/
874 |/
875 o 0:1ea73414a91b
875 o 0:1ea73414a91b
876
876
877 $ hg -R source bookmarks -r 0 SAME
877 $ hg -R source bookmarks -r 0 SAME
878 $ hg -R source bookmarks -r 0 ADV_ON_REPO1
878 $ hg -R source bookmarks -r 0 ADV_ON_REPO1
879 $ hg -R source bookmarks -r 0 ADV_ON_REPO2
879 $ hg -R source bookmarks -r 0 ADV_ON_REPO2
880 $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1
880 $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1
881 $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2
881 $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2
882 $ hg -R source bookmarks -r 1 DIVERGED
882 $ hg -R source bookmarks -r 1 DIVERGED
883
883
884 $ hg clone -U source repo1
884 $ hg clone -U source repo1
885
885
886 (test that incoming/outgoing exit with 1, if there is no bookmark to
886 (test that incoming/outgoing exit with 1, if there is no bookmark to
887 be exchanged)
887 be exchanged)
888
888
889 $ hg -R repo1 incoming -B
889 $ hg -R repo1 incoming -B
890 comparing with $TESTTMP/bmcomparison/source
890 comparing with $TESTTMP/bmcomparison/source
891 searching for changed bookmarks
891 searching for changed bookmarks
892 no changed bookmarks found
892 no changed bookmarks found
893 [1]
893 [1]
894 $ hg -R repo1 outgoing -B
894 $ hg -R repo1 outgoing -B
895 comparing with $TESTTMP/bmcomparison/source
895 comparing with $TESTTMP/bmcomparison/source
896 searching for changed bookmarks
896 searching for changed bookmarks
897 no changed bookmarks found
897 no changed bookmarks found
898 [1]
898 [1]
899
899
900 $ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1
900 $ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1
901 $ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1
901 $ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1
902 $ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1
902 $ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1
903 $ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED
903 $ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED
904 $ hg -R repo1 -q --config extensions.mq= strip 4
904 $ hg -R repo1 -q --config extensions.mq= strip 4
905 $ hg -R repo1 log -G --template '{node|short} ({bookmarks})'
905 $ hg -R repo1 log -G --template '{node|short} ({bookmarks})'
906 o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED)
906 o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED)
907 |
907 |
908 | o fa942426a6fd (ADV_ON_REPO1)
908 | o fa942426a6fd (ADV_ON_REPO1)
909 |/
909 |/
910 | o 66f7d451a68b (ADD_ON_REPO1 DIVERGED)
910 | o 66f7d451a68b (ADD_ON_REPO1 DIVERGED)
911 |/
911 |/
912 o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME)
912 o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME)
913
913
914
914
915 $ hg clone -U source repo2
915 $ hg clone -U source repo2
916 $ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2
916 $ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2
917 $ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2
917 $ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2
918 $ hg -R repo2 bookmarks -f -r 2 DIVERGED
918 $ hg -R repo2 bookmarks -f -r 2 DIVERGED
919 $ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2
919 $ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2
920 $ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED
920 $ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED
921 $ hg -R repo2 -q --config extensions.mq= strip 3
921 $ hg -R repo2 -q --config extensions.mq= strip 3
922 $ hg -R repo2 log -G --template '{node|short} ({bookmarks})'
922 $ hg -R repo2 log -G --template '{node|short} ({bookmarks})'
923 o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED)
923 o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED)
924 |
924 |
925 | o fa942426a6fd (DIVERGED)
925 | o fa942426a6fd (DIVERGED)
926 |/
926 |/
927 | o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2)
927 | o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2)
928 |/
928 |/
929 o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME)
929 o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME)
930
930
931
931
932 (test that difference of bookmarks between repositories are fully shown)
932 (test that difference of bookmarks between repositories are fully shown)
933
933
934 $ hg -R repo1 incoming -B repo2 -v
934 $ hg -R repo1 incoming -B repo2 -v
935 comparing with repo2
935 comparing with repo2
936 searching for changed bookmarks
936 searching for changed bookmarks
937 ADD_ON_REPO2 66f7d451a68b added
937 ADD_ON_REPO2 66f7d451a68b added
938 ADV_ON_REPO2 66f7d451a68b advanced
938 ADV_ON_REPO2 66f7d451a68b advanced
939 DIFF_ADV_ON_REPO2 e7bd5218ca15 changed
939 DIFF_ADV_ON_REPO2 e7bd5218ca15 changed
940 DIFF_DIVERGED e7bd5218ca15 changed
940 DIFF_DIVERGED e7bd5218ca15 changed
941 DIVERGED fa942426a6fd diverged
941 DIVERGED fa942426a6fd diverged
942 $ hg -R repo1 outgoing -B repo2 -v
942 $ hg -R repo1 outgoing -B repo2 -v
943 comparing with repo2
943 comparing with repo2
944 searching for changed bookmarks
944 searching for changed bookmarks
945 ADD_ON_REPO1 66f7d451a68b added
945 ADD_ON_REPO1 66f7d451a68b added
946 ADD_ON_REPO2 deleted
946 ADD_ON_REPO2 deleted
947 ADV_ON_REPO1 fa942426a6fd advanced
947 ADV_ON_REPO1 fa942426a6fd advanced
948 DIFF_ADV_ON_REPO1 6100d3090acf advanced
948 DIFF_ADV_ON_REPO1 6100d3090acf advanced
949 DIFF_ADV_ON_REPO2 1ea73414a91b changed
949 DIFF_ADV_ON_REPO2 1ea73414a91b changed
950 DIFF_DIVERGED 6100d3090acf changed
950 DIFF_DIVERGED 6100d3090acf changed
951 DIVERGED 66f7d451a68b diverged
951 DIVERGED 66f7d451a68b diverged
952
952
953 $ hg -R repo2 incoming -B repo1 -v
953 $ hg -R repo2 incoming -B repo1 -v
954 comparing with repo1
954 comparing with repo1
955 searching for changed bookmarks
955 searching for changed bookmarks
956 ADD_ON_REPO1 66f7d451a68b added
956 ADD_ON_REPO1 66f7d451a68b added
957 ADV_ON_REPO1 fa942426a6fd advanced
957 ADV_ON_REPO1 fa942426a6fd advanced
958 DIFF_ADV_ON_REPO1 6100d3090acf changed
958 DIFF_ADV_ON_REPO1 6100d3090acf changed
959 DIFF_DIVERGED 6100d3090acf changed
959 DIFF_DIVERGED 6100d3090acf changed
960 DIVERGED 66f7d451a68b diverged
960 DIVERGED 66f7d451a68b diverged
961 $ hg -R repo2 outgoing -B repo1 -v
961 $ hg -R repo2 outgoing -B repo1 -v
962 comparing with repo1
962 comparing with repo1
963 searching for changed bookmarks
963 searching for changed bookmarks
964 ADD_ON_REPO1 deleted
964 ADD_ON_REPO1 deleted
965 ADD_ON_REPO2 66f7d451a68b added
965 ADD_ON_REPO2 66f7d451a68b added
966 ADV_ON_REPO2 66f7d451a68b advanced
966 ADV_ON_REPO2 66f7d451a68b advanced
967 DIFF_ADV_ON_REPO1 1ea73414a91b changed
967 DIFF_ADV_ON_REPO1 1ea73414a91b changed
968 DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced
968 DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced
969 DIFF_DIVERGED e7bd5218ca15 changed
969 DIFF_DIVERGED e7bd5218ca15 changed
970 DIVERGED fa942426a6fd diverged
970 DIVERGED fa942426a6fd diverged
971
971
972 $ cd ..
972 $ cd ..
973
973
974 Pushing a bookmark should only push the changes required by that
974 Pushing a bookmark should only push the changes required by that
975 bookmark, not all outgoing changes:
975 bookmark, not all outgoing changes:
976 $ hg clone http://localhost:$HGPORT/ addmarks
976 $ hg clone http://localhost:$HGPORT/ addmarks
977 requesting all changes
977 requesting all changes
978 adding changesets
978 adding changesets
979 adding manifests
979 adding manifests
980 adding file changes
980 adding file changes
981 added 5 changesets with 5 changes to 3 files (+2 heads)
981 added 5 changesets with 5 changes to 3 files (+2 heads)
982 2 new obsolescence markers
982 2 new obsolescence markers
983 new changesets 4e3505fd9583:c922c0139ca0 (5 drafts)
983 new changesets 4e3505fd9583:c922c0139ca0 (5 drafts)
984 updating to bookmark @
984 updating to bookmark @
985 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
985 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
986 $ cd addmarks
986 $ cd addmarks
987 $ echo foo > foo
987 $ echo foo > foo
988 $ hg add foo
988 $ hg add foo
989 $ hg commit -m 'add foo'
989 $ hg commit -m 'add foo'
990 $ echo bar > bar
990 $ echo bar > bar
991 $ hg add bar
991 $ hg add bar
992 $ hg commit -m 'add bar'
992 $ hg commit -m 'add bar'
993 $ hg co "tip^"
993 $ hg co "tip^"
994 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
994 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
995 (leaving bookmark @)
995 (leaving bookmark @)
996 $ hg book add-foo
996 $ hg book add-foo
997 $ hg book -r tip add-bar
997 $ hg book -r tip add-bar
998 Note: this push *must* push only a single changeset, as that's the point
998 Note: this push *must* push only a single changeset, as that's the point
999 of this test.
999 of this test.
1000 $ hg push -B add-foo --traceback
1000 $ hg push -B add-foo --traceback
1001 pushing to http://localhost:$HGPORT/
1001 pushing to http://localhost:$HGPORT/
1002 searching for changes
1002 searching for changes
1003 remote: adding changesets
1003 remote: adding changesets
1004 remote: adding manifests
1004 remote: adding manifests
1005 remote: adding file changes
1005 remote: adding file changes
1006 remote: added 1 changesets with 1 changes to 1 files
1006 remote: added 1 changesets with 1 changes to 1 files
1007 exporting bookmark add-foo
1007 exporting bookmark add-foo
1008
1008
1009 pushing a new bookmark on a new head does not require -f if -B is specified
1009 pushing a new bookmark on a new head does not require -f if -B is specified
1010
1010
1011 $ hg up -q X
1011 $ hg up -q X
1012 $ hg book W
1012 $ hg book W
1013 $ echo c5 > f2
1013 $ echo c5 > f2
1014 $ hg ci -Am5
1014 $ hg ci -Am5
1015 created new head
1015 created new head
1016 $ hg push -B .
1016 $ hg push -B .
1017 pushing to http://localhost:$HGPORT/
1017 pushing to http://localhost:$HGPORT/
1018 searching for changes
1018 searching for changes
1019 remote: adding changesets
1019 remote: adding changesets
1020 remote: adding manifests
1020 remote: adding manifests
1021 remote: adding file changes
1021 remote: adding file changes
1022 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
1022 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
1023 exporting bookmark W
1023 exporting bookmark W
1024 $ hg -R ../b id -r W
1024 $ hg -R ../b id -r W
1025 cc978a373a53 tip W
1025 cc978a373a53 tip W
1026
1026
1027 pushing an existing but divergent bookmark with -B still requires -f
1027 pushing an existing but divergent bookmark with -B still requires -f
1028
1028
1029 $ hg clone -q . ../r
1029 $ hg clone -q . ../r
1030 $ hg up -q X
1030 $ hg up -q X
1031 $ echo 1 > f2
1031 $ echo 1 > f2
1032 $ hg ci -qAml
1032 $ hg ci -qAml
1033
1033
1034 $ cd ../r
1034 $ cd ../r
1035 $ hg up -q X
1035 $ hg up -q X
1036 $ echo 2 > f2
1036 $ echo 2 > f2
1037 $ hg ci -qAmr
1037 $ hg ci -qAmr
1038 $ hg push -B X
1038 $ hg push -B X
1039 pushing to $TESTTMP/addmarks
1039 pushing to $TESTTMP/addmarks
1040 searching for changes
1040 searching for changes
1041 remote has heads on branch 'default' that are not known locally: a2a606d9ff1b
1041 remote has heads on branch 'default' that are not known locally: a2a606d9ff1b
1042 abort: push creates new remote head 54694f811df9 with bookmark 'X'!
1042 abort: push creates new remote head 54694f811df9 with bookmark 'X'!
1043 (pull and merge or see 'hg help push' for details about pushing new heads)
1043 (pull and merge or see 'hg help push' for details about pushing new heads)
1044 [255]
1044 [255]
1045 $ cd ../addmarks
1045 $ cd ../addmarks
1046
1046
1047 Check summary output for incoming/outgoing bookmarks
1047 Check summary output for incoming/outgoing bookmarks
1048
1048
1049 $ hg bookmarks -d X
1049 $ hg bookmarks -d X
1050 $ hg bookmarks -d Y
1050 $ hg bookmarks -d Y
1051 $ hg summary --remote | grep '^remote:'
1051 $ hg summary --remote | grep '^remote:'
1052 remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob)
1052 remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob)
1053
1053
1054 $ cd ..
1054 $ cd ..
1055
1055
1056 pushing an unchanged bookmark should result in no changes
1056 pushing an unchanged bookmark should result in no changes
1057
1057
1058 $ hg init unchanged-a
1058 $ hg init unchanged-a
1059 $ hg init unchanged-b
1059 $ hg init unchanged-b
1060 $ cd unchanged-a
1060 $ cd unchanged-a
1061 $ echo initial > foo
1061 $ echo initial > foo
1062 $ hg commit -A -m initial
1062 $ hg commit -A -m initial
1063 adding foo
1063 adding foo
1064 $ hg bookmark @
1064 $ hg bookmark @
1065 $ hg push -B @ ../unchanged-b
1065 $ hg push -B @ ../unchanged-b
1066 pushing to ../unchanged-b
1066 pushing to ../unchanged-b
1067 searching for changes
1067 searching for changes
1068 adding changesets
1068 adding changesets
1069 adding manifests
1069 adding manifests
1070 adding file changes
1070 adding file changes
1071 added 1 changesets with 1 changes to 1 files
1071 added 1 changesets with 1 changes to 1 files
1072 exporting bookmark @
1072 exporting bookmark @
1073
1073
1074 $ hg push -B @ ../unchanged-b
1074 $ hg push -B @ ../unchanged-b
1075 pushing to ../unchanged-b
1075 pushing to ../unchanged-b
1076 searching for changes
1076 searching for changes
1077 no changes found
1077 no changes found
1078 [1]
1078 [1]
1079
1079
1080 Pushing a really long bookmark should work fine (issue5165)
1080 Pushing a really long bookmark should work fine (issue5165)
1081 ===============================================
1081 ===============================================
1082
1082
1083 #if b2-binary
1083 #if b2-binary
1084 >>> with open('longname', 'w') as f:
1084 >>> with open('longname', 'w') as f:
1085 ... f.write('wat' * 100) and None
1085 ... f.write('wat' * 100) and None
1086 $ hg book `cat longname`
1086 $ hg book `cat longname`
1087 $ hg push -B `cat longname` ../unchanged-b
1087 $ hg push -B `cat longname` ../unchanged-b
1088 pushing to ../unchanged-b
1088 pushing to ../unchanged-b
1089 searching for changes
1089 searching for changes
1090 no changes found
1090 no changes found
1091 exporting bookmark (wat){100} (re)
1091 exporting bookmark (wat){100} (re)
1092 [1]
1092 [1]
1093 $ hg -R ../unchanged-b book --delete `cat longname`
1093 $ hg -R ../unchanged-b book --delete `cat longname`
1094
1094
1095 Test again but forcing bundle2 exchange to make sure that doesn't regress.
1095 Test again but forcing bundle2 exchange to make sure that doesn't regress.
1096
1096
1097 $ hg push -B `cat longname` ../unchanged-b --config devel.legacy.exchange=bundle1
1097 $ hg push -B `cat longname` ../unchanged-b --config devel.legacy.exchange=bundle1
1098 pushing to ../unchanged-b
1098 pushing to ../unchanged-b
1099 searching for changes
1099 searching for changes
1100 no changes found
1100 no changes found
1101 exporting bookmark (wat){100} (re)
1101 exporting bookmark (wat){100} (re)
1102 [1]
1102 [1]
1103 $ hg -R ../unchanged-b book --delete `cat longname`
1103 $ hg -R ../unchanged-b book --delete `cat longname`
1104 $ hg book --delete `cat longname`
1104 $ hg book --delete `cat longname`
1105 $ hg co @
1105 $ hg co @
1106 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1106 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1107 (activating bookmark @)
1107 (activating bookmark @)
1108 #endif
1108 #endif
1109
1109
1110 Check hook preventing push (issue4455)
1110 Check hook preventing push (issue4455)
1111 ======================================
1111 ======================================
1112
1112
1113 $ hg bookmarks
1113 $ hg bookmarks
1114 * @ 0:55482a6fb4b1
1114 * @ 0:55482a6fb4b1
1115 $ hg log -G
1115 $ hg log -G
1116 @ 0:55482a6fb4b1 initial
1116 @ 0:55482a6fb4b1 initial
1117
1117
1118 $ hg init ../issue4455-dest
1118 $ hg init ../issue4455-dest
1119 $ hg push ../issue4455-dest # changesets only
1119 $ hg push ../issue4455-dest # changesets only
1120 pushing to ../issue4455-dest
1120 pushing to ../issue4455-dest
1121 searching for changes
1121 searching for changes
1122 adding changesets
1122 adding changesets
1123 adding manifests
1123 adding manifests
1124 adding file changes
1124 adding file changes
1125 added 1 changesets with 1 changes to 1 files
1125 added 1 changesets with 1 changes to 1 files
1126 $ cat >> .hg/hgrc << EOF
1126 $ cat >> .hg/hgrc << EOF
1127 > [paths]
1127 > [paths]
1128 > local=../issue4455-dest/
1128 > local=../issue4455-dest/
1129 > ssh=ssh://user@dummy/issue4455-dest
1129 > ssh=ssh://user@dummy/issue4455-dest
1130 > http=http://localhost:$HGPORT/
1130 > http=http://localhost:$HGPORT/
1131 > [ui]
1131 > [ui]
1132 > ssh="$PYTHON" "$TESTDIR/dummyssh"
1132 > ssh="$PYTHON" "$TESTDIR/dummyssh"
1133 > EOF
1133 > EOF
1134 $ cat >> ../issue4455-dest/.hg/hgrc << EOF
1134 $ cat >> ../issue4455-dest/.hg/hgrc << EOF
1135 > [hooks]
1135 > [hooks]
1136 > prepushkey=false
1136 > prepushkey=false
1137 > [web]
1137 > [web]
1138 > push_ssl = false
1138 > push_ssl = false
1139 > allow_push = *
1139 > allow_push = *
1140 > EOF
1140 > EOF
1141 $ killdaemons.py
1141 $ killdaemons.py
1142 $ hg serve -R ../issue4455-dest -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log
1142 $ hg serve -R ../issue4455-dest -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log
1143 $ cat ../issue4455.pid >> $DAEMON_PIDS
1143 $ cat ../issue4455.pid >> $DAEMON_PIDS
1144
1144
1145 Local push
1145 Local push
1146 ----------
1146 ----------
1147
1147
1148 #if b2-pushkey
1148 #if b2-pushkey
1149
1149
1150 $ hg push -B @ local
1150 $ hg push -B @ local
1151 pushing to $TESTTMP/issue4455-dest
1151 pushing to $TESTTMP/issue4455-dest
1152 searching for changes
1152 searching for changes
1153 no changes found
1153 no changes found
1154 pushkey-abort: prepushkey hook exited with status 1
1154 pushkey-abort: prepushkey hook exited with status 1
1155 abort: exporting bookmark @ failed!
1155 abort: exporting bookmark @ failed!
1156 [255]
1156 [255]
1157
1157
1158 #endif
1158 #endif
1159 #if b2-binary
1159 #if b2-binary
1160
1160
1161 $ hg push -B @ local
1161 $ hg push -B @ local
1162 pushing to $TESTTMP/issue4455-dest
1162 pushing to $TESTTMP/issue4455-dest
1163 searching for changes
1163 searching for changes
1164 no changes found
1164 no changes found
1165 abort: prepushkey hook exited with status 1
1165 abort: prepushkey hook exited with status 1
1166 [255]
1166 [255]
1167
1167
1168 #endif
1168 #endif
1169
1169
1170 $ hg -R ../issue4455-dest/ bookmarks
1170 $ hg -R ../issue4455-dest/ bookmarks
1171 no bookmarks set
1171 no bookmarks set
1172
1172
1173 Using ssh
1173 Using ssh
1174 ---------
1174 ---------
1175
1175
1176 #if b2-pushkey
1176 #if b2-pushkey
1177
1177
1178 $ hg push -B @ ssh # bundle2+
1178 $ hg push -B @ ssh # bundle2+
1179 pushing to ssh://user@dummy/issue4455-dest
1179 pushing to ssh://user@dummy/issue4455-dest
1180 searching for changes
1180 searching for changes
1181 no changes found
1181 no changes found
1182 remote: pushkey-abort: prepushkey hook exited with status 1
1182 remote: pushkey-abort: prepushkey hook exited with status 1
1183 abort: exporting bookmark @ failed!
1183 abort: exporting bookmark @ failed!
1184 [255]
1184 [255]
1185
1185
1186 $ hg -R ../issue4455-dest/ bookmarks
1186 $ hg -R ../issue4455-dest/ bookmarks
1187 no bookmarks set
1187 no bookmarks set
1188
1188
1189 $ hg push -B @ ssh --config devel.legacy.exchange=bundle1
1189 $ hg push -B @ ssh --config devel.legacy.exchange=bundle1
1190 pushing to ssh://user@dummy/issue4455-dest
1190 pushing to ssh://user@dummy/issue4455-dest
1191 searching for changes
1191 searching for changes
1192 no changes found
1192 no changes found
1193 remote: pushkey-abort: prepushkey hook exited with status 1
1193 remote: pushkey-abort: prepushkey hook exited with status 1
1194 exporting bookmark @ failed!
1194 exporting bookmark @ failed!
1195 [1]
1195 [1]
1196
1196
1197 #endif
1197 #endif
1198 #if b2-binary
1198 #if b2-binary
1199
1199
1200 $ hg push -B @ ssh # bundle2+
1200 $ hg push -B @ ssh # bundle2+
1201 pushing to ssh://user@dummy/issue4455-dest
1201 pushing to ssh://user@dummy/issue4455-dest
1202 searching for changes
1202 searching for changes
1203 no changes found
1203 no changes found
1204 remote: prepushkey hook exited with status 1
1204 remote: prepushkey hook exited with status 1
1205 abort: push failed on remote
1205 abort: push failed on remote
1206 [255]
1206 [255]
1207
1207
1208 #endif
1208 #endif
1209
1209
1210 $ hg -R ../issue4455-dest/ bookmarks
1210 $ hg -R ../issue4455-dest/ bookmarks
1211 no bookmarks set
1211 no bookmarks set
1212
1212
1213 Using http
1213 Using http
1214 ----------
1214 ----------
1215
1215
1216 #if b2-pushkey
1216 #if b2-pushkey
1217 $ hg push -B @ http # bundle2+
1217 $ hg push -B @ http # bundle2+
1218 pushing to http://localhost:$HGPORT/
1218 pushing to http://localhost:$HGPORT/
1219 searching for changes
1219 searching for changes
1220 no changes found
1220 no changes found
1221 remote: pushkey-abort: prepushkey hook exited with status 1
1221 remote: pushkey-abort: prepushkey hook exited with status 1
1222 abort: exporting bookmark @ failed!
1222 abort: exporting bookmark @ failed!
1223 [255]
1223 [255]
1224
1224
1225 $ hg -R ../issue4455-dest/ bookmarks
1225 $ hg -R ../issue4455-dest/ bookmarks
1226 no bookmarks set
1226 no bookmarks set
1227
1227
1228 $ hg push -B @ http --config devel.legacy.exchange=bundle1
1228 $ hg push -B @ http --config devel.legacy.exchange=bundle1
1229 pushing to http://localhost:$HGPORT/
1229 pushing to http://localhost:$HGPORT/
1230 searching for changes
1230 searching for changes
1231 no changes found
1231 no changes found
1232 remote: pushkey-abort: prepushkey hook exited with status 1
1232 remote: pushkey-abort: prepushkey hook exited with status 1
1233 exporting bookmark @ failed!
1233 exporting bookmark @ failed!
1234 [1]
1234 [1]
1235
1235
1236 #endif
1236 #endif
1237
1237
1238 #if b2-binary
1238 #if b2-binary
1239
1239
1240 $ hg push -B @ ssh # bundle2+
1240 $ hg push -B @ ssh # bundle2+
1241 pushing to ssh://user@dummy/issue4455-dest
1241 pushing to ssh://user@dummy/issue4455-dest
1242 searching for changes
1242 searching for changes
1243 no changes found
1243 no changes found
1244 remote: prepushkey hook exited with status 1
1244 remote: prepushkey hook exited with status 1
1245 abort: push failed on remote
1245 abort: push failed on remote
1246 [255]
1246 [255]
1247
1247
1248 #endif
1248 #endif
1249
1249
1250 $ hg -R ../issue4455-dest/ bookmarks
1250 $ hg -R ../issue4455-dest/ bookmarks
1251 no bookmarks set
1251 no bookmarks set
1252
1252
1253 $ cd ..
1253 $ cd ..
1254
1254
1255 Test that pre-pushkey compat for bookmark works as expected (issue5777)
1255 Test that pre-pushkey compat for bookmark works as expected (issue5777)
1256
1256
1257 $ cat << EOF >> $HGRCPATH
1257 $ cat << EOF >> $HGRCPATH
1258 > [ui]
1258 > [ui]
1259 > ssh="$PYTHON" "$TESTDIR/dummyssh"
1259 > ssh="$PYTHON" "$TESTDIR/dummyssh"
1260 > [server]
1260 > [server]
1261 > bookmarks-pushkey-compat = yes
1261 > bookmarks-pushkey-compat = yes
1262 > EOF
1262 > EOF
1263
1263
1264 $ hg init server
1264 $ hg init server
1265 $ echo foo > server/a
1265 $ echo foo > server/a
1266 $ hg -R server book foo
1266 $ hg -R server book foo
1267 $ hg -R server commit -Am a
1267 $ hg -R server commit -Am a
1268 adding a
1268 adding a
1269 $ hg clone ssh://user@dummy/server client
1269 $ hg clone ssh://user@dummy/server client
1270 requesting all changes
1270 requesting all changes
1271 adding changesets
1271 adding changesets
1272 adding manifests
1272 adding manifests
1273 adding file changes
1273 adding file changes
1274 added 1 changesets with 1 changes to 1 files
1274 added 1 changesets with 1 changes to 1 files
1275 new changesets 79513d0d7716 (1 drafts)
1275 new changesets 79513d0d7716 (1 drafts)
1276 updating to branch default
1276 updating to branch default
1277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1278
1278
1279 Forbid bookmark move on the server
1279 Forbid bookmark move on the server
1280
1280
1281 $ cat << EOF >> $TESTTMP/no-bm-move.sh
1281 $ cat << EOF >> $TESTTMP/no-bm-move.sh
1282 > #!/bin/sh
1282 > #!/bin/sh
1283 > echo \$HG_NAMESPACE | grep -v bookmarks
1283 > echo \$HG_NAMESPACE | grep -v bookmarks
1284 > EOF
1284 > EOF
1285 $ cat << EOF >> server/.hg/hgrc
1285 $ cat << EOF >> server/.hg/hgrc
1286 > [hooks]
1286 > [hooks]
1287 > prepushkey.no-bm-move= sh $TESTTMP/no-bm-move.sh
1287 > prepushkey.no-bm-move= sh $TESTTMP/no-bm-move.sh
1288 > EOF
1288 > EOF
1289
1289
1290 pushing changeset is okay
1290 pushing changeset is okay
1291
1291
1292 $ echo bar >> client/a
1292 $ echo bar >> client/a
1293 $ hg -R client commit -m b
1293 $ hg -R client commit -m b
1294 $ hg -R client push
1294 $ hg -R client push
1295 pushing to ssh://user@dummy/server
1295 pushing to ssh://user@dummy/server
1296 searching for changes
1296 searching for changes
1297 remote: adding changesets
1297 remote: adding changesets
1298 remote: adding manifests
1298 remote: adding manifests
1299 remote: adding file changes
1299 remote: adding file changes
1300 remote: added 1 changesets with 1 changes to 1 files
1300 remote: added 1 changesets with 1 changes to 1 files
1301
1301
1302 attempt to move the bookmark is rejected
1302 attempt to move the bookmark is rejected
1303
1303
1304 $ hg -R client book foo -r .
1304 $ hg -R client book foo -r .
1305 moving bookmark 'foo' forward from 79513d0d7716
1305 moving bookmark 'foo' forward from 79513d0d7716
1306
1306
1307 #if b2-pushkey
1307 #if b2-pushkey
1308 $ hg -R client push
1308 $ hg -R client push
1309 pushing to ssh://user@dummy/server
1309 pushing to ssh://user@dummy/server
1310 searching for changes
1310 searching for changes
1311 no changes found
1311 no changes found
1312 remote: pushkey-abort: prepushkey.no-bm-move hook exited with status 1
1312 remote: pushkey-abort: prepushkey.no-bm-move hook exited with status 1
1313 abort: updating bookmark foo failed!
1313 abort: updating bookmark foo failed!
1314 [255]
1314 [255]
1315 #endif
1315 #endif
1316 #if b2-binary
1316 #if b2-binary
1317 $ hg -R client push
1317 $ hg -R client push
1318 pushing to ssh://user@dummy/server
1318 pushing to ssh://user@dummy/server
1319 searching for changes
1319 searching for changes
1320 no changes found
1320 no changes found
1321 remote: prepushkey.no-bm-move hook exited with status 1
1321 remote: prepushkey.no-bm-move hook exited with status 1
1322 abort: push failed on remote
1322 abort: push failed on remote
1323 [255]
1323 [255]
1324 #endif
1324 #endif
1325
1326 -- test for pushing bookmarks pointing to secret changesets
1327
1328 Set up a "remote" repo
1329 $ hg init issue6159remote
1330 $ cd issue6159remote
1331 $ echo a > a
1332 $ hg add a
1333 $ hg commit -m_
1334 $ hg bookmark foo
1335 $ cd ..
1336
1337 Clone a local repo
1338 $ hg clone -q issue6159remote issue6159local
1339 $ cd issue6159local
1340 $ hg up -qr foo
1341 $ echo b > b
1342
1343 Move the bookmark "foo" to point at a secret changeset
1344 $ hg commit -qAm_ --config phases.new-commit=secret
1345
1346 Pushing the bookmark "foo" now fails as it contains a secret changeset
1347 #if b2-pushkey
1348 $ hg push -r foo
1349 pushing to $TESTTMP/issue6159remote
1350 searching for changes
1351 no changes found (ignored 1 secret changesets)
1352 abort: updating bookmark foo failed!
1353 [255]
1354 #endif
1355
1356 #if b2-binary
1357 $ hg push -r foo
1358 pushing to $TESTTMP/issue6159remote
1359 searching for changes
1360 no changes found (ignored 1 secret changesets)
1361 updating bookmark foo
1362 [1]
1363 #endif
1364
1365 Now the "remote" repo contains a bookmark pointing to a nonexistent revision
1366 $ cd ../issue6159remote
1367 #if b2-pushkey
1368 $ hg bookmark
1369 * foo 0:1599bc8b897a
1370 $ hg log -r 1599bc8b897a
1371 0:1599bc8b897a _ (no-eol)
1372 #endif
1373
1374 #if b2-binary
1375 $ hg bookmark
1376 no bookmarks set
1377 $ cat .hg/bookmarks
1378 cf489fd8a374cab73c2dc19e899bde6fe3a43f8f foo
1379 $ hg log -r cf489fd8a374
1380 abort: unknown revision 'cf489fd8a374'!
1381 [255]
1382 #endif
General Comments 0
You need to be logged in to leave comments. Login now