##// END OF EJS Templates
subrepo: fix a crash when archiving an svn or git subrepo...
Matt Harbison -
r44467:7ca8aa88 stable
parent child Browse files
Show More
@@ -1208,7 +1208,16 b' def overridearchive('
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 with lfstatus(sub._repo):
1211
1212 # TODO: Only hgsubrepo instances have `_repo`, so figure out how to
1213 # infer and possibly set lfstatus in hgsubrepoarchive. That would
1214 # allow only hgsubrepos to set this, instead of the current scheme
1215 # where the parent sets this for the child.
1216 with (
1217 util.safehasattr(sub, '_repo')
1218 and lfstatus(sub._repo)
1219 or util.nullcontextmanager()
1220 ):
1212 sub.archive(archiver, subprefix, submatch)
1221 sub.archive(archiver, subprefix, submatch)
1213
1222
1214 archiver.done()
1223 archiver.done()
@@ -1266,7 +1275,15 b' def hgsubrepoarchive(orig, repo, archive'
1266 sub = ctx.workingsub(subpath)
1275 sub = ctx.workingsub(subpath)
1267 submatch = matchmod.subdirmatcher(subpath, match)
1276 submatch = matchmod.subdirmatcher(subpath, match)
1268 subprefix = prefix + subpath + b'/'
1277 subprefix = prefix + subpath + b'/'
1269 with lfstatus(sub._repo):
1278 # TODO: Only hgsubrepo instances have `_repo`, so figure out how to
1279 # infer and possibly set lfstatus at the top of this function. That
1280 # would allow only hgsubrepos to set this, instead of the current scheme
1281 # where the parent sets this for the child.
1282 with (
1283 util.safehasattr(sub, '_repo')
1284 and lfstatus(sub._repo)
1285 or util.nullcontextmanager()
1286 ):
1270 sub.archive(archiver, subprefix, submatch, decode)
1287 sub.archive(archiver, subprefix, submatch, decode)
1271
1288
1272
1289
@@ -376,6 +376,15 b' archive subrepos'
376 a
376 a
377 s/g
377 s/g
378
378
379 $ hg -R ../tc archive -S ../lf_archive.tgz --prefix '.' \
380 > --config extensions.largefiles= 2>/dev/null
381 $ tar -tzf ../lf_archive.tgz | sort | grep -v pax_global_header
382 .hg_archival.txt
383 .hgsub
384 .hgsubstate
385 a
386 s/g
387
379 create nested repo
388 create nested repo
380
389
381 $ cd ..
390 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now