Yuya Nishihara <yuya@tcha.org> [Mon, 29 Aug 2016 00:00:05 +0900] rev 29882
formatter: add context manager interface for convenience
And port "hg files" to test it.
As you can see, extra indent is necessary to port to this API. I don't think
we should switch every fm.formatter() call to "with" statement.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 26 Aug 2016 21:06:31 +0200] rev 29881
histedit: remove now unused 'constraints' related code
Now that the one action that need different logic handle that using inheritance
and overriding, we can remove that code.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 26 Aug 2016 21:00:33 +0200] rev 29880
histedt: use inheritance to override the constraints in 'base'
All actions but one actually have the same constraints when it comes to validate
the 'action.node' value. So we actually just add this code to a method that can
be overwritten in the one action where it matters.
The now unused 'contraints' related enum and class attribute will be cleaned up
in the next changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 26 Aug 2016 20:54:52 +0200] rev 29879
histedit: move constraint verification to the 'action.verify' method
Action has a method dedicated to verifying its validity. So we move code
related to constrains into that method. This requires a bit more context to the
'verify' method in the same fashion we were passing the 'prev' argument.
This is an extra step before we can simplify the constraint handling code
further.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 26 Aug 2016 20:54:32 +0200] rev 29878
histedit: directly use node in 'verifyactions'
It does not seem useful to convert to hex: it is an extra step and they are
longer strings. So we stick to node for the logic. We only convert to short hex
for error when needed. As a nice side effect this remove the explicit constant
usage in'[12:]'. This will also help moving the code around later as we just
have to access action.node.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 26 Aug 2016 20:42:18 +0200] rev 29877
histedit: temporarily shorten name of 'constraints' variable
An upcoming changeset will make the line where this variable is used
slightly too long. Other later changesets will clean that up further and makes
the variable unnecessary, so this is only temporary and it does seems useful to
put anything more complicate in place.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 26 Aug 2016 20:38:37 +0200] rev 29876
histedit: drop the 'nodetoverify' local variable
We can just use 'action.node'.