comparison mercurial/commands.py @ 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 aa5b726e9619
children 65763ff9fa53
comparison
equal deleted inserted replaced
903:71be6dd282d1 904:969647d5100a
143 if hasattr(pat, 'read') and 'r' in mode: 143 if hasattr(pat, 'read') and 'r' in mode:
144 return pat 144 return pat
145 return open(make_filename(repo, r, pat, node, total, seqno, revwidth), 145 return open(make_filename(repo, r, pat, node, total, seqno, revwidth),
146 mode) 146 mode)
147 147
148 def dodiff(fp, ui, repo, files=None, node1=None, node2=None, match=util.always): 148 def dodiff(fp, ui, repo, files=None, node1=None, node2=None, match=util.always, changes=None):
149 def date(c): 149 def date(c):
150 return time.asctime(time.gmtime(float(c[2].split(' ')[0]))) 150 return time.asctime(time.gmtime(float(c[2].split(' ')[0])))
151 151
152 (c, a, d, u) = repo.changes(node1, node2, files, match = match) 152 if not changes:
153 (c, a, d, u) = repo.changes(node1, node2, files, match = match)
154 else:
155 (c, a, d, u) = changes
153 if files: 156 if files:
154 c, a, d = map(lambda x: filterfiles(files, x), (c, a, d)) 157 c, a, d = map(lambda x: filterfiles(files, x), (c, a, d))
155 158
156 if not c and not a and not d: 159 if not c and not a and not d:
157 return 160 return