Mercurial > hg-stable
changeset 732:ba0b6d17a6de
Convert diff command over to using walk code.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Wed, 20 Jul 2005 03:16:20 -0800 |
parents | 91ca3afab8e8 |
children | 1966c553f652 |
files | mercurial/commands.py |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Jul 20 03:01:23 2005 -0800 +++ b/mercurial/commands.py Wed Jul 20 03:16:20 2005 -0800 @@ -549,7 +549,7 @@ ui.write("\t%d -> %d\n" % (r.rev(e[5]), i)) ui.write("}\n") -def diff(ui, repo, *files, **opts): +def diff(ui, repo, *pats, **opts): """diff working directory (or selected files)""" revs = [] if opts['rev']: @@ -558,11 +558,9 @@ if len(revs) > 2: raise Abort("too many revisions to diff") - if files: - files = relpath(repo, files) - else: - files = relpath(repo, [""]) - + files = [] + for src, abs, rel in walk(repo, pats, opts): + files.append(abs) dodiff(sys.stdout, ui, repo, files, *revs) def doexport(ui, repo, changeset, seqno, total, revwidth, opts): @@ -1126,7 +1124,9 @@ "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'), "^diff": (diff, - [('r', 'rev', [], 'revision')], + [('I', 'include', [], 'include path in search'), + ('X', 'exclude', [], 'exclude path from search'), + ('r', 'rev', [], 'revision')], 'hg diff [-r REV1 [-r REV2]] [FILE]...'), "^export": (export,