Make hg diff handle files that have been added but not yet committed.
authormpm@selenic.com
Sat, 21 May 2005 17:26:44 -0800
changeset 130 e6678a1beb6a
parent 129 1db9207def07
child 137 b45b1b00fc9e
Make hg diff handle files that have been added but not yet committed.
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: