uncommit uses match as argument which serves the purpose of optimizer for _fixdirstate() . This adds a similar optimization for unamend.
Details
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
unamend: made match optional in firdirstate()
Typo'd "_fixdirstate"
Also, the matcher has been optional since D5661, so the description seems wrong. The commit message should also explain the reason for the patch, unless that's obvious (things like "remove unused argument 'foo' for bar()" don't need a motivation, IMO).
hgext/uncommit.py | ||
---|---|---|
223 | I don't think hg unamend accepts path arguments, so this matcher will always match everything, right? |
hgext/uncommit.py | ||
---|---|---|
223 | sorry missed that went through the code of scmutil.match just now. |
Could you choose the "Abandon Revision" action on this patch so it's clear that it's not meant to be queued?
I have added '*pats' as argument for unamend() , won't it serve as an optimisation now ?
Earlier it didn't but now it can I suppose it should after the modification. Is there supposed to be any other way to verify it ?(the tests pass successfully)
The @command decorator defines what arguments that command accepts. In this case, it's an empty list (on line 167), which means it accepts no arguments.
Is there supposed to be any other way to verify it ?
You can simply run the command and see how it works. If you're in the root of the hg repo, just try this:
$ ./hg unamend foo hg unamend: invalid arguments hg unamend undo the most recent amend operation on a current changeset (use 'hg unamend -h' to show more help)
(the tests pass successfully)
I haven't checked, but I assume there are no tests for hg unamend <file> (or if there are, it still fails with the error I showed above).
I don't think hg unamend accepts path arguments, so this matcher will always match everything, right?