[Commented On] D10482: store: exclude `undo.` nodemap's file from `walk`
baymax (Baymax, Your Personal Patch-care Companion)
phabricator at mercurial-scm.org
Tue Apr 20 09:21:09 UTC 2021
baymax added a comment.
baymax updated this revision to Diff 27091.
✅ refresh by Heptapod after a successful CI run (🐙 💚)
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D10482?vs=27078&id=27091
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10482/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10482
AFFECTED FILES
mercurial/store.py
tests/test-persistent-nodemap.t
CHANGE DETAILS
diff --git a/tests/test-persistent-nodemap.t b/tests/test-persistent-nodemap.t
--- a/tests/test-persistent-nodemap.t
+++ b/tests/test-persistent-nodemap.t
@@ -988,8 +988,6 @@
$ touch $HG_TEST_STREAM_WALKED_FILE_2
$ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
$ cat clone-output-2
- adding [s] undo.backup.00manifest.n (70 bytes) (known-bad-output !)
- adding [s] undo.backup.00changelog.n (70 bytes) (known-bad-output !)
adding [s] 00manifest.n (70 bytes)
adding [s] 00manifest-*.nd (118 KB) (glob)
adding [s] 00changelog.n (70 bytes)
diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -10,6 +10,7 @@
import errno
import functools
import os
+import re
import stat
from .i18n import _
@@ -395,6 +396,9 @@
# deleted.
REVLOG_FILES_VOLATILE_EXT = (b'.n', b'.nd')
+# some exception to the above matching
+EXCLUDED = re.compile(b'.*undo\.[^/]+\.nd?$')
+
def is_revlog(f, kind, st):
if kind != stat.S_IFREG:
@@ -405,7 +409,7 @@
def revlog_type(f):
if f.endswith(REVLOG_FILES_MAIN_EXT):
return FILEFLAGS_REVLOG_MAIN
- elif f.endswith(REVLOG_FILES_OTHER_EXT):
+ elif f.endswith(REVLOG_FILES_OTHER_EXT) and EXCLUDED.match(f) is None:
t = FILETYPE_FILELOG_OTHER
if f.endswith(REVLOG_FILES_VOLATILE_EXT):
t |= FILEFLAGS_VOLATILE
To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210420/7496a94c/attachment-0002.html>
More information about the Mercurial-patches
mailing list