Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.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 | 56a7721ee3ec |
children | e21fe9c5fb25 |
comparison
equal
deleted
inserted
replaced
12024:56a7721ee3ec | 12025:2315a95ee887 |
---|---|
1351 # flush our writes here so we can read it in revision | 1351 # flush our writes here so we can read it in revision |
1352 if dfh: | 1352 if dfh: |
1353 dfh.flush() | 1353 dfh.flush() |
1354 ifh.flush() | 1354 ifh.flush() |
1355 text = self.revision(chain) | 1355 text = self.revision(chain) |
1356 if len(text) == 0: | 1356 text = mdiff.patch(text, delta) |
1357 # skip over trivial delta header | |
1358 # text == '' in the case of nullrev or punched revision | |
1359 text = buffer(delta, 12) | |
1360 else: | |
1361 text = mdiff.patches(text, [delta]) | |
1362 del delta | 1357 del delta |
1363 chk = self._addrevision(node, text, transaction, link, | 1358 chk = self._addrevision(node, text, transaction, link, |
1364 p1, p2, None, ifh, dfh) | 1359 p1, p2, None, ifh, dfh) |
1365 if not dfh and not self._inline: | 1360 if not dfh and not self._inline: |
1366 # addrevision switched from inline to conventional | 1361 # addrevision switched from inline to conventional |