Mercurial > public > mercurial-scm > hg
comparison mercurial/mdiff.py @ 75:b942bbe4bb84
Fix a bug in patches() if there's not text and no patch
author | mpm@selenic.com |
---|---|
date | Tue, 17 May 2005 00:32:18 -0800 |
parents | 4a6ab4d80dc4 |
children | bae6f0328f63 |
comparison
equal
deleted
inserted
replaced
74:401e18c95ad3 | 75:b942bbe4bb84 |
---|---|
69 plens = [len(x) for x in bins] | 69 plens = [len(x) for x in bins] |
70 pl = sum(plens) | 70 pl = sum(plens) |
71 bl = len(a) + pl | 71 bl = len(a) + pl |
72 tl = bl + bl + pl # enough for the patches and two working texts | 72 tl = bl + bl + pl # enough for the patches and two working texts |
73 b1, b2 = 0, bl | 73 b1, b2 = 0, bl |
74 | |
75 if not tl: return a | |
76 | |
74 m = mmap.mmap(devzero.fileno(), tl, mmap.MAP_PRIVATE) | 77 m = mmap.mmap(devzero.fileno(), tl, mmap.MAP_PRIVATE) |
75 | 78 |
76 # load our original text | 79 # load our original text |
77 m.write(a) | 80 m.write(a) |
78 frags = [(len(a), b1)] | 81 frags = [(len(a), b1)] |