Mercurial > public > mercurial-scm > hg
comparison hgext/extdiff.py @ 3090:eeaf9bcdfa25
Move revision parsing into cmdutil.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Thu, 14 Sep 2006 11:19:35 -0700 |
parents | be98c5ce4022 |
children | 8e8deb8035a4 |
comparison
equal
deleted
inserted
replaced
3089:e7fc04dc6349 | 3090:eeaf9bcdfa25 |
---|---|
43 # pretty fast (at least faster than having to compare the entire tree). | 43 # pretty fast (at least faster than having to compare the entire tree). |
44 | 44 |
45 from mercurial.demandload import demandload | 45 from mercurial.demandload import demandload |
46 from mercurial.i18n import gettext as _ | 46 from mercurial.i18n import gettext as _ |
47 from mercurial.node import * | 47 from mercurial.node import * |
48 demandload(globals(), 'mercurial:commands,cmdutil,util os shutil tempfile') | 48 demandload(globals(), 'mercurial:cmdutil,util os shutil tempfile') |
49 | 49 |
50 def dodiff(ui, repo, diffcmd, diffopts, pats, opts): | 50 def dodiff(ui, repo, diffcmd, diffopts, pats, opts): |
51 def snapshot_node(files, node): | 51 def snapshot_node(files, node): |
52 '''snapshot files as of some revision''' | 52 '''snapshot files as of some revision''' |
53 changes = repo.changelog.read(node) | 53 changes = repo.changelog.read(node) |
88 fp = open(dest, 'w') | 88 fp = open(dest, 'w') |
89 for chunk in util.filechunkiter(repo.wopener(wfn)): | 89 for chunk in util.filechunkiter(repo.wopener(wfn)): |
90 fp.write(chunk) | 90 fp.write(chunk) |
91 return dirname | 91 return dirname |
92 | 92 |
93 node1, node2 = commands.revpair(ui, repo, opts['rev']) | 93 node1, node2 = cmdutil.revpair(ui, repo, opts['rev']) |
94 files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) | 94 files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts) |
95 modified, added, removed, deleted, unknown = repo.status( | 95 modified, added, removed, deleted, unknown = repo.status( |
96 node1, node2, files, match=matchfn)[:5] | 96 node1, node2, files, match=matchfn)[:5] |
97 if not (modified or added or removed): | 97 if not (modified or added or removed): |
98 return 0 | 98 return 0 |