Mercurial > hg
comparison hgext/hgk.py @ 14322:a90131b85fd8
scmutil: drop aliases in cmdutil for match functions
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 13 May 2011 14:58:24 -0500 |
parents | 3da456d0c885 |
children | 35c2cc322ba8 |
comparison
equal
deleted
inserted
replaced
14321:003d63bb4fa5 | 14322:a90131b85fd8 |
---|---|
33 Revisions context menu will now display additional entries to fire | 33 Revisions context menu will now display additional entries to fire |
34 vdiff on hovered and selected revisions. | 34 vdiff on hovered and selected revisions. |
35 ''' | 35 ''' |
36 | 36 |
37 import os | 37 import os |
38 from mercurial import commands, util, patch, revlog, cmdutil | 38 from mercurial import commands, util, patch, revlog, scmutil |
39 from mercurial.node import nullid, nullrev, short | 39 from mercurial.node import nullid, nullrev, short |
40 from mercurial.i18n import _ | 40 from mercurial.i18n import _ |
41 | 41 |
42 def difftree(ui, repo, node1=None, node2=None, *files, **opts): | 42 def difftree(ui, repo, node1=None, node2=None, *files, **opts): |
43 """diff trees from two commits""" | 43 """diff trees from two commits""" |
44 def __difftree(repo, node1, node2, files=[]): | 44 def __difftree(repo, node1, node2, files=[]): |
45 assert node2 is not None | 45 assert node2 is not None |
46 mmap = repo[node1].manifest() | 46 mmap = repo[node1].manifest() |
47 mmap2 = repo[node2].manifest() | 47 mmap2 = repo[node2].manifest() |
48 m = cmdutil.match(repo, files) | 48 m = scmutil.match(repo, files) |
49 modified, added, removed = repo.status(node1, node2, m)[:3] | 49 modified, added, removed = repo.status(node1, node2, m)[:3] |
50 empty = short(nullid) | 50 empty = short(nullid) |
51 | 51 |
52 for f in modified: | 52 for f in modified: |
53 # TODO get file permissions | 53 # TODO get file permissions |
79 node2 = node1 | 79 node2 = node1 |
80 node1 = repo.changelog.parents(node1)[0] | 80 node1 = repo.changelog.parents(node1)[0] |
81 if opts['patch']: | 81 if opts['patch']: |
82 if opts['pretty']: | 82 if opts['pretty']: |
83 catcommit(ui, repo, node2, "") | 83 catcommit(ui, repo, node2, "") |
84 m = cmdutil.match(repo, files) | 84 m = scmutil.match(repo, files) |
85 chunks = patch.diff(repo, node1, node2, match=m, | 85 chunks = patch.diff(repo, node1, node2, match=m, |
86 opts=patch.diffopts(ui, {'git': True})) | 86 opts=patch.diffopts(ui, {'git': True})) |
87 for chunk in chunks: | 87 for chunk in chunks: |
88 ui.write(chunk) | 88 ui.write(chunk) |
89 else: | 89 else: |