diff mercurial/mdiff.py @ 12025:2315a95ee887

mdiff.patch(): add a special case for when the base text is empty remove the special casing from revlog.addgroup()
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 23 Aug 2010 13:28:04 +0200
parents d0050f36e688
children 8eb758ea738c
line wrap: on
line diff
--- a/mercurial/mdiff.py	Mon Aug 23 13:24:19 2010 +0200
+++ b/mercurial/mdiff.py	Mon Aug 23 13:28:04 2010 +0200
@@ -260,6 +260,9 @@
     return "".join(t)
 
 def patch(a, bin):
+    if len(a) == 0:
+        # skip over trivial delta header
+        return buffer(bin, 12)
     return mpatch.patches(a, [bin])
 
 # similar to difflib.SequenceMatcher.get_matching_blocks