mercurial/bookmarks.py
changeset 22364 5c153c69fdb2
parent 21843 92666a869ea4
child 22627 808df84fba83
equal deleted inserted replaced
22363:9510b0e9480b 22364:5c153c69fdb2
   226 
   226 
   227 def pushbookmark(repo, key, old, new):
   227 def pushbookmark(repo, key, old, new):
   228     w = repo.wlock()
   228     w = repo.wlock()
   229     try:
   229     try:
   230         marks = repo._bookmarks
   230         marks = repo._bookmarks
   231         if hex(marks.get(key, '')) != old:
   231         existing = hex(marks.get(key, ''))
       
   232         if existing != old and existing != new:
   232             return False
   233             return False
   233         if new == '':
   234         if new == '':
   234             del marks[key]
   235             del marks[key]
   235         else:
   236         else:
   236             if new not in repo:
   237             if new not in repo: