Show More
@@ -16,6 +16,8 b' from .i18n import _' | |||
|
16 | 16 | from .node import ( |
|
17 | 17 | bin, |
|
18 | 18 | hex, |
|
19 | nullid, | |
|
20 | nullrev, | |
|
19 | 21 | ) |
|
20 | 22 | from . import ( |
|
21 | 23 | error, |
@@ -55,12 +57,11 b' def _parse(data):' | |||
|
55 | 57 | def _text(it): |
|
56 | 58 | files = [] |
|
57 | 59 | lines = [] |
|
58 | _hex = revlog.hex | |
|
59 | 60 | for f, n, fl in it: |
|
60 | 61 | files.append(f) |
|
61 | 62 | # if this is changed to support newlines in filenames, |
|
62 | 63 | # be sure to check the templates/ dir again (especially *-raw.tmpl) |
|
63 |
lines.append("%s\0%s%s\n" % (f, |
|
|
64 | lines.append("%s\0%s%s\n" % (f, hex(n), fl)) | |
|
64 | 65 | |
|
65 | 66 | _checkforbidden(files) |
|
66 | 67 | return ''.join(lines) |
@@ -566,7 +567,7 b' class manifestdict(object):' | |||
|
566 | 567 | start, end = _msearch(addbuf, f, start) |
|
567 | 568 | if not todelete: |
|
568 | 569 | h, fl = self._lm[f] |
|
569 |
l = "%s\0%s%s\n" % (f, |
|
|
570 | l = "%s\0%s%s\n" % (f, hex(h), fl) | |
|
570 | 571 | else: |
|
571 | 572 | if start == end: |
|
572 | 573 | # item we want to delete was not found, error out |
@@ -680,7 +681,7 b' def _splittopdir(f):' | |||
|
680 | 681 | class treemanifest(object): |
|
681 | 682 | def __init__(self, dir='', text=''): |
|
682 | 683 | self._dir = dir |
|
683 |
self._node = |
|
|
684 | self._node = nullid | |
|
684 | 685 | self._loadfunc = _noop |
|
685 | 686 | self._copyfunc = _noop |
|
686 | 687 | self._dirty = False |
@@ -718,7 +719,7 b' class treemanifest(object):' | |||
|
718 | 719 | |
|
719 | 720 | def __repr__(self): |
|
720 | 721 | return ('<treemanifest dir=%s, node=%s, loaded=%s, dirty=%s at 0x%x>' % |
|
721 |
(self._dir, |
|
|
722 | (self._dir, hex(self._node), | |
|
722 | 723 | bool(self._loadfunc is _noop), |
|
723 | 724 | self._dirty, id(self))) |
|
724 | 725 | |
@@ -1117,7 +1118,7 b' class treemanifest(object):' | |||
|
1117 | 1118 | for d, subm in self._dirs.iteritems(): |
|
1118 | 1119 | subp1 = m1._dirs.get(d, emptytree)._node |
|
1119 | 1120 | subp2 = m2._dirs.get(d, emptytree)._node |
|
1120 |
if subp1 == |
|
|
1121 | if subp1 == nullid: | |
|
1121 | 1122 | subp1, subp2 = subp2, subp1 |
|
1122 | 1123 | writesubtree(subm, subp1, subp2) |
|
1123 | 1124 | |
@@ -1557,7 +1558,7 b' class manifestlog(object):' | |||
|
1557 | 1558 | else: |
|
1558 | 1559 | m = manifestctx(self, node) |
|
1559 | 1560 | |
|
1560 |
if node != |
|
|
1561 | if node != nullid: | |
|
1561 | 1562 | mancache = self._dirmancache.get(tree) |
|
1562 | 1563 | if not mancache: |
|
1563 | 1564 | mancache = util.lrucachedict(self._cachesize) |
@@ -1637,7 +1638,7 b' class manifestctx(object):' | |||
|
1637 | 1638 | |
|
1638 | 1639 | def read(self): |
|
1639 | 1640 | if self._data is None: |
|
1640 |
if self._node == |
|
|
1641 | if self._node == nullid: | |
|
1641 | 1642 | self._data = manifestdict() |
|
1642 | 1643 | else: |
|
1643 | 1644 | rl = self._revlog() |
@@ -1660,7 +1661,7 b' class manifestctx(object):' | |||
|
1660 | 1661 | rl = self._revlog() |
|
1661 | 1662 | r = rl.rev(self._node) |
|
1662 | 1663 | deltaparent = rl.deltaparent(r) |
|
1663 |
if deltaparent != |
|
|
1664 | if deltaparent != nullrev and deltaparent in rl.parentrevs(r): | |
|
1664 | 1665 | return self.readdelta() |
|
1665 | 1666 | return self.read() |
|
1666 | 1667 | |
@@ -1732,7 +1733,7 b' class treemanifestctx(object):' | |||
|
1732 | 1733 | def read(self): |
|
1733 | 1734 | if self._data is None: |
|
1734 | 1735 | rl = self._revlog() |
|
1735 |
if self._node == |
|
|
1736 | if self._node == nullid: | |
|
1736 | 1737 | self._data = treemanifest() |
|
1737 | 1738 | elif rl._treeondisk: |
|
1738 | 1739 | m = treemanifest(dir=self._dir) |
@@ -1811,7 +1812,7 b' class treemanifestctx(object):' | |||
|
1811 | 1812 | rl = self._revlog() |
|
1812 | 1813 | r = rl.rev(self._node) |
|
1813 | 1814 | deltaparent = rl.deltaparent(r) |
|
1814 |
if (deltaparent != |
|
|
1815 | if (deltaparent != nullrev and | |
|
1815 | 1816 | deltaparent in rl.parentrevs(r)): |
|
1816 | 1817 | return self.readdelta(shallow=shallow) |
|
1817 | 1818 |
General Comments 0
You need to be logged in to leave comments.
Login now