Mercurial > hg
comparison hgext/narrow/narrowdirstate.py @ 47593:f927ad5a4e2c
dirstate: add a `set_tracked` method for "hg add"-like usage
This is a step further toward clarifying the semantic of various dirstate call.
Having a dedicated function comes with a couple of benefits:
1) we can move duplicated logic about how to handle the previous state within
the dirstate. Since we are sure this is always called in the same situation, we
can implement that logic once in the dirstate.
2) having a dedicated method for this case unlock also having a dedicated
method for the other case and recording more information at that time. All this
leading having more code within the dirstate and higher level API that are less
error prone.
Differential Revision: https://phab.mercurial-scm.org/D11013
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 08 Jul 2021 03:03:34 +0200 |
parents | 687b865b95ad |
children | cce51119bfe6 |
comparison
equal
deleted
inserted
replaced
47592:0f5c203eb5ab | 47593:f927ad5a4e2c |
---|---|
36 @_editfunc | 36 @_editfunc |
37 def normal(self, *args, **kwargs): | 37 def normal(self, *args, **kwargs): |
38 return super(narrowdirstate, self).normal(*args, **kwargs) | 38 return super(narrowdirstate, self).normal(*args, **kwargs) |
39 | 39 |
40 @_editfunc | 40 @_editfunc |
41 def set_tracked(self, *args): | |
42 return super(narrowdirstate, self).set_tracked(*args) | |
43 | |
44 @_editfunc | |
41 def add(self, *args): | 45 def add(self, *args): |
42 return super(narrowdirstate, self).add(*args) | 46 return super(narrowdirstate, self).add(*args) |
43 | 47 |
44 @_editfunc | 48 @_editfunc |
45 def normallookup(self, *args): | 49 def normallookup(self, *args): |