mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
refactor the dodiff optimization
This commit is contained in:
parent
9ab531ee4f
commit
a61ac165f6
@ -276,12 +276,13 @@ def make_file(repo, r, pat, node=None,
|
||||
|
||||
def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always,
|
||||
changes=None, text=False, opts={}):
|
||||
if node1:
|
||||
# reading the data for node1 early allows it to play nicely
|
||||
# with repo.changes and the revlog cache.
|
||||
change = repo.changelog.read(node1)
|
||||
mmap = repo.manifest.read(change[0])
|
||||
date1 = util.datestr(change[2])
|
||||
if not node1:
|
||||
node1 = repo.dirstate.parents()[0]
|
||||
# reading the data for node1 early allows it to play nicely
|
||||
# with repo.changes and the revlog cache.
|
||||
change = repo.changelog.read(node1)
|
||||
mmap = repo.manifest.read(change[0])
|
||||
date1 = util.datestr(change[2])
|
||||
|
||||
if not changes:
|
||||
changes = repo.changes(node1, node2, files, match=match)
|
||||
@ -301,11 +302,6 @@ def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always,
|
||||
return repo.file(f).read(mmap2[f])
|
||||
else:
|
||||
date2 = util.datestr()
|
||||
if not node1:
|
||||
node1 = repo.dirstate.parents()[0]
|
||||
change = repo.changelog.read(node1)
|
||||
mmap = repo.manifest.read(change[0])
|
||||
date1 = util.datestr(change[2])
|
||||
def read(f):
|
||||
return repo.wread(f)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user