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