Changeset View
Changeset View
Standalone View
Standalone View
mercurial/dirstate.py
Show First 20 Lines • Show All 465 Lines • ▼ Show 20 Line(s) | class dirstate(object): | ||||
def set_tracked(self, filename): | def set_tracked(self, filename): | ||||
"""a "public" method for generic code to mark a file as tracked | """a "public" method for generic code to mark a file as tracked | ||||
This function is to be called outside of "update/merge" case. For | This function is to be called outside of "update/merge" case. For | ||||
example by a command like `hg add X`. | example by a command like `hg add X`. | ||||
return True the file was previously untracked, False otherwise. | return True the file was previously untracked, False otherwise. | ||||
""" | """ | ||||
self._dirty = True | |||||
self._updatedfiles.add(filename) | |||||
entry = self._map.get(filename) | entry = self._map.get(filename) | ||||
if entry is None: | if entry is None: | ||||
self._add(filename) | self._check_new_tracked_filename(filename) | ||||
self._map.addfile(filename, added=True) | |||||
return True | return True | ||||
elif not entry.tracked: | elif not entry.tracked: | ||||
self._normallookup(filename) | self._normallookup(filename) | ||||
return True | return True | ||||
# XXX This is probably overkill for more case, but we need this to | # XXX This is probably overkill for more case, but we need this to | ||||
# fully replace the `normallookup` call with `set_tracked` one. | # fully replace the `normallookup` call with `set_tracked` one. | ||||
# Consider smoothing this in the future. | # Consider smoothing this in the future. | ||||
self.set_possibly_dirty(filename) | self.set_possibly_dirty(filename) | ||||
▲ Show 20 Lines • Show All 1129 Lines • Show Last 20 Lines |