# HG changeset patch # User Benoit Boissinot # Date 1154105162 -7200 # Node ID a593813241e59c7753bf1a90362275710ac2f490 # Parent 14ebe97542a77721e3a2377fd935ec5bbdf92343 makes 'hg diff' diff the file in sorted order diff -r 14ebe97542a7 -r a593813241e5 mercurial/commands.py --- a/mercurial/commands.py Fri Jul 28 09:01:13 2006 +0200 +++ b/mercurial/commands.py Fri Jul 28 18:46:02 2006 +0200 @@ -432,25 +432,16 @@ diffopts['ignorewsamount'] ignoreblanklines = opts.get('ignore_blank_lines') or \ diffopts['ignoreblanklines'] - for f in modified: + + all = modified + added + removed + all.sort() + for f in all: to = None + tn = None if f in mmap: to = repo.file(f).read(mmap[f]) - tn = read(f) - fp.write(mdiff.unidiff(to, date1, tn, date2(f), f, r, text=text, - showfunc=showfunc, ignorews=ignorews, - ignorewsamount=ignorewsamount, - ignoreblanklines=ignoreblanklines)) - for f in added: - to = None - tn = read(f) - fp.write(mdiff.unidiff(to, date1, tn, date2(f), f, r, text=text, - showfunc=showfunc, ignorews=ignorews, - ignorewsamount=ignorewsamount, - ignoreblanklines=ignoreblanklines)) - for f in removed: - to = repo.file(f).read(mmap[f]) - tn = None + if f not in removed: + tn = read(f) fp.write(mdiff.unidiff(to, date1, tn, date2(f), f, r, text=text, showfunc=showfunc, ignorews=ignorews, ignorewsamount=ignorewsamount,