( )⚙ D122 phabricator: add --amend option to phabsend

This is an archive of the discontinued Mercurial Phabricator instance.

phabricator: add --amend option to phabsend
ClosedPublic

Authored by quark on Jul 18 2017, 12:20 AM.

Details

Summary

Previously hg phabsend was imitating hg email and won't mutate
changesets. That works fine with reviewer-push workflow, reviewers run
phabread, import.

However, it does not work well with author-push workflow. Namely, the author
needs to run extra commands to get the right commit message, and remove the
local tag after push.

This patch solves those issues by adding the --amend option, so local
changesets will have the right commit message, and tags become unnecessary.

Test Plan

Given the following DAG:

o  17
o  16
| o  15
| @  14
|/
o  13
o  12

Run hg phabsend '(13::)-17' --amend, check the new DAG looks like:

o  21
| o  20
| @  19
|/
o  18
| o  17
| x  16
| x  13
|/
o  12

And commit messages are updated to contain the Differential Revision lines.
Use phabread to make sure Phabricator has the amended node recorded.

Also check phabsend . followed by a phabsend . --amend, the commit
message will be updated and the tag will be removed.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

quark created this revision.Jul 18 2017, 12:20 AM
mitrandir accepted this revision.Jul 18 2017, 10:31 AM
mitrandir added inline comments.
contrib/phabricator.py
426

I think it would be better to use differential.getcommitmessage for this. For example "reviewed by" field is a really nice thing to have in the commit message.

quark added inline comments.Jul 18 2017, 12:40 PM
contrib/phabricator.py
426

I was trying to make it behave closer to hg email. IIRC reviewers have some other plans to show "who accepts" information (that works for both Phabricator and email submits) on hgweb, so I didn't pay too much attention on "Reviewed By" here.

quark abandoned this revision.Jul 18 2017, 5:37 PM
quark reclaimed this revision.Aug 1 2017, 4:39 PM
quark updated this revision to Diff 485.
quark edited the test plan for this revision. (Show Details)Aug 4 2017, 3:55 PM
quark updated this revision to Diff 553.
quark updated this revision to Diff 568.Aug 4 2017, 6:13 PM
quark updated this revision to Diff 789.Aug 11 2017, 2:37 PM
quark updated this revision to Diff 838.Aug 13 2017, 12:41 AM
This revision was automatically updated to reflect the committed changes.