# HG changeset patch # User Durham Goode # Date 1409054321 25200 # Node ID 5c153c69fdb28ff5b1bf6578e5f07c50bf25833c # Parent 9510b0e9480b816983dd0faedfb955bb1160b483 bookmarks: allow pushkey if new equals current Previously a bookmark pushkey would be rejected if the specified 'old' value didn't match the servers 'current' value. This change allows this situation, as long as the 'current' server value equals the 'new' pushkey value already. We are trying to write a hook that forces a server bookmark to move forward, using a changegroup hook. If the user also pushed the bookmark, they would get an error, since they computed their pushkey (old,new) pair before the server moved the bookmark. Long term, bundle2 will let us do this more smartly, but this change seems reasonable for now. diff -r 9510b0e9480b -r 5c153c69fdb2 mercurial/bookmarks.py --- a/mercurial/bookmarks.py Fri Aug 29 12:17:53 2014 +0200 +++ b/mercurial/bookmarks.py Tue Aug 26 04:58:41 2014 -0700 @@ -228,7 +228,8 @@ w = repo.wlock() try: marks = repo._bookmarks - if hex(marks.get(key, '')) != old: + existing = hex(marks.get(key, '')) + if existing != old and existing != new: return False if new == '': del marks[key]