changeset 129:1db9207def07

Fix diff and export not showing added files
author mpm@selenic.com
date Sat, 21 May 2005 17:03:12 -0800
parents d6afb6dbf9f2
children e6678a1beb6a
files hg
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hg	Sat May 21 13:14:58 2005 -0800
+++ b/hg	Sat May 21 17:03:12 2005 -0800
@@ -65,6 +65,7 @@
         if not node1:
             node1 = repo.current
         (c, a, d) = repo.diffdir(repo.root, node1)
+        a = [] # ignore unknown files in repo, by popular request
         def read(f): return file(os.path.join(repo.root, f)).read()
 
     change = repo.changelog.read(node1)
@@ -72,13 +73,16 @@
     date1 = date(change)
 
     if files:
-        c = filterfiles(c, files)
-        d = filterfiles(d, files)
+        c, a, d = map(lambda x: filterfiles(x, files), (c, a, d))
 
     for f in c:
         to = repo.file(f).read(mmap[f])
         tn = read(f)
         sys.stdout.write(mdiff.unidiff(to, date1, tn, date2, f))
+    for f in a:
+        to = ""
+        tn = read(f)
+        sys.stdout.write(mdiff.unidiff(to, date1, tn, date2, f))
     for f in d:
         to = repo.file(f).read(mmap[f])
         tn = ""