##// END OF EJS Templates
refactor the dodiff optimization
Benoit Boissinot -
r1804:c3f959c1 default
parent child Browse files
Show More
@@ -276,12 +276,13 b' def make_file(repo, r, pat, node=None,'
276 276
277 277 def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always,
278 278 changes=None, text=False, opts={}):
279 if node1:
280 # reading the data for node1 early allows it to play nicely
281 # with repo.changes and the revlog cache.
282 change = repo.changelog.read(node1)
283 mmap = repo.manifest.read(change[0])
284 date1 = util.datestr(change[2])
279 if not node1:
280 node1 = repo.dirstate.parents()[0]
281 # reading the data for node1 early allows it to play nicely
282 # with repo.changes and the revlog cache.
283 change = repo.changelog.read(node1)
284 mmap = repo.manifest.read(change[0])
285 date1 = util.datestr(change[2])
285 286
286 287 if not changes:
287 288 changes = repo.changes(node1, node2, files, match=match)
@@ -301,11 +302,6 b' def dodiff(fp, ui, repo, node1, node2, f'
301 302 return repo.file(f).read(mmap2[f])
302 303 else:
303 304 date2 = util.datestr()
304 if not node1:
305 node1 = repo.dirstate.parents()[0]
306 change = repo.changelog.read(node1)
307 mmap = repo.manifest.read(change[0])
308 date1 = util.datestr(change[2])
309 305 def read(f):
310 306 return repo.wread(f)
311 307
General Comments 0
You need to be logged in to leave comments. Login now