changeset 904:969647d5100a

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
author mason@suse.com
date Sun, 14 Aug 2005 20:09:32 -0800
parents 71be6dd282d1
children 65763ff9fa53
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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))