diff -r 8a7a24b96697 -r 06e7447c7302 mercurial/commands.py --- a/mercurial/commands.py Sat Feb 25 13:44:40 2006 +0100 +++ b/mercurial/commands.py Sun Feb 26 02:26:17 2006 +0100 @@ -276,6 +276,13 @@ 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 changes: changes = repo.changes(node1, node2, files, match=match) modified, added, removed, deleted, unknown = changes @@ -296,6 +303,9 @@ 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) @@ -305,10 +315,6 @@ hexfunc = ui.verbose and hex or short r = [hexfunc(node) for node in [node1, node2] if node] - change = repo.changelog.read(node1) - mmap = repo.manifest.read(change[0]) - date1 = util.datestr(change[2]) - diffopts = ui.diffopts() showfunc = opts.get('show_function') or diffopts['showfunc'] ignorews = opts.get('ignore_all_space') or diffopts['ignorews']