diff -r c8e9a3636abe -r 888bd39ed555 mercurial/manifest.py --- a/mercurial/manifest.py Fri Nov 22 11:08:59 2019 -0800 +++ b/mercurial/manifest.py Tue Nov 19 18:38:17 2019 -0800 @@ -1572,7 +1572,11 @@ reporef = weakref.ref(repo) manifestrevlogref = weakref.ref(self) - def persistmanifestcache(): + def persistmanifestcache(success): + # Repo is in an unknown state, do not persist. + if not success: + return + repo = reporef() self = manifestrevlogref() if repo is None or self is None: