Mercurial > hg
comparison hgext/largefiles/overrides.py @ 43296:2cb787b65cf2
largefiles: use context manager for setting "lfstatus" on subrepos too
It's safe since we now reset to the previous value.
Differential Revision: https://phab.mercurial-scm.org/D7138
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 18 Oct 2019 15:16:57 -0700 |
parents | 013637f4812e |
children | 9f70512ae2cf 7ca8aa8840c0 |
comparison
equal
deleted
inserted
replaced
43295:013637f4812e | 43296:2cb787b65cf2 |
---|---|
1206 if subrepos: | 1206 if subrepos: |
1207 for subpath in sorted(ctx.substate): | 1207 for subpath in sorted(ctx.substate): |
1208 sub = ctx.workingsub(subpath) | 1208 sub = ctx.workingsub(subpath) |
1209 submatch = matchmod.subdirmatcher(subpath, match) | 1209 submatch = matchmod.subdirmatcher(subpath, match) |
1210 subprefix = prefix + subpath + b'/' | 1210 subprefix = prefix + subpath + b'/' |
1211 sub._repo.lfstatus = True | 1211 with lfstatus(sub._repo): |
1212 sub.archive(archiver, subprefix, submatch) | 1212 sub.archive(archiver, subprefix, submatch) |
1213 | 1213 |
1214 archiver.done() | 1214 archiver.done() |
1215 | 1215 |
1216 | 1216 |
1217 @eh.wrapfunction(subrepo.hgsubrepo, b'archive') | 1217 @eh.wrapfunction(subrepo.hgsubrepo, b'archive') |
1264 | 1264 |
1265 for subpath in sorted(ctx.substate): | 1265 for subpath in sorted(ctx.substate): |
1266 sub = ctx.workingsub(subpath) | 1266 sub = ctx.workingsub(subpath) |
1267 submatch = matchmod.subdirmatcher(subpath, match) | 1267 submatch = matchmod.subdirmatcher(subpath, match) |
1268 subprefix = prefix + subpath + b'/' | 1268 subprefix = prefix + subpath + b'/' |
1269 sub._repo.lfstatus = True | 1269 with lfstatus(sub._repo): |
1270 sub.archive(archiver, subprefix, submatch, decode) | 1270 sub.archive(archiver, subprefix, submatch, decode) |
1271 | 1271 |
1272 | 1272 |
1273 # If a largefile is modified, the change is not reflected in its | 1273 # If a largefile is modified, the change is not reflected in its |
1274 # standin until a commit. cmdutil.bailifchanged() raises an exception | 1274 # standin until a commit. cmdutil.bailifchanged() raises an exception |
1275 # if the repo has uncommitted changes. Wrap it to also check if | 1275 # if the repo has uncommitted changes. Wrap it to also check if |