comparison mercurial/revlog.py @ 3335:9061613c1593

Teach bdiff to support buffer objects manifest.add gives revlog.addrevision a buffer object, which may be cached and used for a second call in the same session (as mq does when pushing multiple patches). The other option would be to cast the buffer to str when caching it.
author Brendan Cully <brendan@kublai.com>
date Wed, 11 Oct 2006 12:06:14 -0700
parents 7240f9e47144
children ef8307585b41
comparison
equal deleted inserted replaced
3334:534806df5b5a 3335:9061613c1593
971 base = self.base(t) 971 base = self.base(t)
972 start = self.start(base) 972 start = self.start(base)
973 end = self.end(t) 973 end = self.end(t)
974 if not d: 974 if not d:
975 prev = self.revision(self.tip()) 975 prev = self.revision(self.tip())
976 d = self.diff(prev, str(text)) 976 d = self.diff(prev, text)
977 data = compress(d) 977 data = compress(d)
978 l = len(data[1]) + len(data[0]) 978 l = len(data[1]) + len(data[0])
979 dist = end - start + l 979 dist = end - start + l
980 980
981 # full versions are inserted when the needed deltas 981 # full versions are inserted when the needed deltas