repair: filter out unknown revisions from phasecache within transaction
authorMartin von Zweigbergk <martinvonz@google.com>
Sun, 14 Jan 2018 14:39:17 -0800
changeset 35707 54074a82e050
parent 35706 5748f404dad3
child 35708 03e921942163
repair: filter out unknown revisions from phasecache within transaction I'm about to add another summary report callback that needs to access phase information. These callbacks run at the end of the transaction and some of them failed because they tried to get the phase for stripped commits. The solution is to filter out unknown revisions before the transaction is closed. Differential Revision: https://phab.mercurial-scm.org/D1865
mercurial/repair.py
--- a/mercurial/repair.py	Sun Jan 14 23:37:06 2018 -0800
+++ b/mercurial/repair.py	Sun Jan 14 14:39:17 2018 -0800
@@ -203,8 +203,8 @@
 
             deleteobsmarkers(repo.obsstore, stripobsidx)
             del repo.obsstore
+            repo._phasecache.filterunknown(repo)
 
-        repo._phasecache.filterunknown(repo)
         if tmpbundlefile:
             ui.note(_("adding branch\n"))
             f = vfs.open(tmpbundlefile, "rb")