D7138: largefiles: use context manager for setting "lfstatus" on subrepos too

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Oct 19 00:52:04 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It's safe since we now reset to the previous value.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/largefiles/overrides.py

CHANGE DETAILS

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1208,8 +1208,8 @@
             sub = ctx.workingsub(subpath)
             submatch = matchmod.subdirmatcher(subpath, match)
             subprefix = prefix + subpath + b'/'
-            sub._repo.lfstatus = True
-            sub.archive(archiver, subprefix, submatch)
+            with lfstatus(sub._repo):
+                sub.archive(archiver, subprefix, submatch)
 
     archiver.done()
 
@@ -1266,8 +1266,8 @@
         sub = ctx.workingsub(subpath)
         submatch = matchmod.subdirmatcher(subpath, match)
         subprefix = prefix + subpath + b'/'
-        sub._repo.lfstatus = True
-        sub.archive(archiver, subprefix, submatch, decode)
+        with lfstatus(sub._repo):
+            sub.archive(archiver, subprefix, submatch, decode)
 
 
 # If a largefile is modified, the change is not reflected in its



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list