Patchwork D11806: downgrade: don't assume existence of nodemap files when downgrading

login
register
mail settings
Submitter phabricator
Date Nov. 25, 2021, 5:27 p.m.
Message ID <differential-rev-PHID-DREV-luxdq2towud77yczeobi-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50132/
State Superseded
Headers show

Comments

phabricator - Nov. 25, 2021, 5:27 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Persistent nodemap files might not exist on a fresh repository, so ignore the
  potential missing file errors.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D11806

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -147,7 +147,7 @@ 
     if revlog._nodemap_file is None:
         msg = "calling persist nodemap on a revlog without the feature enabled"
         raise error.ProgrammingError(msg)
-    repo.svfs.unlink(revlog._nodemap_file)
+    repo.svfs.tryunlink(revlog._nodemap_file)
 
 
 def persist_nodemap(tr, revlog, pending=False, force=False):