Show More
@@ -422,14 +422,13 b' def cachelfiles(ui, repo, node, filelist' | |||||
422 | return ([], []) |
|
422 | return ([], []) | |
423 |
|
423 | |||
424 | def downloadlfiles(ui, repo, rev=None): |
|
424 | def downloadlfiles(ui, repo, rev=None): | |
425 |
match |
|
425 | match = scmutil.match(repo[None], [repo.wjoin(lfutil.shortname)], {}) | |
426 | [repo.wjoin(lfutil.shortname)], {}) |
|
|||
427 | def prepare(ctx, fns): |
|
426 | def prepare(ctx, fns): | |
428 | pass |
|
427 | pass | |
429 | totalsuccess = 0 |
|
428 | totalsuccess = 0 | |
430 | totalmissing = 0 |
|
429 | totalmissing = 0 | |
431 | if rev != []: # walkchangerevs on empty list would return all revs |
|
430 | if rev != []: # walkchangerevs on empty list would return all revs | |
432 |
for ctx in cmdutil.walkchangerevs(repo, match |
|
431 | for ctx in cmdutil.walkchangerevs(repo, match, {'rev' : rev}, | |
433 | prepare): |
|
432 | prepare): | |
434 | success, missing = cachelfiles(ui, repo, ctx.node()) |
|
433 | success, missing = cachelfiles(ui, repo, ctx.node()) | |
435 | totalsuccess += len(success) |
|
434 | totalsuccess += len(success) |
@@ -1664,15 +1664,15 b' class queue(object):' | |||||
1664 | changes = repo.changelog.read(top) |
|
1664 | changes = repo.changelog.read(top) | |
1665 | man = repo.manifestlog[changes[0]].read() |
|
1665 | man = repo.manifestlog[changes[0]].read() | |
1666 | aaa = aa[:] |
|
1666 | aaa = aa[:] | |
1667 |
match |
|
1667 | match1 = scmutil.match(repo[None], pats, opts) | |
1668 | # in short mode, we only diff the files included in the |
|
1668 | # in short mode, we only diff the files included in the | |
1669 | # patch already plus specified files |
|
1669 | # patch already plus specified files | |
1670 | if opts.get('short'): |
|
1670 | if opts.get('short'): | |
1671 | # if amending a patch, we start with existing |
|
1671 | # if amending a patch, we start with existing | |
1672 | # files plus specified files - unfiltered |
|
1672 | # files plus specified files - unfiltered | |
1673 |
match = scmutil.matchfiles(repo, mm + aa + dd + match |
|
1673 | match = scmutil.matchfiles(repo, mm + aa + dd + match1.files()) | |
1674 | # filter with include/exclude options |
|
1674 | # filter with include/exclude options | |
1675 |
match |
|
1675 | match1 = scmutil.match(repo[None], opts=opts) | |
1676 | else: |
|
1676 | else: | |
1677 | match = scmutil.matchall(repo) |
|
1677 | match = scmutil.matchall(repo) | |
1678 | m, a, r, d = repo.status(match=match)[:4] |
|
1678 | m, a, r, d = repo.status(match=match)[:4] | |
@@ -1713,8 +1713,8 b' class queue(object):' | |||||
1713 | a = list(aa) |
|
1713 | a = list(aa) | |
1714 |
|
1714 | |||
1715 | # create 'match' that includes the files to be recommitted. |
|
1715 | # create 'match' that includes the files to be recommitted. | |
1716 |
# apply match |
|
1716 | # apply match1 via repo.status to ensure correct case handling. | |
1717 |
cm, ca, cr, cd = repo.status(patchparent, match=match |
|
1717 | cm, ca, cr, cd = repo.status(patchparent, match=match1)[:4] | |
1718 | allmatches = set(cm + ca + cr + cd) |
|
1718 | allmatches = set(cm + ca + cr + cd) | |
1719 | refreshchanges = [x.intersection(allmatches) for x in (mm, aa, dd)] |
|
1719 | refreshchanges = [x.intersection(allmatches) for x in (mm, aa, dd)] | |
1720 |
|
1720 | |||
@@ -1764,7 +1764,7 b' class queue(object):' | |||||
1764 | # file with mtime=0 so status can see it. |
|
1764 | # file with mtime=0 so status can see it. | |
1765 | mm = [] |
|
1765 | mm = [] | |
1766 | for i in xrange(len(m) - 1, -1, -1): |
|
1766 | for i in xrange(len(m) - 1, -1, -1): | |
1767 |
if not match |
|
1767 | if not match1(m[i]): | |
1768 | mm.append(m[i]) |
|
1768 | mm.append(m[i]) | |
1769 | del m[i] |
|
1769 | del m[i] | |
1770 | for f in m: |
|
1770 | for f in m: |
@@ -2001,19 +2001,19 b' def show_changeset(ui, repo, opts, buffe' | |||||
2001 | regular display via changeset_printer() is done. |
|
2001 | regular display via changeset_printer() is done. | |
2002 | """ |
|
2002 | """ | |
2003 | # options |
|
2003 | # options | |
2004 |
match |
|
2004 | match = None | |
2005 | if opts.get('patch') or opts.get('stat'): |
|
2005 | if opts.get('patch') or opts.get('stat'): | |
2006 |
match |
|
2006 | match = scmutil.matchall(repo) | |
2007 |
|
2007 | |||
2008 | if opts.get('template') == 'json': |
|
2008 | if opts.get('template') == 'json': | |
2009 |
return jsonchangeset(ui, repo, match |
|
2009 | return jsonchangeset(ui, repo, match, opts, buffered) | |
2010 |
|
2010 | |||
2011 | spec = _lookuplogtemplate(ui, opts.get('template'), opts.get('style')) |
|
2011 | spec = _lookuplogtemplate(ui, opts.get('template'), opts.get('style')) | |
2012 |
|
2012 | |||
2013 | if not spec.ref and not spec.tmpl and not spec.mapfile: |
|
2013 | if not spec.ref and not spec.tmpl and not spec.mapfile: | |
2014 |
return changeset_printer(ui, repo, match |
|
2014 | return changeset_printer(ui, repo, match, opts, buffered) | |
2015 |
|
2015 | |||
2016 |
return changeset_templater(ui, repo, spec, match |
|
2016 | return changeset_templater(ui, repo, spec, match, opts, buffered) | |
2017 |
|
2017 | |||
2018 | def showmarker(fm, marker, index=None): |
|
2018 | def showmarker(fm, marker, index=None): | |
2019 | """utility function to display obsolescence marker in a readable way |
|
2019 | """utility function to display obsolescence marker in a readable way |
@@ -477,9 +477,9 b' def archive(ui, repo, dest, **opts):' | |||||
477 | prefix = os.path.basename(repo.root) + '-%h' |
|
477 | prefix = os.path.basename(repo.root) + '-%h' | |
478 |
|
478 | |||
479 | prefix = cmdutil.makefilename(repo, prefix, node) |
|
479 | prefix = cmdutil.makefilename(repo, prefix, node) | |
480 |
match |
|
480 | match = scmutil.match(ctx, [], opts) | |
481 | archival.archive(repo, dest, node, kind, not opts.get('no_decode'), |
|
481 | archival.archive(repo, dest, node, kind, not opts.get('no_decode'), | |
482 |
match |
|
482 | match, prefix, subrepos=opts.get('subrepos')) | |
483 |
|
483 | |||
484 | @command('backout', |
|
484 | @command('backout', | |
485 | [('', 'merge', None, _('merge with old dirstate parent after backout')), |
|
485 | [('', 'merge', None, _('merge with old dirstate parent after backout')), | |
@@ -2489,7 +2489,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||||
2489 |
|
2489 | |||
2490 | skip = {} |
|
2490 | skip = {} | |
2491 | revfiles = {} |
|
2491 | revfiles = {} | |
2492 |
match |
|
2492 | match = scmutil.match(repo[None], pats, opts) | |
2493 | found = False |
|
2493 | found = False | |
2494 | follow = opts.get('follow') |
|
2494 | follow = opts.get('follow') | |
2495 |
|
2495 | |||
@@ -2530,7 +2530,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||||
2530 |
|
2530 | |||
2531 | ui.pager('grep') |
|
2531 | ui.pager('grep') | |
2532 | fm = ui.formatter('grep', opts) |
|
2532 | fm = ui.formatter('grep', opts) | |
2533 |
for ctx in cmdutil.walkchangerevs(repo, match |
|
2533 | for ctx in cmdutil.walkchangerevs(repo, match, opts, prep): | |
2534 | rev = ctx.rev() |
|
2534 | rev = ctx.rev() | |
2535 | parent = ctx.p1().rev() |
|
2535 | parent = ctx.p1().rev() | |
2536 | for fn in sorted(revfiles.get(rev, [])): |
|
2536 | for fn in sorted(revfiles.get(rev, [])): |
@@ -1111,13 +1111,13 b' def archive(web, req, tmpl):' | |||||
1111 |
|
1111 | |||
1112 | ctx = webutil.changectx(web.repo, req) |
|
1112 | ctx = webutil.changectx(web.repo, req) | |
1113 | pats = [] |
|
1113 | pats = [] | |
1114 |
match |
|
1114 | match = scmutil.match(ctx, []) | |
1115 | file = req.form.get('file', None) |
|
1115 | file = req.form.get('file', None) | |
1116 | if file: |
|
1116 | if file: | |
1117 | pats = ['path:' + file[0]] |
|
1117 | pats = ['path:' + file[0]] | |
1118 |
match |
|
1118 | match = scmutil.match(ctx, pats, default='path') | |
1119 | if pats: |
|
1119 | if pats: | |
1120 |
files = [f for f in ctx.manifest().keys() if match |
|
1120 | files = [f for f in ctx.manifest().keys() if match(f)] | |
1121 | if not files: |
|
1121 | if not files: | |
1122 | raise ErrorResponse(HTTP_NOT_FOUND, |
|
1122 | raise ErrorResponse(HTTP_NOT_FOUND, | |
1123 | 'file(s) not found: %s' % file[0]) |
|
1123 | 'file(s) not found: %s' % file[0]) | |
@@ -1132,7 +1132,7 b' def archive(web, req, tmpl):' | |||||
1132 | req.respond(HTTP_OK, mimetype) |
|
1132 | req.respond(HTTP_OK, mimetype) | |
1133 |
|
1133 | |||
1134 | archival.archive(web.repo, req, cnode, artype, prefix=name, |
|
1134 | archival.archive(web.repo, req, cnode, artype, prefix=name, | |
1135 |
matchfn=match |
|
1135 | matchfn=match, | |
1136 | subrepos=web.configbool("web", "archivesubrepos")) |
|
1136 | subrepos=web.configbool("web", "archivesubrepos")) | |
1137 | return [] |
|
1137 | return [] | |
1138 |
|
1138 |
General Comments 0
You need to be logged in to leave comments.
Login now