##// END OF EJS Templates
archive: change "matcnfn" argument to a real matcher...
Martin von Zweigbergk -
r40443:3d76a8e6 default
parent child Browse files
Show More
@@ -139,7 +139,7 b' def snapshot(ui, repo, files, node, tmpr'
139 139 repo.ui.setconfig("ui", "archivemeta", False)
140 140
141 141 archival.archive(repo, base, node, 'files',
142 matchfn=scmutil.matchfiles(repo, files),
142 match=scmutil.matchfiles(repo, files),
143 143 subrepos=listsubrepos)
144 144
145 145 for fn in sorted(files):
@@ -929,12 +929,12 b' def hgwebarchive(orig, web):'
929 929 finally:
930 930 web.repo.lfstatus = False
931 931
932 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
932 def overridearchive(orig, repo, dest, node, kind, decode=True, match=None,
933 933 prefix='', mtime=None, subrepos=None):
934 934 # For some reason setting repo.lfstatus in hgwebarchive only changes the
935 935 # unfiltered repo's attr, so check that as well.
936 936 if not repo.lfstatus and not repo.unfiltered().lfstatus:
937 return orig(repo, dest, node, kind, decode, matchfn, prefix, mtime,
937 return orig(repo, dest, node, kind, decode, match, prefix, mtime,
938 938 subrepos)
939 939
940 940 # No need to lock because we are only reading history and
@@ -955,7 +955,7 b' def overridearchive(orig, repo, dest, no'
955 955 prefix = archival.tidyprefix(dest, kind, prefix)
956 956
957 957 def write(name, mode, islink, getdata):
958 if matchfn and not matchfn(name):
958 if match and not match(name):
959 959 return
960 960 data = getdata()
961 961 if decode:
@@ -991,7 +991,7 b' def overridearchive(orig, repo, dest, no'
991 991 if subrepos:
992 992 for subpath in sorted(ctx.substate):
993 993 sub = ctx.workingsub(subpath)
994 submatch = matchmod.subdirmatcher(subpath, matchfn)
994 submatch = matchmod.subdirmatcher(subpath, match)
995 995 sub._repo.lfstatus = True
996 996 sub.archive(archiver, prefix, submatch)
997 997
@@ -274,7 +274,7 b' archivers = {'
274 274 'zip': zipit,
275 275 }
276 276
277 def archive(repo, dest, node, kind, decode=True, matchfn=None,
277 def archive(repo, dest, node, kind, decode=True, match=None,
278 278 prefix='', mtime=None, subrepos=False):
279 279 '''create archive of repo as it was at node.
280 280
@@ -286,7 +286,7 b' def archive(repo, dest, node, kind, deco'
286 286 decode tells whether to put files through decode filters from
287 287 hgrc.
288 288
289 matchfn is function to filter names of files to write to archive.
289 match is a matcher to filter names of files to write to archive.
290 290
291 291 prefix is name of path to put before every archive member.
292 292
@@ -315,11 +315,11 b' def archive(repo, dest, node, kind, deco'
315 315
316 316 if repo.ui.configbool("ui", "archivemeta"):
317 317 name = '.hg_archival.txt'
318 if not matchfn or matchfn(name):
318 if not match or match(name):
319 319 write(name, 0o644, False, lambda: buildmetadata(ctx))
320 320
321 if matchfn:
322 files = [f for f in ctx.manifest().keys() if matchfn(f)]
321 if match:
322 files = [f for f in ctx.manifest().keys() if match(f)]
323 323 else:
324 324 files = ctx.manifest().keys()
325 325 total = len(files)
@@ -339,7 +339,7 b' def archive(repo, dest, node, kind, deco'
339 339 if subrepos:
340 340 for subpath in sorted(ctx.substate):
341 341 sub = ctx.workingsub(subpath)
342 submatch = matchmod.subdirmatcher(subpath, matchfn)
342 submatch = matchmod.subdirmatcher(subpath, match)
343 343 total += sub.archive(archiver, prefix, submatch, decode)
344 344
345 345 if total == 0:
@@ -1216,8 +1216,7 b' def archive(web):'
1216 1216
1217 1217 bodyfh = web.res.getbodyfile()
1218 1218
1219 archival.archive(web.repo, bodyfh, cnode, artype, prefix=name,
1220 matchfn=match,
1219 archival.archive(web.repo, bodyfh, cnode, artype, prefix=name, match=match,
1221 1220 subrepos=web.configbool("web", "archivesubrepos"))
1222 1221
1223 1222 return []
General Comments 0
You need to be logged in to leave comments. Login now