comparison mercurial/bookmarks.py @ 33485:505021482541

bookmark: use 'applychanges' when updating a bookmark through pushkey
author Boris Feld <boris.feld@octobus.net>
date Mon, 10 Jul 2017 17:24:28 +0200
parents 2a8ce4e79a47
children 1adcb594eb6b
comparison
equal deleted inserted replaced
33484:2a8ce4e79a47 33485:505021482541
400 marks = repo._bookmarks 400 marks = repo._bookmarks
401 existing = hex(marks.get(key, '')) 401 existing = hex(marks.get(key, ''))
402 if existing != old and existing != new: 402 if existing != old and existing != new:
403 return False 403 return False
404 if new == '': 404 if new == '':
405 del marks[key] 405 changes = [(key, None)]
406 else: 406 else:
407 if new not in repo: 407 if new not in repo:
408 return False 408 return False
409 marks[key] = repo[new].node() 409 changes = [(key, repo[new].node())]
410 marks.recordchange(tr) 410 marks.applychanges(repo, tr, changes)
411 tr.close() 411 tr.close()
412 return True 412 return True
413 finally: 413 finally:
414 lockmod.release(tr, l, w) 414 lockmod.release(tr, l, w)
415 415