Mercurial > hg
comparison mercurial/dirstate.py @ 47094:e061a1df32a8
dirstate-tree: Abstract "non-normal" and "other parent" sets
Instead of exposing `HashSet`s directly, have slightly higher-level
methods for the operations that Python bindings need on them.
Differential Revision: https://phab.mercurial-scm.org/D10363
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Thu, 08 Apr 2021 14:58:44 +0200 |
parents | d55b71393907 |
children | 473abf4728bf |
comparison
equal
deleted
inserted
replaced
47093:787ff5d21bcd | 47094:e061a1df32a8 |
---|---|
338 copies = {} | 338 copies = {} |
339 if ( | 339 if ( |
340 oldp2 != self._nodeconstants.nullid | 340 oldp2 != self._nodeconstants.nullid |
341 and p2 == self._nodeconstants.nullid | 341 and p2 == self._nodeconstants.nullid |
342 ): | 342 ): |
343 candidatefiles = self._map.nonnormalset.union( | 343 candidatefiles = self._map.non_normal_or_other_parent_paths() |
344 self._map.otherparentset | 344 |
345 ) | |
346 for f in candidatefiles: | 345 for f in candidatefiles: |
347 s = self._map.get(f) | 346 s = self._map.get(f) |
348 if s is None: | 347 if s is None: |
349 continue | 348 continue |
350 | 349 |
1723 def otherparentset(self): | 1722 def otherparentset(self): |
1724 nonnorm, otherparents = self.nonnormalentries() | 1723 nonnorm, otherparents = self.nonnormalentries() |
1725 self.nonnormalset = nonnorm | 1724 self.nonnormalset = nonnorm |
1726 return otherparents | 1725 return otherparents |
1727 | 1726 |
1727 def non_normal_or_other_parent_paths(self): | |
1728 return self.nonnormalset.union(self.otherparentset) | |
1729 | |
1728 @propertycache | 1730 @propertycache |
1729 def identity(self): | 1731 def identity(self): |
1730 self._map | 1732 self._map |
1731 return self.identity | 1733 return self.identity |
1732 | 1734 |
1937 @propertycache | 1939 @propertycache |
1938 def otherparentset(self): | 1940 def otherparentset(self): |
1939 otherparents = self._rustmap.other_parent_entries() | 1941 otherparents = self._rustmap.other_parent_entries() |
1940 return otherparents | 1942 return otherparents |
1941 | 1943 |
1944 def non_normal_or_other_parent_paths(self): | |
1945 return self._rustmap.non_normal_or_other_parent_paths() | |
1946 | |
1942 @propertycache | 1947 @propertycache |
1943 def dirfoldmap(self): | 1948 def dirfoldmap(self): |
1944 f = {} | 1949 f = {} |
1945 normcase = util.normcase | 1950 normcase = util.normcase |
1946 for name in self._dirs: | 1951 for name in self._dirs: |