Mercurial > hg
changeset 33511:9689239d7c2b
bookmark: use 'divergent2delete' in 'scmutil.cleanupnode'
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 10 Jul 2017 19:10:13 +0200 |
parents | 07b556d1b74e |
children | 1424a769f31b |
files | mercurial/scmutil.py |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/scmutil.py Mon Jul 10 19:08:17 2017 +0200 +++ b/mercurial/scmutil.py Mon Jul 10 19:10:13 2017 +0200 @@ -591,14 +591,13 @@ with repo.transaction('cleanup') as tr: # Move bookmarks bmarks = repo._bookmarks - bmarkchanged = False + bmarkchanges = [] allnewnodes = [n for ns in mapping.values() for n in ns] for oldnode, newnodes in mapping.items(): oldbmarks = repo.nodebookmarks(oldnode) if not oldbmarks: continue from . import bookmarks # avoid import cycle - bmarkchanged = True if len(newnodes) > 1: # usually a split, take the one with biggest rev number newnode = next(repo.set('max(%ln)', newnodes)).node() @@ -619,10 +618,12 @@ allnewnodes, newnode, oldnode) deletenodes = _containsnode(repo, deleterevs) for name in oldbmarks: - bmarks[name] = newnode - bookmarks.deletedivergent(repo, deletenodes, name) - if bmarkchanged: - bmarks.recordchange(tr) + bmarkchanges.append((name, newnode)) + for b in bookmarks.divergent2delete(repo, deletenodes, name): + bmarkchanges.append((b, None)) + + if bmarkchanges: + bmarks.applychanges(repo, tr, bmarkchanges) # Obsolete or strip nodes if obsolete.isenabled(repo, obsolete.createmarkersopt):