Show More
@@ -1582,7 +1582,7 b' class memmanifestctx(object):' | |||
|
1582 | 1582 | self._manifestlog = manifestlog |
|
1583 | 1583 | self._manifestdict = manifestdict() |
|
1584 | 1584 | |
|
1585 |
def _re |
|
|
1585 | def _storage(self): | |
|
1586 | 1586 | return self._manifestlog._revlog |
|
1587 | 1587 | |
|
1588 | 1588 | def new(self): |
@@ -1597,8 +1597,8 b' class memmanifestctx(object):' | |||
|
1597 | 1597 | return self._manifestdict |
|
1598 | 1598 | |
|
1599 | 1599 | def write(self, transaction, link, p1, p2, added, removed): |
|
1600 |
return self._re |
|
|
1601 | added, removed) | |
|
1600 | return self._storage().add(self._manifestdict, transaction, link, | |
|
1601 | p1, p2, added, removed) | |
|
1602 | 1602 | |
|
1603 | 1603 | @interfaceutil.implementer(repository.imanifestrevisionstored) |
|
1604 | 1604 | class manifestctx(object): |
@@ -1614,11 +1614,11 b' class manifestctx(object):' | |||
|
1614 | 1614 | # TODO: We eventually want p1, p2, and linkrev exposed on this class, |
|
1615 | 1615 | # but let's add it later when something needs it and we can load it |
|
1616 | 1616 | # lazily. |
|
1617 |
#self.p1, self.p2 = re |
|
|
1618 |
#rev = re |
|
|
1619 |
#self.linkrev = re |
|
|
1617 | #self.p1, self.p2 = store.parents(node) | |
|
1618 | #rev = store.rev(node) | |
|
1619 | #self.linkrev = store.linkrev(rev) | |
|
1620 | 1620 | |
|
1621 |
def _re |
|
|
1621 | def _storage(self): | |
|
1622 | 1622 | return self._manifestlog._revlog |
|
1623 | 1623 | |
|
1624 | 1624 | def node(self): |
@@ -1634,20 +1634,21 b' class manifestctx(object):' | |||
|
1634 | 1634 | |
|
1635 | 1635 | @propertycache |
|
1636 | 1636 | def parents(self): |
|
1637 |
return self._re |
|
|
1637 | return self._storage().parents(self._node) | |
|
1638 | 1638 | |
|
1639 | 1639 | def read(self): |
|
1640 | 1640 | if self._data is None: |
|
1641 | 1641 | if self._node == nullid: |
|
1642 | 1642 | self._data = manifestdict() |
|
1643 | 1643 | else: |
|
1644 |
|
|
|
1645 | if self._node in rl._fulltextcache: | |
|
1646 | text = pycompat.bytestr(rl._fulltextcache[self._node]) | |
|
1644 | store = self._storage() | |
|
1645 | # TODO accessing non-public API. | |
|
1646 | if self._node in store._fulltextcache: | |
|
1647 | text = pycompat.bytestr(store._fulltextcache[self._node]) | |
|
1647 | 1648 | else: |
|
1648 |
text = |
|
|
1649 | text = store.revision(self._node) | |
|
1649 | 1650 | arraytext = bytearray(text) |
|
1650 |
|
|
|
1651 | store._fulltextcache[self._node] = arraytext | |
|
1651 | 1652 | self._data = manifestdict(text) |
|
1652 | 1653 | return self._data |
|
1653 | 1654 | |
@@ -1658,10 +1659,10 b' class manifestctx(object):' | |||
|
1658 | 1659 | |
|
1659 | 1660 | If `shallow` is True, nothing changes since this is a flat manifest. |
|
1660 | 1661 | ''' |
|
1661 |
|
|
|
1662 |
r = |
|
|
1663 |
deltaparent = |
|
|
1664 |
if deltaparent != nullrev and deltaparent in |
|
|
1662 | store = self._storage() | |
|
1663 | r = store.rev(self._node) | |
|
1664 | deltaparent = store.deltaparent(r) | |
|
1665 | if deltaparent != nullrev and deltaparent in store.parentrevs(r): | |
|
1665 | 1666 | return self.readdelta() |
|
1666 | 1667 | return self.read() |
|
1667 | 1668 | |
@@ -1672,9 +1673,9 b' class manifestctx(object):' | |||
|
1672 | 1673 | |
|
1673 | 1674 | Changing the value of `shallow` has no effect on flat manifests. |
|
1674 | 1675 | ''' |
|
1675 |
re |
|
|
1676 |
r = re |
|
|
1677 |
d = mdiff.patchtext(re |
|
|
1676 | store = self._storage() | |
|
1677 | r = store.rev(self._node) | |
|
1678 | d = mdiff.patchtext(store.revdiff(store.deltaparent(r), r)) | |
|
1678 | 1679 | return manifestdict(d) |
|
1679 | 1680 | |
|
1680 | 1681 | def find(self, key): |
@@ -1687,7 +1688,7 b' class memtreemanifestctx(object):' | |||
|
1687 | 1688 | self._dir = dir |
|
1688 | 1689 | self._treemanifest = treemanifest() |
|
1689 | 1690 | |
|
1690 |
def _re |
|
|
1691 | def _storage(self): | |
|
1691 | 1692 | return self._manifestlog._revlog |
|
1692 | 1693 | |
|
1693 | 1694 | def new(self, dir=''): |
@@ -1704,8 +1705,8 b' class memtreemanifestctx(object):' | |||
|
1704 | 1705 | def write(self, transaction, link, p1, p2, added, removed): |
|
1705 | 1706 | def readtree(dir, node): |
|
1706 | 1707 | return self._manifestlog.get(dir, node).read() |
|
1707 |
return self._re |
|
|
1708 | added, removed, readtree=readtree) | |
|
1708 | return self._storage().add(self._treemanifest, transaction, link, | |
|
1709 | p1, p2, added, removed, readtree=readtree) | |
|
1709 | 1710 | |
|
1710 | 1711 | @interfaceutil.implementer(repository.imanifestrevisionstored) |
|
1711 | 1712 | class treemanifestctx(object): |
@@ -1719,11 +1720,11 b' class treemanifestctx(object):' | |||
|
1719 | 1720 | # TODO: Load p1/p2/linkrev lazily. They need to be lazily loaded so that |
|
1720 | 1721 | # we can instantiate treemanifestctx objects for directories we don't |
|
1721 | 1722 | # have on disk. |
|
1722 |
#self.p1, self.p2 = re |
|
|
1723 |
#rev = re |
|
|
1724 |
#self.linkrev = re |
|
|
1723 | #self.p1, self.p2 = store.parents(node) | |
|
1724 | #rev = store.rev(node) | |
|
1725 | #self.linkrev = store.linkrev(rev) | |
|
1725 | 1726 | |
|
1726 |
def _re |
|
|
1727 | def _storage(self): | |
|
1727 | 1728 | narrowmatch = self._manifestlog._narrowmatch |
|
1728 | 1729 | if not narrowmatch.always(): |
|
1729 | 1730 | if not narrowmatch.visitdir(self._dir[:-1] or '.'): |
@@ -1732,13 +1733,14 b' class treemanifestctx(object):' | |||
|
1732 | 1733 | |
|
1733 | 1734 | def read(self): |
|
1734 | 1735 | if self._data is None: |
|
1735 |
|
|
|
1736 | store = self._storage() | |
|
1736 | 1737 | if self._node == nullid: |
|
1737 | 1738 | self._data = treemanifest() |
|
1738 | elif rl._treeondisk: | |
|
1739 | # TODO accessing non-public API | |
|
1740 | elif store._treeondisk: | |
|
1739 | 1741 | m = treemanifest(dir=self._dir) |
|
1740 | 1742 | def gettext(): |
|
1741 |
return |
|
|
1743 | return store.revision(self._node) | |
|
1742 | 1744 | def readsubtree(dir, subm): |
|
1743 | 1745 | # Set verify to False since we need to be able to create |
|
1744 | 1746 | # subtrees for trees that don't exist on disk. |
@@ -1747,12 +1749,12 b' class treemanifestctx(object):' | |||
|
1747 | 1749 | m.setnode(self._node) |
|
1748 | 1750 | self._data = m |
|
1749 | 1751 | else: |
|
1750 |
if self._node in |
|
|
1751 |
text = pycompat.bytestr( |
|
|
1752 | if self._node in store.fulltextcache: | |
|
1753 | text = pycompat.bytestr(store.fulltextcache[self._node]) | |
|
1752 | 1754 | else: |
|
1753 |
text = |
|
|
1755 | text = store.revision(self._node) | |
|
1754 | 1756 | arraytext = bytearray(text) |
|
1755 |
|
|
|
1757 | store.fulltextcache[self._node] = arraytext | |
|
1756 | 1758 | self._data = treemanifest(dir=self._dir, text=text) |
|
1757 | 1759 | |
|
1758 | 1760 | return self._data |
@@ -1770,7 +1772,7 b' class treemanifestctx(object):' | |||
|
1770 | 1772 | |
|
1771 | 1773 | @propertycache |
|
1772 | 1774 | def parents(self): |
|
1773 |
return self._re |
|
|
1775 | return self._storage().parents(self._node) | |
|
1774 | 1776 | |
|
1775 | 1777 | def readdelta(self, shallow=False): |
|
1776 | 1778 | '''Returns a manifest containing just the entries that are present |
@@ -1783,15 +1785,15 b' class treemanifestctx(object):' | |||
|
1783 | 1785 | the subdirectory will be reported among files and distinguished only by |
|
1784 | 1786 | its 't' flag. |
|
1785 | 1787 | ''' |
|
1786 |
re |
|
|
1788 | store = self._storage() | |
|
1787 | 1789 | if shallow: |
|
1788 |
r = re |
|
|
1789 |
d = mdiff.patchtext(re |
|
|
1790 | r = store.rev(self._node) | |
|
1791 | d = mdiff.patchtext(store.revdiff(store.deltaparent(r), r)) | |
|
1790 | 1792 | return manifestdict(d) |
|
1791 | 1793 | else: |
|
1792 | 1794 | # Need to perform a slow delta |
|
1793 |
r0 = re |
|
|
1794 |
m0 = self._manifestlog.get(self._dir, re |
|
|
1795 | r0 = store.deltaparent(store.rev(self._node)) | |
|
1796 | m0 = self._manifestlog.get(self._dir, store.node(r0)).read() | |
|
1795 | 1797 | m1 = self.read() |
|
1796 | 1798 | md = treemanifest(dir=self._dir) |
|
1797 | 1799 | for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems(): |
@@ -1809,15 +1811,15 b' class treemanifestctx(object):' | |||
|
1809 | 1811 | If `shallow` is True, it only returns the entries from this manifest, |
|
1810 | 1812 | and not any submanifests. |
|
1811 | 1813 | ''' |
|
1812 |
|
|
|
1813 |
r = |
|
|
1814 |
deltaparent = |
|
|
1814 | store = self._storage() | |
|
1815 | r = store.rev(self._node) | |
|
1816 | deltaparent = store.deltaparent(r) | |
|
1815 | 1817 | if (deltaparent != nullrev and |
|
1816 |
deltaparent in |
|
|
1818 | deltaparent in store.parentrevs(r)): | |
|
1817 | 1819 | return self.readdelta(shallow=shallow) |
|
1818 | 1820 | |
|
1819 | 1821 | if shallow: |
|
1820 |
return manifestdict( |
|
|
1822 | return manifestdict(store.revision(self._node)) | |
|
1821 | 1823 | else: |
|
1822 | 1824 | return self.read() |
|
1823 | 1825 |
General Comments 0
You need to be logged in to leave comments.
Login now