##// END OF EJS Templates
status: use match helpers for various users
Matt Mackall -
r6599:cd4db399 default
parent child Browse files
Show More
@@ -46,7 +46,7 b''
46 46 # vdiff on hovered and selected revisions.
47 47
48 48 import os
49 from mercurial import commands, util, patch, revlog
49 from mercurial import commands, util, patch, revlog, cmdutil
50 50 from mercurial.node import nullid, nullrev, short
51 51
52 52 def difftree(ui, repo, node1=None, node2=None, *files, **opts):
@@ -55,7 +55,8 b' def difftree(ui, repo, node1=None, node2'
55 55 assert node2 is not None
56 56 mmap = repo.changectx(node1).manifest()
57 57 mmap2 = repo.changectx(node2).manifest()
58 status = repo.status(node1, node2, files=files)[:5]
58 m = cmdutil.matchfiles(repo, files)
59 status = repo.status(node1, node2, files=m.files(), match=m)[:5]
59 60 modified, added, removed, deleted, unknown = status
60 61
61 62 empty = short(nullid)
@@ -1045,12 +1045,10 b' class queue:'
1045 1045 man = repo.manifest.read(changes[0])
1046 1046 aaa = aa[:]
1047 1047 if opts.get('short'):
1048 filelist = mm + aa + dd
1049 match = dict.fromkeys(filelist).__contains__
1048 match = cmdutil.matchfiles(repo, mm + aa + dd)
1050 1049 else:
1051 filelist = None
1052 match = util.always
1053 m, a, r, d, u = repo.status(files=filelist, match=match)[:5]
1050 match = cmdutil.matchall(repo)
1051 m, a, r, d, u = repo.status(files=match.files(), match=match)[:5]
1054 1052
1055 1053 # we might end up with files that were added between
1056 1054 # tip and the dirstate parent, but then changed in the
@@ -2363,7 +2363,8 b' def revert(ui, repo, *pats, **opts):'
2363 2363 if abs not in names:
2364 2364 names[abs] = m.rel(abs), m.exact(abs)
2365 2365
2366 changes = repo.status(files=files, match=names.has_key)[:4]
2366 m = cmdutil.matchfiles(repo, names)
2367 changes = repo.status(files=m.files(), match=m)[:4]
2367 2368 modified, added, removed, deleted = map(dict.fromkeys, changes)
2368 2369
2369 2370 # if f is a rename, also revert the source
General Comments 0
You need to be logged in to leave comments. Login now