diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py index 6f2eee68f6a5c98cd09f902eea83cc60691afac3_bWVyY3VyaWFsL2Jvb2ttYXJrcy5weQ==..2fad18f1540916bfa7be46b7122b3d19e04a09e7_bWVyY3VyaWFsL2Jvb2ttYXJrcy5weQ== 100644 --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -155,7 +155,9 @@ d = {} for k, v in marks.iteritems(): - d[k] = hex(v) + # don't expose local divergent bookmarks + if '@' not in k and not k.endswith('@'): + d[k] = hex(v) return d def pushbookmark(repo, key, old, new): @@ -192,8 +194,14 @@ changed = True ui.status(_("updating bookmark %s\n") % k) else: - ui.warn(_("not updating divergent" - " bookmark %s\n") % k) + for x in range(1, 100): + n = '%s@%d' % (k, x) + if n not in repo._bookmarks: + break + repo._bookmarks[n] = cr.node() + changed = True + ui.warn(_("divergent bookmark %s stored as %s\n") % (k, n)) + if changed: write(repo) diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t index 6f2eee68f6a5c98cd09f902eea83cc60691afac3_dGVzdHMvdGVzdC1ib29rbWFya3MtcHVzaHB1bGwudA==..2fad18f1540916bfa7be46b7122b3d19e04a09e7_dGVzdHMvdGVzdC1ib29rbWFya3MtcHVzaHB1bGwudA== 100644 --- a/tests/test-bookmarks-pushpull.t +++ b/tests/test-bookmarks-pushpull.t @@ -117,7 +117,7 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files (+1 heads) - not updating divergent bookmark X + divergent bookmark X stored as X@1 (run 'hg heads' to see heads, 'hg merge' to merge) $ hg book * X 1:9b140be10808 @@ -121,6 +121,7 @@ (run 'hg heads' to see heads, 'hg merge' to merge) $ hg book * X 1:9b140be10808 + X@1 2:0d2164f0ce0d Y 0:4e3505fd9583 foo -1:000000000000 foobar -1:000000000000 @@ -175,7 +176,7 @@ $ hg pull -B Z http://localhost:$HGPORT/ pulling from http://localhost:$HGPORT/ no changes found - not updating divergent bookmark X + divergent bookmark X stored as X@1 importing bookmark Z $ hg clone http://localhost:$HGPORT/ cloned-bookmarks requesting all changes