Comments
Patch
@@ -325,7 +325,7 @@
return results
-def _diverge(ui, b, path, localmarks):
+def _diverge(ui, b, path, localmarks, remotenode):
if b == '@':
b = ''
# try to use an @pathalias suffix
@@ -336,7 +336,7 @@
# find a unique @ suffix
for x in range(1, 100):
n = '%s@%d' % (b, x)
- if n not in localmarks:
+ if n not in localmarks or localmarks[n] == remotenode:
return n
return None
@@ -355,9 +355,10 @@
changed.append((b, bin(scid), ui.status,
_("updating bookmark %s\n") % (b)))
for b, scid, dcid in diverge:
- db = _diverge(ui, b, path, localmarks)
+ snode = bin(scid)
+ db = _diverge(ui, b, path, localmarks, snode)
if db:
- changed.append((db, bin(scid), ui.warn,
+ changed.append((db, snode, ui.warn,
_("divergent bookmark %s stored as %s\n") %
(b, db)))
else:
@@ -173,6 +173,20 @@
$ hg bookmarks | grep '^ X' | grep -v ':000000000000'
X 1:9b140be10808
X@foo 2:0d2164f0ce0d
+ $ hg bookmarks | grep '^ @'
+ @ 1:9b140be10808
+ @1 2:0d2164f0ce0d
+ @foo 2:0d2164f0ce0d
+ $ hg pull ../a
+ pulling from ../a
+ searching for changes
+ no changes found
+ warning: fail to assign new divergent bookmark to X
+ divergent bookmark @ stored as @1
+ $ hg bookmarks | grep '^ @'
+ @ 1:9b140be10808
+ @1 2:0d2164f0ce0d
+ @foo 2:0d2164f0ce0d
$ python $TESTTMP/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done
$ hg bookmarks -d "@1"
$ hg push -f ../a