Mercurial > hg-stable
changeset 21843:92666a869ea4 stable
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.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 08 Jul 2014 14:45:55 -0500 |
parents | fd2527d9b995 |
children | 3b97a93dc137 1eda3e556845 |
files | mercurial/bookmarks.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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]