Mercurial > hg > mercurial-crew-with-dirclash
diff mercurial/commands.py @ 2718:a593813241e5
makes 'hg diff' diff the file in sorted order
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 28 Jul 2006 18:46:02 +0200 |
parents | 14ebe97542a7 |
children | 42a02b5773d4 ad4155e757da |
line wrap: on
line diff
--- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -432,25 +432,16 @@ def dodiff(fp, ui, repo, node1, node2, f 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,