# HG changeset patch # User mpm@selenic.com # Date 1116725204 28800 # Node ID e6678a1beb6a8d691f0f7544a7619b66459a6135 # Parent 1db9207def077e2b457ba639b091c10fd28556f3 Make hg diff handle files that have been added but not yet committed. diff -r 1db9207def07 -r e6678a1beb6a hg --- a/hg Sat May 21 17:03:12 2005 -0800 +++ b/hg Sat May 21 17:26:44 2005 -0800 @@ -76,7 +76,9 @@ c, a, d = map(lambda x: filterfiles(x, files), (c, a, d)) for f in c: - to = repo.file(f).read(mmap[f]) + to = "" + if mmap.has_key(f): + to = repo.file(f).read(mmap[f]) tn = read(f) sys.stdout.write(mdiff.unidiff(to, date1, tn, date2, f)) for f in a: