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