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