# HG changeset patch # User mason@suse.com # Date 1124078972 28800 # Node ID 969647d5100a2bd2c39db9503c60638d748263bc # Parent 71be6dd282d14323bc91816e1cc3e22322b9c556 Add optional parameter for changed/added/del/unknown files to commands.dodiff This makes it possible to avoid a call into repo.changes if the details of what has changed is already known diff -r 71be6dd282d1 -r 969647d5100a mercurial/commands.py --- a/mercurial/commands.py Sun Aug 14 20:09:21 2005 -0800 +++ b/mercurial/commands.py Sun Aug 14 20:09:32 2005 -0800 @@ -145,11 +145,14 @@ return open(make_filename(repo, r, pat, node, total, seqno, revwidth), mode) -def dodiff(fp, ui, repo, files=None, node1=None, node2=None, match=util.always): +def dodiff(fp, ui, repo, files=None, node1=None, node2=None, match=util.always, changes=None): def date(c): return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) - (c, a, d, u) = repo.changes(node1, node2, files, match = match) + if not changes: + (c, a, d, u) = repo.changes(node1, node2, files, match = match) + else: + (c, a, d, u) = changes if files: c, a, d = map(lambda x: filterfiles(files, x), (c, a, d))