This method is called to remove DirstateItem from the map.
Each variant have a different implementation (which is … the point).
( )
Alphare |
hg-reviewers |
This method is called to remove DirstateItem from 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 (14 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 |
"""record updated state of an entry""" | """record updated state of an entry""" | ||||
def _insert_entry(self, f, entry): | def _insert_entry(self, f, entry): | ||||
"""add a new dirstate entry (or replace an unrelated one) | """add a new dirstate entry (or replace an unrelated one) | ||||
The fact it is actually new is the responsability of the caller | The fact it is actually new is the responsability of the caller | ||||
""" | """ | ||||
def _drop_entry(self, f): | |||||
"""remove any entry for file f | |||||
This should also drop associated copy information | |||||
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): | 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._refresh_entry(filename, entry) | self._refresh_entry(filename, entry) | ||||
merged=merged, | merged=merged, | ||||
clean_p1=clean_p1, | clean_p1=clean_p1, | ||||
clean_p2=clean_p2, | clean_p2=clean_p2, | ||||
possibly_dirty=possibly_dirty, | possibly_dirty=possibly_dirty, | ||||
parentfiledata=parentfiledata, | parentfiledata=parentfiledata, | ||||
) | ) | ||||
self._map[filename] = entry | self._map[filename] = entry | ||||
def _drop_entry(self, f): | |||||
self._map.pop(f, None) | |||||
self._copymap.pop(f, None) | |||||
if rustmod is not None: | if rustmod is not None: | ||||
class dirstatemap(_dirstatemapcommon): | class dirstatemap(_dirstatemapcommon): | ||||
def __init__(self, ui, opener, root, nodeconstants, use_dirstate_v2): | def __init__(self, ui, opener, root, nodeconstants, use_dirstate_v2): | ||||
super(dirstatemap, self).__init__( | super(dirstatemap, self).__init__( | ||||
ui, opener, root, nodeconstants, use_dirstate_v2 | ui, opener, root, nodeconstants, use_dirstate_v2 | ||||
) | ) | ||||
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): | def _insert_entry(self, f, entry): | ||||
self._map.addfile(f, entry) | self._map.addfile(f, entry) | ||||
def _drop_entry(self, f): | |||||
self._map.drop_item_and_copy_source(f) | |||||
def __setitem__(self, key, value): | def __setitem__(self, key, value): | ||||
assert isinstance(value, DirstateItem) | assert isinstance(value, DirstateItem) | ||||
self._map.set_dirstate_item(key, value) | self._map.set_dirstate_item(key, value) | ||||
def reset_state( | def reset_state( | ||||
self, | self, | ||||
filename, | filename, | ||||
wc_tracked=False, | wc_tracked=False, |