# HG changeset patch # User mpm@selenic.com # Date 1116318738 28800 # Node ID b942bbe4bb84c667f34a7796415a3e439b5b4577 # Parent 401e18c95ad381fa53adeb2f598a63fd70098e54 Fix a bug in patches() if there's not text and no patch diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py --- a/mercurial/mdiff.py +++ b/mercurial/mdiff.py @@ -71,6 +71,9 @@ def patches(a, bins): 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