This method is called to add a new DirstateItem to the map.
Each variant have a different implementation (which is … the point).
Alphare |
hg-reviewers |
This method is called to add a new DirstateItem to the map.
Each variant have a different implementation (which is … the point).
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/dirstatemap.py (12 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | SimonSapin | ||
Closed | SimonSapin | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Abandoned | pulkit | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute |
This might be a no-op for some subclass who deal with directory | This might be a no-op for some subclass who deal with directory | ||||
tracking in a different way. | tracking in a different way. | ||||
""" | """ | ||||
def _refresh_entry(self, f, entry): | def _refresh_entry(self, f, entry): | ||||
"""record updated state of an entry""" | """record updated state of an entry""" | ||||
def _insert_entry(self, f, entry): | |||||
"""add a new dirstate entry (or replace an unrelated one) | |||||
The fact it is actually new is the responsability of the caller | |||||
""" | |||||
### method to manipulate the entries | ### method to manipulate the entries | ||||
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: | ||||
return pathutil.dirs(self._map) | return pathutil.dirs(self._map) | ||||
### code related to manipulation of entries and copy-sources | ### code related to manipulation of entries and copy-sources | ||||
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 _insert_entry(self, f, entry): | |||||
self._map[f] = entry | |||||
def set_possibly_dirty(self, filename): | def set_possibly_dirty(self, filename): | ||||
"""record that the current state of the file on disk is unknown""" | """record that the current state of the file on disk is unknown""" | ||||
self[filename].set_possibly_dirty() | self[filename].set_possibly_dirty() | ||||
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] | ||||
mtime = mtime & rangemask | mtime = mtime & rangemask | ||||
### code related to manipulation of entries and copy-sources | ### code related to manipulation of entries and copy-sources | ||||
def _refresh_entry(self, f, entry): | def _refresh_entry(self, f, entry): | ||||
if not entry.any_tracked: | if not entry.any_tracked: | ||||
self._map.drop_item_and_copy_source(f) | self._map.drop_item_and_copy_source(f) | ||||
else: | else: | ||||
self._map.addfile(f, entry) | self._map.addfile(f, entry) | ||||
def _insert_entry(self, f, entry): | |||||
self._map.addfile(f, entry) | |||||
def set_possibly_dirty(self, filename): | def set_possibly_dirty(self, filename): | ||||
"""record that the current state of the file on disk is unknown""" | """record that the current state of the file on disk is unknown""" | ||||
entry = self[filename] | entry = self[filename] | ||||
entry.set_possibly_dirty() | entry.set_possibly_dirty() | ||||
self._map.set_dirstate_item(filename, entry) | self._map.set_dirstate_item(filename, entry) | ||||
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""" |