They are only used by the Python implementation now
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
They are only used by the Python implementation now
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/dirstatemap.py (23 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
9ea58ab16f11 | 08163fd98097 | Raphaël Gomès | Mar 28 2022, 5:42 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare |
return iter(self._map) | return iter(self._map) | ||||
def __contains__(self, key): | def __contains__(self, key): | ||||
return key in self._map | return key in self._map | ||||
def __getitem__(self, item): | def __getitem__(self, item): | ||||
return self._map[item] | return self._map[item] | ||||
### sub-class utility method | |||||
# | |||||
# Use to allow for generic implementation of some method while still coping | |||||
# with minor difference between implementation. | |||||
def _dirs_incr(self, filename, old_entry=None): | |||||
"""increment the dirstate counter if applicable | |||||
This might be a no-op for some subclasses who deal with directory | |||||
tracking in a different way. | |||||
""" | |||||
def _dirs_decr(self, filename, old_entry=None, remove_variant=False): | |||||
"""decrement the dirstate counter if applicable | |||||
This might be a no-op for some subclasses who deal with directory | |||||
tracking in a different way. | |||||
""" | |||||
### disk interaction | ### disk interaction | ||||
def _opendirstatefile(self): | def _opendirstatefile(self): | ||||
fp, mode = txnutil.trypending(self._root, self._opener, self._filename) | fp, mode = txnutil.trypending(self._root, self._opener, self._filename) | ||||
if self._pendingmode is not None and self._pendingmode != mode: | if self._pendingmode is not None and self._pendingmode != mode: | ||||
fp.close() | fp.close() | ||||
raise error.Abort( | raise error.Abort( | ||||
_(b'working directory state may be changed parallelly') | _(b'working directory state may be changed parallelly') | ||||
def identity(self): | def identity(self): | ||||
self._map | self._map | ||||
return self.identity | return self.identity | ||||
### code related to maintaining and accessing "extra" property | ### code related to maintaining and accessing "extra" property | ||||
# (e.g. "has_dir") | # (e.g. "has_dir") | ||||
def _dirs_incr(self, filename, old_entry=None): | def _dirs_incr(self, filename, old_entry=None): | ||||
"""incremente the dirstate counter if applicable""" | """increment the dirstate counter if applicable""" | ||||
if ( | if ( | ||||
old_entry is None or old_entry.removed | old_entry is None or old_entry.removed | ||||
) and "_dirs" in self.__dict__: | ) and "_dirs" in self.__dict__: | ||||
self._dirs.addpath(filename) | self._dirs.addpath(filename) | ||||
if old_entry is None and "_alldirs" in self.__dict__: | if old_entry is None and "_alldirs" in self.__dict__: | ||||
self._alldirs.addpath(filename) | self._alldirs.addpath(filename) | ||||
def _dirs_decr(self, filename, old_entry=None, remove_variant=False): | def _dirs_decr(self, filename, old_entry=None, remove_variant=False): | ||||
"""decremente the dirstate counter if applicable""" | """decrement the dirstate counter if applicable""" | ||||
if old_entry is not None: | if old_entry is not None: | ||||
if "_dirs" in self.__dict__ and not old_entry.removed: | if "_dirs" in self.__dict__ and not old_entry.removed: | ||||
self._dirs.delpath(filename) | self._dirs.delpath(filename) | ||||
if "_alldirs" in self.__dict__ and not remove_variant: | if "_alldirs" in self.__dict__ and not remove_variant: | ||||
self._alldirs.delpath(filename) | self._alldirs.delpath(filename) | ||||
elif remove_variant and "_alldirs" in self.__dict__: | elif remove_variant and "_alldirs" in self.__dict__: | ||||
self._alldirs.addpath(filename) | self._alldirs.addpath(filename) | ||||
if "filefoldmap" in self.__dict__: | if "filefoldmap" in self.__dict__: |