##// END OF EJS Templates
rust-dirstatemap: don't read the dirstate when requesting parents...
Raphaël Gomès -
r45358:18e36ff8 stable
parent child Browse files
Show More
@@ -1743,10 +1743,23 b' if rustmod is not None:'
1743
1743
1744 @propertycache
1744 @propertycache
1745 def _rustmap(self):
1745 def _rustmap(self):
1746 self._rustmap = rustmod.DirstateMap(self._root)
1746 """
1747 Fills the Dirstatemap when called.
1748 Use `self._inner_rustmap` if reading the dirstate is not necessary.
1749 """
1750 self._rustmap = self._inner_rustmap
1747 self.read()
1751 self.read()
1748 return self._rustmap
1752 return self._rustmap
1749
1753
1754 @propertycache
1755 def _inner_rustmap(self):
1756 """
1757 Does not fill the Dirstatemap when called. This allows for
1758 optimizations where only setting/getting the parents is needed.
1759 """
1760 self._inner_rustmap = rustmod.DirstateMap(self._root)
1761 return self._inner_rustmap
1762
1750 @property
1763 @property
1751 def copymap(self):
1764 def copymap(self):
1752 return self._rustmap.copymap()
1765 return self._rustmap.copymap()
@@ -1756,6 +1769,7 b' if rustmod is not None:'
1756
1769
1757 def clear(self):
1770 def clear(self):
1758 self._rustmap.clear()
1771 self._rustmap.clear()
1772 self._inner_rustmap.clear()
1759 self.setparents(nullid, nullid)
1773 self.setparents(nullid, nullid)
1760 util.clearcachedproperty(self, b"_dirs")
1774 util.clearcachedproperty(self, b"_dirs")
1761 util.clearcachedproperty(self, b"_alldirs")
1775 util.clearcachedproperty(self, b"_alldirs")
@@ -1812,7 +1826,7 b' if rustmod is not None:'
1812 st = b''
1826 st = b''
1813
1827
1814 try:
1828 try:
1815 self._parents = self._rustmap.parents(st)
1829 self._parents = self._inner_rustmap.parents(st)
1816 except ValueError:
1830 except ValueError:
1817 raise error.Abort(
1831 raise error.Abort(
1818 _(b'working directory state appears damaged!')
1832 _(b'working directory state appears damaged!')
General Comments 0
You need to be logged in to leave comments. Login now