##// END OF EJS Templates
test-bookmarks-pushpull.t: verify correct push -B behavior...
Augie Fackler -
r17189:7199e82d default
parent child Browse files
Show More
@@ -1,266 +1,300 b''
1 $ "$TESTDIR/hghave" serve || exit 80
1 $ "$TESTDIR/hghave" serve || exit 80
2
2
3 initialize
3 initialize
4
4
5 $ hg init a
5 $ hg init a
6 $ cd a
6 $ cd a
7 $ echo 'test' > test
7 $ echo 'test' > test
8 $ hg commit -Am'test'
8 $ hg commit -Am'test'
9 adding test
9 adding test
10
10
11 set bookmarks
11 set bookmarks
12
12
13 $ hg bookmark X
13 $ hg bookmark X
14 $ hg bookmark Y
14 $ hg bookmark Y
15 $ hg bookmark Z
15 $ hg bookmark Z
16
16
17 import bookmark by name
17 import bookmark by name
18
18
19 $ hg init ../b
19 $ hg init ../b
20 $ cd ../b
20 $ cd ../b
21 $ hg book Y
21 $ hg book Y
22 $ hg book
22 $ hg book
23 * Y -1:000000000000
23 * Y -1:000000000000
24 $ hg pull ../a
24 $ hg pull ../a
25 pulling from ../a
25 pulling from ../a
26 requesting all changes
26 requesting all changes
27 adding changesets
27 adding changesets
28 adding manifests
28 adding manifests
29 adding file changes
29 adding file changes
30 added 1 changesets with 1 changes to 1 files
30 added 1 changesets with 1 changes to 1 files
31 updating bookmark Y
31 updating bookmark Y
32 adding remote bookmark X
32 adding remote bookmark X
33 adding remote bookmark Z
33 adding remote bookmark Z
34 (run 'hg update' to get a working copy)
34 (run 'hg update' to get a working copy)
35 $ hg bookmarks
35 $ hg bookmarks
36 X 0:4e3505fd9583
36 X 0:4e3505fd9583
37 Y 0:4e3505fd9583
37 Y 0:4e3505fd9583
38 Z 0:4e3505fd9583
38 Z 0:4e3505fd9583
39 $ hg debugpushkey ../a namespaces
39 $ hg debugpushkey ../a namespaces
40 bookmarks
40 bookmarks
41 phases
41 phases
42 namespaces
42 namespaces
43 obsolete
43 obsolete
44 $ hg debugpushkey ../a bookmarks
44 $ hg debugpushkey ../a bookmarks
45 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
45 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
46 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
46 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
47 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
47 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
48 $ hg pull -B X ../a
48 $ hg pull -B X ../a
49 pulling from ../a
49 pulling from ../a
50 no changes found
50 no changes found
51 importing bookmark X
51 importing bookmark X
52 $ hg bookmark
52 $ hg bookmark
53 X 0:4e3505fd9583
53 X 0:4e3505fd9583
54 Y 0:4e3505fd9583
54 Y 0:4e3505fd9583
55 Z 0:4e3505fd9583
55 Z 0:4e3505fd9583
56
56
57 export bookmark by name
57 export bookmark by name
58
58
59 $ hg bookmark W
59 $ hg bookmark W
60 $ hg bookmark foo
60 $ hg bookmark foo
61 $ hg bookmark foobar
61 $ hg bookmark foobar
62 $ hg push -B W ../a
62 $ hg push -B W ../a
63 pushing to ../a
63 pushing to ../a
64 searching for changes
64 searching for changes
65 no changes found
65 no changes found
66 exporting bookmark W
66 exporting bookmark W
67 [1]
67 [1]
68 $ hg -R ../a bookmarks
68 $ hg -R ../a bookmarks
69 W -1:000000000000
69 W -1:000000000000
70 X 0:4e3505fd9583
70 X 0:4e3505fd9583
71 Y 0:4e3505fd9583
71 Y 0:4e3505fd9583
72 * Z 0:4e3505fd9583
72 * Z 0:4e3505fd9583
73
73
74 delete a remote bookmark
74 delete a remote bookmark
75
75
76 $ hg book -d W
76 $ hg book -d W
77 $ hg push -B W ../a
77 $ hg push -B W ../a
78 pushing to ../a
78 pushing to ../a
79 searching for changes
79 searching for changes
80 no changes found
80 no changes found
81 deleting remote bookmark W
81 deleting remote bookmark W
82 [1]
82 [1]
83
83
84 push/pull name that doesn't exist
84 push/pull name that doesn't exist
85
85
86 $ hg push -B badname ../a
86 $ hg push -B badname ../a
87 pushing to ../a
87 pushing to ../a
88 searching for changes
88 searching for changes
89 no changes found
89 no changes found
90 bookmark badname does not exist on the local or remote repository!
90 bookmark badname does not exist on the local or remote repository!
91 [2]
91 [2]
92 $ hg pull -B anotherbadname ../a
92 $ hg pull -B anotherbadname ../a
93 pulling from ../a
93 pulling from ../a
94 abort: remote bookmark anotherbadname not found!
94 abort: remote bookmark anotherbadname not found!
95 [255]
95 [255]
96
96
97 divergent bookmarks
97 divergent bookmarks
98
98
99 $ cd ../a
99 $ cd ../a
100 $ echo c1 > f1
100 $ echo c1 > f1
101 $ hg ci -Am1
101 $ hg ci -Am1
102 adding f1
102 adding f1
103 $ hg book -f X
103 $ hg book -f X
104 $ hg book
104 $ hg book
105 * X 1:0d2164f0ce0d
105 * X 1:0d2164f0ce0d
106 Y 0:4e3505fd9583
106 Y 0:4e3505fd9583
107 Z 1:0d2164f0ce0d
107 Z 1:0d2164f0ce0d
108
108
109 $ cd ../b
109 $ cd ../b
110 $ hg up
110 $ hg up
111 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
112 updating bookmark foobar
112 updating bookmark foobar
113 $ echo c2 > f2
113 $ echo c2 > f2
114 $ hg ci -Am2
114 $ hg ci -Am2
115 adding f2
115 adding f2
116 $ hg book -f X
116 $ hg book -f X
117 $ hg book
117 $ hg book
118 * X 1:9b140be10808
118 * X 1:9b140be10808
119 Y 0:4e3505fd9583
119 Y 0:4e3505fd9583
120 Z 0:4e3505fd9583
120 Z 0:4e3505fd9583
121 foo -1:000000000000
121 foo -1:000000000000
122 foobar 1:9b140be10808
122 foobar 1:9b140be10808
123
123
124 $ hg pull --config paths.foo=../a foo
124 $ hg pull --config paths.foo=../a foo
125 pulling from $TESTTMP/a (glob)
125 pulling from $TESTTMP/a (glob)
126 searching for changes
126 searching for changes
127 adding changesets
127 adding changesets
128 adding manifests
128 adding manifests
129 adding file changes
129 adding file changes
130 added 1 changesets with 1 changes to 1 files (+1 heads)
130 added 1 changesets with 1 changes to 1 files (+1 heads)
131 divergent bookmark X stored as X@foo
131 divergent bookmark X stored as X@foo
132 updating bookmark Z
132 updating bookmark Z
133 (run 'hg heads' to see heads, 'hg merge' to merge)
133 (run 'hg heads' to see heads, 'hg merge' to merge)
134 $ hg book
134 $ hg book
135 * X 1:9b140be10808
135 * X 1:9b140be10808
136 X@foo 2:0d2164f0ce0d
136 X@foo 2:0d2164f0ce0d
137 Y 0:4e3505fd9583
137 Y 0:4e3505fd9583
138 Z 2:0d2164f0ce0d
138 Z 2:0d2164f0ce0d
139 foo -1:000000000000
139 foo -1:000000000000
140 foobar 1:9b140be10808
140 foobar 1:9b140be10808
141 $ hg push -f ../a
141 $ hg push -f ../a
142 pushing to ../a
142 pushing to ../a
143 searching for changes
143 searching for changes
144 adding changesets
144 adding changesets
145 adding manifests
145 adding manifests
146 adding file changes
146 adding file changes
147 added 1 changesets with 1 changes to 1 files (+1 heads)
147 added 1 changesets with 1 changes to 1 files (+1 heads)
148 $ hg -R ../a book
148 $ hg -R ../a book
149 * X 1:0d2164f0ce0d
149 * X 1:0d2164f0ce0d
150 Y 0:4e3505fd9583
150 Y 0:4e3505fd9583
151 Z 1:0d2164f0ce0d
151 Z 1:0d2164f0ce0d
152
152
153 update a remote bookmark from a non-head to a head
153 update a remote bookmark from a non-head to a head
154
154
155 $ hg up -q Y
155 $ hg up -q Y
156 $ echo c3 > f2
156 $ echo c3 > f2
157 $ hg ci -Am3
157 $ hg ci -Am3
158 adding f2
158 adding f2
159 created new head
159 created new head
160 $ hg push ../a
160 $ hg push ../a
161 pushing to ../a
161 pushing to ../a
162 searching for changes
162 searching for changes
163 adding changesets
163 adding changesets
164 adding manifests
164 adding manifests
165 adding file changes
165 adding file changes
166 added 1 changesets with 1 changes to 1 files (+1 heads)
166 added 1 changesets with 1 changes to 1 files (+1 heads)
167 updating bookmark Y
167 updating bookmark Y
168 $ hg -R ../a book
168 $ hg -R ../a book
169 * X 1:0d2164f0ce0d
169 * X 1:0d2164f0ce0d
170 Y 3:f6fc62dde3c0
170 Y 3:f6fc62dde3c0
171 Z 1:0d2164f0ce0d
171 Z 1:0d2164f0ce0d
172
172
173 diverging a remote bookmark fails
173 diverging a remote bookmark fails
174
174
175 $ hg up -q 4e3505fd9583
175 $ hg up -q 4e3505fd9583
176 $ echo c4 > f2
176 $ echo c4 > f2
177 $ hg ci -Am4
177 $ hg ci -Am4
178 adding f2
178 adding f2
179 created new head
179 created new head
180 $ hg book -f Y
180 $ hg book -f Y
181
181
182 $ cat <<EOF > ../a/.hg/hgrc
182 $ cat <<EOF > ../a/.hg/hgrc
183 > [web]
183 > [web]
184 > push_ssl = false
184 > push_ssl = false
185 > allow_push = *
185 > allow_push = *
186 > EOF
186 > EOF
187
187
188 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
188 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
189 $ cat ../hg2.pid >> $DAEMON_PIDS
189 $ cat ../hg2.pid >> $DAEMON_PIDS
190
190
191 $ hg push http://localhost:$HGPORT2/
191 $ hg push http://localhost:$HGPORT2/
192 pushing to http://localhost:$HGPORT2/
192 pushing to http://localhost:$HGPORT2/
193 searching for changes
193 searching for changes
194 abort: push creates new remote head 4efff6d98829!
194 abort: push creates new remote head 4efff6d98829!
195 (did you forget to merge? use push -f to force)
195 (did you forget to merge? use push -f to force)
196 [255]
196 [255]
197 $ hg -R ../a book
197 $ hg -R ../a book
198 * X 1:0d2164f0ce0d
198 * X 1:0d2164f0ce0d
199 Y 3:f6fc62dde3c0
199 Y 3:f6fc62dde3c0
200 Z 1:0d2164f0ce0d
200 Z 1:0d2164f0ce0d
201
201
202 hgweb
202 hgweb
203
203
204 $ cat <<EOF > .hg/hgrc
204 $ cat <<EOF > .hg/hgrc
205 > [web]
205 > [web]
206 > push_ssl = false
206 > push_ssl = false
207 > allow_push = *
207 > allow_push = *
208 > EOF
208 > EOF
209
209
210 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
210 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
211 $ cat ../hg.pid >> $DAEMON_PIDS
211 $ cat ../hg.pid >> $DAEMON_PIDS
212 $ cd ../a
212 $ cd ../a
213
213
214 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
214 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
215 bookmarks
215 bookmarks
216 phases
216 phases
217 namespaces
217 namespaces
218 obsolete
218 obsolete
219 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
219 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
220 Y 4efff6d98829d9c824c621afd6e3f01865f5439f
220 Y 4efff6d98829d9c824c621afd6e3f01865f5439f
221 foobar 9b140be1080824d768c5a4691a564088eede71f9
221 foobar 9b140be1080824d768c5a4691a564088eede71f9
222 Z 0d2164f0ce0d8f1d6f94351eba04b794909be66c
222 Z 0d2164f0ce0d8f1d6f94351eba04b794909be66c
223 foo 0000000000000000000000000000000000000000
223 foo 0000000000000000000000000000000000000000
224 X 9b140be1080824d768c5a4691a564088eede71f9
224 X 9b140be1080824d768c5a4691a564088eede71f9
225 $ hg out -B http://localhost:$HGPORT/
225 $ hg out -B http://localhost:$HGPORT/
226 comparing with http://localhost:$HGPORT/
226 comparing with http://localhost:$HGPORT/
227 searching for changed bookmarks
227 searching for changed bookmarks
228 no changed bookmarks found
228 no changed bookmarks found
229 [1]
229 [1]
230 $ hg push -B Z http://localhost:$HGPORT/
230 $ hg push -B Z http://localhost:$HGPORT/
231 pushing to http://localhost:$HGPORT/
231 pushing to http://localhost:$HGPORT/
232 searching for changes
232 searching for changes
233 no changes found
233 no changes found
234 exporting bookmark Z
234 exporting bookmark Z
235 [1]
235 [1]
236 $ hg book -d Z
236 $ hg book -d Z
237 $ hg in -B http://localhost:$HGPORT/
237 $ hg in -B http://localhost:$HGPORT/
238 comparing with http://localhost:$HGPORT/
238 comparing with http://localhost:$HGPORT/
239 searching for changed bookmarks
239 searching for changed bookmarks
240 Z 0d2164f0ce0d
240 Z 0d2164f0ce0d
241 foo 000000000000
241 foo 000000000000
242 foobar 9b140be10808
242 foobar 9b140be10808
243 $ hg pull -B Z http://localhost:$HGPORT/
243 $ hg pull -B Z http://localhost:$HGPORT/
244 pulling from http://localhost:$HGPORT/
244 pulling from http://localhost:$HGPORT/
245 no changes found
245 no changes found
246 adding remote bookmark foobar
246 adding remote bookmark foobar
247 adding remote bookmark Z
247 adding remote bookmark Z
248 adding remote bookmark foo
248 adding remote bookmark foo
249 divergent bookmark X stored as X@1
249 divergent bookmark X stored as X@1
250 importing bookmark Z
250 importing bookmark Z
251 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
251 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
252 requesting all changes
252 requesting all changes
253 adding changesets
253 adding changesets
254 adding manifests
254 adding manifests
255 adding file changes
255 adding file changes
256 added 5 changesets with 5 changes to 3 files (+3 heads)
256 added 5 changesets with 5 changes to 3 files (+3 heads)
257 updating to branch default
257 updating to branch default
258 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 $ hg -R cloned-bookmarks bookmarks
259 $ hg -R cloned-bookmarks bookmarks
260 X 1:9b140be10808
260 X 1:9b140be10808
261 Y 4:4efff6d98829
261 Y 4:4efff6d98829
262 Z 2:0d2164f0ce0d
262 Z 2:0d2164f0ce0d
263 foo -1:000000000000
263 foo -1:000000000000
264 foobar 1:9b140be10808
264 foobar 1:9b140be10808
265
266 $ cd ..
267
268 Pushing a bookmark should only push the changes required by that
269 bookmark, not all outgoing changes:
270 $ hg clone http://localhost:$HGPORT/ addmarks
271 requesting all changes
272 adding changesets
273 adding manifests
274 adding file changes
275 added 5 changesets with 5 changes to 3 files (+3 heads)
276 updating to branch default
277 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
278 $ cd addmarks
279 $ echo foo > foo
280 $ hg add foo
281 $ hg commit -m 'add foo'
282 $ echo bar > bar
283 $ hg add bar
284 $ hg commit -m 'add bar'
285 $ hg co "tip^"
286 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
287 $ hg book add-foo
288 $ hg book -r tip add-bar
289 Note: this push *must* push only a single changeset, as that's the point
290 of this test.
291 $ hg push -B add-foo
292 pushing to http://localhost:$HGPORT/
293 searching for changes
294 remote: adding changesets
295 remote: adding manifests
296 remote: adding file changes
297 remote: added 1 changesets with 1 changes to 1 files
298 exporting bookmark add-foo
265
299
266 $ cd ..
300 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now