bookmarks: avoid deleting primary bookmarks on rebase
Prior to this, doing "hg rebase -s @foo -d @" would delete @, which is
obviously wrong: a primary bookmark should never be automatically deleted.
This change blocks the deletion, but doesn't yet properly clean up the
divergence: @ should replace @foo.
--- a/mercurial/bookmarks.py Thu Jul 03 10:56:03 2014 +0100
+++ b/mercurial/bookmarks.py Tue Jul 08 14:45:55 2014 -0500
@@ -164,6 +164,9 @@
marks = repo._bookmarks
divergent = [b for b in marks if b.split('@', 1)[0] == bm.split('@', 1)[0]]
for mark in divergent:
+ if mark == '@' or '@' not in mark:
+ # can't be divergent by definition
+ continue
if mark and marks[mark] in deletefrom:
if mark != bm:
del marks[mark]