changeset 130:e6678a1beb6a

Make hg diff handle files that have been added but not yet committed.
author mpm@selenic.com
date Sat, 21 May 2005 17:26:44 -0800
parents 1db9207def07
children b45b1b00fc9e
files hg
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: