Fix a bug in patches() if there's not text and no patch
authormpm@selenic.com
Tue, 17 May 2005 00:32:18 -0800
changeset 75 b942bbe4bb84
parent 74 401e18c95ad3
child 76 d993ebd69d28
Fix a bug in patches() if there's not text and no patch
mercurial/mdiff.py
--- a/mercurial/mdiff.py	Tue May 17 00:30:01 2005 -0800
+++ b/mercurial/mdiff.py	Tue May 17 00:32:18 2005 -0800
@@ -71,6 +71,9 @@
     bl = len(a) + pl
     tl = bl + bl + pl # enough for the patches and two working texts
     b1, b2 = 0, bl
+
+    if not tl: return a
+
     m = mmap.mmap(devzero.fileno(), tl, mmap.MAP_PRIVATE)
 
     # load our original text