There exists now a dedicated Rust implementation
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
There exists now a dedicated Rust implementation
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/dirstatemap.py (15 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
515916ab6246 | d402d37ea417 | Raphaël Gomès | Mar 28 2022, 12:10 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 |
"""remove any entry for file f | """remove any entry for file f | ||||
This should also drop associated copy information | This should also drop associated copy information | ||||
The fact we actually need to drop it is the responsability of the caller""" | The fact we actually need to drop it is the responsability of the caller""" | ||||
### method to manipulate the entries | ### method to manipulate the entries | ||||
def set_possibly_dirty(self, filename): | |||||
"""record that the current state of the file on disk is unknown""" | |||||
entry = self[filename] | |||||
entry.set_possibly_dirty() | |||||
self._refresh_entry(filename, entry) | |||||
def set_untracked(self, f): | def set_untracked(self, f): | ||||
"""Mark a file as no longer tracked in the dirstate map""" | """Mark a file as no longer tracked in the dirstate map""" | ||||
entry = self.get(f) | entry = self.get(f) | ||||
if entry is None: | if entry is None: | ||||
return False | return False | ||||
else: | else: | ||||
self._dirs_decr(f, old_entry=entry, remove_variant=not entry.added) | self._dirs_decr(f, old_entry=entry, remove_variant=not entry.added) | ||||
if not entry.p2_info: | if not entry.p2_info: | ||||
def set_clean(self, filename, mode, size, mtime): | def set_clean(self, filename, mode, size, mtime): | ||||
"""mark a file as back to a clean state""" | """mark a file as back to a clean state""" | ||||
entry = self[filename] | entry = self[filename] | ||||
size = size & rangemask | size = size & rangemask | ||||
entry.set_clean(mode, size, mtime) | entry.set_clean(mode, size, mtime) | ||||
self._refresh_entry(filename, entry) | self._refresh_entry(filename, entry) | ||||
self.copymap.pop(filename, None) | self.copymap.pop(filename, None) | ||||
def set_possibly_dirty(self, filename): | |||||
"""record that the current state of the file on disk is unknown""" | |||||
entry = self[filename] | |||||
entry.set_possibly_dirty() | |||||
self._refresh_entry(filename, entry) | |||||
def _refresh_entry(self, f, entry): | def _refresh_entry(self, f, entry): | ||||
if not entry.any_tracked: | if not entry.any_tracked: | ||||
self._map.pop(f, None) | self._map.pop(f, None) | ||||
def _drop_entry(self, f): | def _drop_entry(self, f): | ||||
self._map.pop(f, None) | self._map.pop(f, None) | ||||
self.copymap.pop(f, None) | self.copymap.pop(f, None) | ||||
self._map.addfile(f, entry) | self._map.addfile(f, entry) | ||||
def set_tracked(self, f): | def set_tracked(self, f): | ||||
return self._map.set_tracked(f) | return self._map.set_tracked(f) | ||||
def set_clean(self, filename, mode, size, mtime): | def set_clean(self, filename, mode, size, mtime): | ||||
self._map.set_clean(filename, mode, size, mtime) | self._map.set_clean(filename, mode, size, mtime) | ||||
def set_possibly_dirty(self, f): | |||||
self._map.set_possibly_dirty(f) | |||||
def reset_state( | def reset_state( | ||||
self, | self, | ||||
filename, | filename, | ||||
wc_tracked=False, | wc_tracked=False, | ||||
p1_tracked=False, | p1_tracked=False, | ||||
p2_info=False, | p2_info=False, | ||||
has_meaningful_mtime=True, | has_meaningful_mtime=True, | ||||
parentfiledata=None, | parentfiledata=None, |