--- a/mercurial/patch.py Fri Mar 19 22:52:38 2010 +0100
+++ b/mercurial/patch.py Sat Mar 20 21:16:22 2010 +0100
@@ -1019,7 +1019,7 @@
gitworkdone = False
while True:
- newfile = False
+ newfile = newgitfile = False
x = lr.readline()
if not x:
break
@@ -1070,7 +1070,7 @@
if gp and gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD'):
afile = bfile
gitworkdone = True
- newfile = True
+ newgitfile = True
elif x.startswith('---'):
# check for a unified diff
l2 = lr.readline()
@@ -1097,7 +1097,7 @@
afile = parsefilename(x)
bfile = parsefilename(l2)
- if newfile:
+ if newgitfile or newfile:
emitfile = True
state = BFILE
hunknum = 0