comparison tests/test-bookmarks-pushpull.t @ 17551:a7b3fdaf768d

bookmark: take successors into account when updating (issue3561) When we rewrite a bookmarked changeset, we want to update the bookmark on its successors. But the successors are not descendants of its precursor (by definition). This changeset alters the bookmarks logic to update bookmark location if the newer location is a successor of the old one[1]. note: valid destinations are in fact any kind of successors of any kind of descendants (recursively.) This changeset requires the enabling of the obsolete feature in some bookmark tests.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Sun, 26 Aug 2012 01:28:22 +0200
parents eaa5fcc5bd20
children 6c81b8ebf66e
comparison
equal deleted inserted replaced
17550:fc530080013b 17551:a7b3fdaf768d
1 $ "$TESTDIR/hghave" serve || exit 80 1 $ "$TESTDIR/hghave" serve || exit 80
2
3 $ cat << EOF >> $HGRCPATH
4 > [phases]
5 > publish=False
6 > [extensions]
7 > EOF
8 $ cat > obs.py << EOF
9 > import mercurial.obsolete
10 > mercurial.obsolete._enabled = True
11 > EOF
12 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
2 13
3 initialize 14 initialize
4 15
5 $ hg init a 16 $ hg init a
6 $ cd a 17 $ cd a
38 Z 0:4e3505fd9583 49 Z 0:4e3505fd9583
39 $ hg debugpushkey ../a namespaces 50 $ hg debugpushkey ../a namespaces
40 bookmarks 51 bookmarks
41 phases 52 phases
42 namespaces 53 namespaces
54 obsolete
43 $ hg debugpushkey ../a bookmarks 55 $ hg debugpushkey ../a bookmarks
44 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77 56 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
45 X 4e3505fd95835d721066b76e75dbb8cc554d7f77 57 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
46 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77 58 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
47 $ hg pull -B X ../a 59 $ hg pull -B X ../a
196 $ hg -R ../a book 208 $ hg -R ../a book
197 * X 1:0d2164f0ce0d 209 * X 1:0d2164f0ce0d
198 Y 3:f6fc62dde3c0 210 Y 3:f6fc62dde3c0
199 Z 1:0d2164f0ce0d 211 Z 1:0d2164f0ce0d
200 212
213
214 Unrelated marker does not alter the decision
215
216 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
217 $ hg push http://localhost:$HGPORT2/
218 pushing to http://localhost:$HGPORT2/
219 searching for changes
220 abort: push creates new remote head 4efff6d98829!
221 (did you forget to merge? use push -f to force)
222 [255]
223 $ hg -R ../a book
224 * X 1:0d2164f0ce0d
225 Y 3:f6fc62dde3c0
226 Z 1:0d2164f0ce0d
227
228 Update to a successor works
229
230 $ hg id --debug -r 3
231 f6fc62dde3c0771e29704af56ba4d8af77abcc2f
232 $ hg id --debug -r 4
233 4efff6d98829d9c824c621afd6e3f01865f5439f tip Y
234 $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f 4efff6d98829d9c824c621afd6e3f01865f5439f
235 $ hg push http://localhost:$HGPORT2/
236 pushing to http://localhost:$HGPORT2/
237 searching for changes
238 remote: adding changesets
239 remote: adding manifests
240 remote: adding file changes
241 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
242 updating bookmark Y
243 $ hg -R ../a book
244 * X 1:0d2164f0ce0d
245 Y 4:4efff6d98829
246 Z 1:0d2164f0ce0d
247
201 hgweb 248 hgweb
202 249
203 $ cat <<EOF > .hg/hgrc 250 $ cat <<EOF > .hg/hgrc
204 > [web] 251 > [web]
205 > push_ssl = false 252 > push_ssl = false
212 259
213 $ hg debugpushkey http://localhost:$HGPORT/ namespaces 260 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
214 bookmarks 261 bookmarks
215 phases 262 phases
216 namespaces 263 namespaces
264 obsolete
217 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks 265 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
218 Y 4efff6d98829d9c824c621afd6e3f01865f5439f 266 Y 4efff6d98829d9c824c621afd6e3f01865f5439f
219 foobar 9b140be1080824d768c5a4691a564088eede71f9 267 foobar 9b140be1080824d768c5a4691a564088eede71f9
220 Z 0d2164f0ce0d8f1d6f94351eba04b794909be66c 268 Z 0d2164f0ce0d8f1d6f94351eba04b794909be66c
221 foo 0000000000000000000000000000000000000000 269 foo 0000000000000000000000000000000000000000
249 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks 297 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
250 requesting all changes 298 requesting all changes
251 adding changesets 299 adding changesets
252 adding manifests 300 adding manifests
253 adding file changes 301 adding file changes
254 added 5 changesets with 5 changes to 3 files (+3 heads) 302 added 4 changesets with 4 changes to 3 files (+2 heads)
255 updating to branch default 303 updating to branch default
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 304 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 $ hg -R cloned-bookmarks bookmarks 305 $ hg -R cloned-bookmarks bookmarks
258 X 1:9b140be10808 306 X 1:9b140be10808
259 Y 4:4efff6d98829 307 Y 3:4efff6d98829
260 Z 2:0d2164f0ce0d 308 Z 2:0d2164f0ce0d
261 foo -1:000000000000 309 foo -1:000000000000
262 foobar 1:9b140be10808 310 foobar 1:9b140be10808
263 311
264 $ cd .. 312 $ cd ..
268 $ hg clone http://localhost:$HGPORT/ addmarks 316 $ hg clone http://localhost:$HGPORT/ addmarks
269 requesting all changes 317 requesting all changes
270 adding changesets 318 adding changesets
271 adding manifests 319 adding manifests
272 adding file changes 320 adding file changes
273 added 5 changesets with 5 changes to 3 files (+3 heads) 321 added 4 changesets with 4 changes to 3 files (+2 heads)
274 updating to branch default 322 updating to branch default
275 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 323 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 $ cd addmarks 324 $ cd addmarks
277 $ echo foo > foo 325 $ echo foo > foo
278 $ hg add foo 326 $ hg add foo