# HG changeset patch # User Boris Feld # Date 1546402023 -3600 # Node ID f04e0ca0409964ec10d35f69e2a1a22208fb4272 # Parent 399010051cf4e83ea3c0ebeab95af2ddbe291c7b strip: compute bookmark target only if we have bookmark to move This is a small change that seems to make sense. diff -r 399010051cf4 -r f04e0ca04099 mercurial/repair.py --- a/mercurial/repair.py Wed Jan 02 05:01:15 2019 +0100 +++ b/mercurial/repair.py Wed Jan 02 05:07:03 2019 +0100 @@ -153,20 +153,22 @@ stripobsidx = [i for i, m in enumerate(repo.obsstore) if m in obsmarkers] - # For a set s, max(parents(s) - s) is the same as max(heads(::s - s)), but - # is much faster - newbmtarget = repo.revs('max(parents(%ld) - (%ld))', tostrip, tostrip) - if newbmtarget: - newbmtarget = repo[newbmtarget.first()].node() - else: - newbmtarget = '.' - + # compute necessary bookmark movement bm = repo._bookmarks updatebm = [] for m in bm: rev = repo[bm[m]].rev() if rev in tostrip: updatebm.append(m) + newbmtarget = None + if updatebm: # don't compute anything is there is no bookmark to move anyway + # For a set s, max(parents(s) - s) is the same as max(heads(::s - s)), + # but is much faster + newbmtarget = repo.revs('max(parents(%ld) - (%ld))', tostrip, tostrip) + if newbmtarget: + newbmtarget = repo[newbmtarget.first()].node() + else: + newbmtarget = '.' backupfile = None node = nodelist[-1]