# HG changeset patch # User Pierre-Yves David # Date 1676898375 -3600 # Node ID 62f633f751a430886805020922799f578450992e # Parent c175b48574986abfe96104588c5126dcc903d66b dirstate: mark `clear` and `rebuild` as `require_changing_parents` Yeah, more scoping! diff -r c175b4857498 -r 62f633f751a4 mercurial/dirstate.py --- a/mercurial/dirstate.py Mon Feb 20 11:37:02 2023 +0100 +++ b/mercurial/dirstate.py Mon Feb 20 14:06:15 2023 +0100 @@ -855,19 +855,15 @@ return self._normalize(path, isknown, ignoremissing) return path - # XXX since this make the dirstate dirty, we should enforce that it is done - # withing an appropriate change-context that scope the change and ensure it - # eventually get written on disk (or rolled back) # XXX this method is barely used, as a result: # - its semantic is unclear # - do we really needs it ? + @requires_changing_parents def clear(self): self._map.clear() self._dirty = True - # XXX since this make the dirstate dirty, we should enforce that it is done - # withing an appropriate change-context that scope the change and ensure it - # eventually get written on disk (or rolled back) + @requires_changing_parents def rebuild(self, parent, allfiles, changedfiles=None): matcher = self._sparsematcher if matcher is not None and not matcher.always():