This patch splits the code into of commands.graft() into cmdutil.finishgraft()
which deals with the execution of graft once revs are generated and cmdutil.continuegraftstate() which updates opts from graftstate file
when graft is continued from an interrupted state.
Details
- Reviewers
durin42 baymax - Group Reviewers
hg-reviewers
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
I just found a comment I wrote a while ago and forgot to submit. Sorry.
mercurial/cmdutil.py | ||
---|---|---|
3495–3508 | I think we generally avoid having functions mutate inputs and instead make them return the new value. The usual reason for mutating instead is for speed, but that should not be an issue here. The side-effect is especially non-obvious (when looking at call site) since the function has a return value (if it had not had one, the reader would probably assume there must be some side-effect). |
mercurial/cmdutil.py | ||
---|---|---|
3431 | let's initialize graftstate only where we need it. | |
3495 | the function name is not correct with respect to what it does, maybe something like getopts or something. Also, we no longer update the opts, so we can drop that as argument and also need to update the function description. |
mercurial/cmdutil.py | ||
---|---|---|
3495 | I havent removed opts from argument yet. |
mercurial/cmdutil.py | ||
---|---|---|
3497 | This function is still mutating the opts parameter. You could fix that by doing opts=dict(opts) on the first line if you want, or otherwise making a copy. |
Turned out I have an unsubmitted comment. Also, the codebase was recently formatted, so these patches will need to be rebased. https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-October/134537.html should help
mercurial/cmdutil.py | ||
---|---|---|
3431 | I meant near line 3477 on this side. |
There seems to have been no activities on this Diff for the past 3 Months.
By policy, we are automatically moving it out of the need-review state.
Please, move it back to need-review without hesitation if this diff should still be discussed.
:baymax:need-review-idle:
let's initialize graftstate only where we need it.