##// END OF EJS Templates
pull: merge bookmark updates and imports...
Pierre-Yves David -
r22659:79818570 default
parent child Browse files
Show More
@@ -358,6 +358,7 b' def updatefromremote(ui, repo, remotemar'
358 if ui.configbool('ui', 'quietbookmarkmove', False):
358 if ui.configbool('ui', 'quietbookmarkmove', False):
359 status = warn = ui.debug
359 status = warn = ui.debug
360
360
361 explicit = set(explicit)
361 changed = []
362 changed = []
362 for b, scid, dcid in addsrc:
363 for b, scid, dcid in addsrc:
363 if scid in repo: # add remote bookmarks for changes we already have
364 if scid in repo: # add remote bookmarks for changes we already have
@@ -366,23 +367,30 b' def updatefromremote(ui, repo, remotemar'
366 for b, scid, dcid in advsrc:
367 for b, scid, dcid in advsrc:
367 changed.append((b, bin(scid), status,
368 changed.append((b, bin(scid), status,
368 _("updating bookmark %s\n") % (b)))
369 _("updating bookmark %s\n") % (b)))
370 # remove normal movement from explicit set
371 explicit.difference_update(d[0] for d in changed)
372
369 for b, scid, dcid in diverge:
373 for b, scid, dcid in diverge:
370 db = _diverge(ui, b, path, localmarks)
374 if b in explicit:
371 changed.append((db, bin(scid), warn,
375 explicit.discard(b)
372 _("divergent bookmark %s stored as %s\n") % (b, db)))
376 changed.append((b, bin(scid), status,
377 _("importing bookmark %s\n") % (b, b)))
378 else:
379 db = _diverge(ui, b, path, localmarks)
380 changed.append((db, bin(scid), warn,
381 _("divergent bookmark %s stored as %s\n")
382 % (b, db)))
383 for b, scid, dcid in adddst + advdst:
384 if b in explicit:
385 explicit.discard(b)
386 changed.append((b, bin(scid), status,
387 _("importing bookmark %s\n") % (b, b)))
388
373 if changed:
389 if changed:
374 for b, node, writer, msg in sorted(changed):
390 for b, node, writer, msg in sorted(changed):
375 localmarks[b] = node
391 localmarks[b] = node
376 writer(msg)
392 writer(msg)
377 localmarks.write()
393 localmarks.write()
378 # update specified bookmarks
379 if explicit:
380 marks = repo._bookmarks
381 for b in explicit:
382 # explicit pull overrides local bookmark if any
383 repo.ui.status(_("importing bookmark %s\n") % b)
384 marks[b] = repo[remotemarks[b]].node()
385 marks.write()
386
394
387 def diff(ui, dst, src):
395 def diff(ui, dst, src):
388 ui.status(_("searching for changed bookmarks\n"))
396 ui.status(_("searching for changed bookmarks\n"))
@@ -61,7 +61,6 b' import bookmark by name'
61 $ hg pull -B X ../a
61 $ hg pull -B X ../a
62 pulling from ../a
62 pulling from ../a
63 no changes found
63 no changes found
64 importing bookmark X
65 $ hg bookmark
64 $ hg bookmark
66 X 0:4e3505fd9583
65 X 0:4e3505fd9583
67 * Y 0:4e3505fd9583
66 * Y 0:4e3505fd9583
@@ -373,7 +372,6 b' hgweb'
373 adding remote bookmark Z
372 adding remote bookmark Z
374 adding remote bookmark foo
373 adding remote bookmark foo
375 adding remote bookmark foobar
374 adding remote bookmark foobar
376 importing bookmark Z
377 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
375 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
378 requesting all changes
376 requesting all changes
379 adding changesets
377 adding changesets
@@ -906,7 +906,6 b' pull over ssh'
906 added 1 changesets with 1 changes to 1 files (+1 heads)
906 added 1 changesets with 1 changes to 1 files (+1 heads)
907 1 new obsolescence markers
907 1 new obsolescence markers
908 updating bookmark book_02de
908 updating bookmark book_02de
909 importing bookmark book_02de
910 (run 'hg heads' to see heads, 'hg merge' to merge)
909 (run 'hg heads' to see heads, 'hg merge' to merge)
911 $ hg -R other debugobsolete
910 $ hg -R other debugobsolete
912 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
911 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
@@ -928,7 +927,6 b' pull over http'
928 added 1 changesets with 1 changes to 1 files (+1 heads)
927 added 1 changesets with 1 changes to 1 files (+1 heads)
929 1 new obsolescence markers
928 1 new obsolescence markers
930 updating bookmark book_42cc
929 updating bookmark book_42cc
931 importing bookmark book_42cc
932 (run 'hg heads .' to see heads, 'hg merge' to merge)
930 (run 'hg heads .' to see heads, 'hg merge' to merge)
933 $ cat main-error.log
931 $ cat main-error.log
934 $ hg -R other debugobsolete
932 $ hg -R other debugobsolete
@@ -200,7 +200,6 b' listkeys hook'
200 no changes found
200 no changes found
201 listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
201 listkeys hook: HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
202 adding remote bookmark bar
202 adding remote bookmark bar
203 importing bookmark bar
204 $ cd ../a
203 $ cd ../a
205
204
206 test that prepushkey can prevent incoming keys
205 test that prepushkey can prevent incoming keys
@@ -197,7 +197,6 b' test pushkeys and bookmarks'
197 pulling from ssh://user@dummy/remote
197 pulling from ssh://user@dummy/remote
198 no changes found
198 no changes found
199 updating bookmark foo
199 updating bookmark foo
200 importing bookmark foo
201 $ hg book -d foo
200 $ hg book -d foo
202 $ hg push -B foo
201 $ hg push -B foo
203 pushing to ssh://user@dummy/remote
202 pushing to ssh://user@dummy/remote
General Comments 0
You need to be logged in to leave comments. Login now