comparison contrib/phabricator.py @ 33975:07ffff841863

phabsend: make --amend the default The local tag feature was intended to make `phabsend` closer to `email` workflow. But its experience is not great in multiple ways: - after rebase, obsoleted changesets are still visible because of tags - without obsstore, the association information will get lost - even with obsstore, things could go wrong with graft, export+import - no easy way to tell which Differential Revision a commit is associated Therefore make `--amend` the default. People wanting the old behavior can use `--no-amend`. Differential Revision: https://phab.mercurial-scm.org/D511
author Jun Wu <quark@fb.com>
date Thu, 24 Aug 2017 16:52:28 -0700
parents 45a8cd74de4e
children 27ff2a87d8c0
comparison
equal deleted inserted replaced
33974:45a8cd74de4e 33975:07ffff841863
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version. 6 # GNU General Public License version 2 or any later version.
7 """simple Phabricator integration 7 """simple Phabricator integration
8 8
9 This extension provides a ``phabsend`` command which sends a stack of 9 This extension provides a ``phabsend`` command which sends a stack of
10 changesets to Phabricator without amending commit messages, and a ``phabread`` 10 changesets to Phabricator, and a ``phabread`` command which prints a stack of
11 command which prints a stack of revisions in a format suitable 11 revisions in a format suitable for :hg:`import`, and a ``phabupdate`` command
12 for :hg:`import`, and a ``phabupdate`` command to update statuses in batch. 12 to update statuses in batch.
13 13
14 By default, Phabricator requires ``Test Plan`` which might prevent some 14 By default, Phabricator requires ``Test Plan`` which might prevent some
15 changeset from being sent. The requirement could be disabled by changing 15 changeset from being sent. The requirement could be disabled by changing
16 ``differential.require-test-plan-field`` config server side. 16 ``differential.require-test-plan-field`` config server side.
17 17
337 % ' '.join(sorted(unresolved))) 337 % ' '.join(sorted(unresolved)))
338 return [entry[r'phid'] for entry in data] 338 return [entry[r'phid'] for entry in data]
339 339
340 @command('phabsend', 340 @command('phabsend',
341 [('r', 'rev', [], _('revisions to send'), _('REV')), 341 [('r', 'rev', [], _('revisions to send'), _('REV')),
342 ('', 'amend', False, _('update commit messages')), 342 ('', 'amend', True, _('update commit messages')),
343 ('', 'reviewer', [], _('specify reviewers')), 343 ('', 'reviewer', [], _('specify reviewers')),
344 ('', 'confirm', None, _('ask for confirmation before sending'))], 344 ('', 'confirm', None, _('ask for confirmation before sending'))],
345 _('REV [OPTIONS]')) 345 _('REV [OPTIONS]'))
346 def phabsend(ui, repo, *revs, **opts): 346 def phabsend(ui, repo, *revs, **opts):
347 """upload changesets to Phabricator 347 """upload changesets to Phabricator