Mercurial > hg
comparison mercurial/repair.py @ 46514:beaa233e81f7
softstrip: move _bookmarkmovements() call to where it's needed
The call to `_bookmarkmovements()` is unrelated to the backup, so
let's move it after.
Differential Revision: https://phab.mercurial-scm.org/D9984
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 10 Feb 2021 09:45:48 -0800 |
parents | ec73a6a75985 |
children | cd9154343160 |
comparison
equal
deleted
inserted
replaced
46513:c3c7a86e9c24 | 46514:beaa233e81f7 |
---|---|
306 """perform a "soft" strip using the archived phase""" | 306 """perform a "soft" strip using the archived phase""" |
307 tostrip = [c.node() for c in repo.set(b'sort(%ln::)', nodelist)] | 307 tostrip = [c.node() for c in repo.set(b'sort(%ln::)', nodelist)] |
308 if not tostrip: | 308 if not tostrip: |
309 return None | 309 return None |
310 | 310 |
311 newbmtarget, updatebm = _bookmarkmovements(repo, tostrip) | |
312 if backup: | 311 if backup: |
313 node = tostrip[0] | 312 node = tostrip[0] |
314 backupfile = _createstripbackup(repo, tostrip, node, topic) | 313 backupfile = _createstripbackup(repo, tostrip, node, topic) |
315 | 314 |
315 newbmtarget, updatebm = _bookmarkmovements(repo, tostrip) | |
316 with repo.transaction(b'strip') as tr: | 316 with repo.transaction(b'strip') as tr: |
317 phases.retractboundary(repo, tr, phases.archived, tostrip) | 317 phases.retractboundary(repo, tr, phases.archived, tostrip) |
318 bmchanges = [(m, repo[newbmtarget].node()) for m in updatebm] | 318 bmchanges = [(m, repo[newbmtarget].node()) for m in updatebm] |
319 repo._bookmarks.applychanges(repo, tr, bmchanges) | 319 repo._bookmarks.applychanges(repo, tr, bmchanges) |
320 return backupfile | 320 return backupfile |