Mercurial > public > mercurial-scm > hg-stable
comparison contrib/phabricator.py @ 33995:edeb8f28c031
phabsend: print the actual URL with --confirm
Sometimes people have multiple Phabricator endpoints set in multiple repos.
It seems better for `--confirm` to prompt about the Phabricator endpoint
patches being sent to.
Differential Revision: https://phab.mercurial-scm.org/D513
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 24 Aug 2017 17:31:33 -0700 |
parents | 27ff2a87d8c0 |
children | 088598153aa2 |
comparison
equal
deleted
inserted
replaced
33994:27ff2a87d8c0 | 33995:edeb8f28c031 |
---|---|
473 # consistent with "hg export" output. | 473 # consistent with "hg export" output. |
474 _metanamemap = util.sortdict([(r'user', 'User'), (r'date', 'Date'), | 474 _metanamemap = util.sortdict([(r'user', 'User'), (r'date', 'Date'), |
475 (r'node', 'Node ID'), (r'parent', 'Parent ')]) | 475 (r'node', 'Node ID'), (r'parent', 'Parent ')]) |
476 | 476 |
477 def _confirmbeforesend(repo, revs): | 477 def _confirmbeforesend(repo, revs): |
478 url, token = readurltoken(repo) | |
478 ui = repo.ui | 479 ui = repo.ui |
479 for rev in revs: | 480 for rev in revs: |
480 ctx = repo[rev] | 481 ctx = repo[rev] |
481 desc = ctx.description().splitlines()[0] | 482 desc = ctx.description().splitlines()[0] |
482 ui.write(('%d: ' % rev), label='phabsend.revnumber') | 483 ui.write(('%d: ' % rev), label='phabsend.revnumber') |
483 ui.write(('%s\n' % desc), label='phabsend.desc') | 484 ui.write(('%s\n' % desc), label='phabsend.desc') |
484 | 485 |
485 if ui.promptchoice(_('Phabsend the above changes (yn)?' | 486 if ui.promptchoice(_('Send the above changes to %s (yn)?' |
486 '$$ &Yes $$ &No')): | 487 '$$ &Yes $$ &No') % url): |
487 return False | 488 return False |
488 | 489 |
489 return True | 490 return True |
490 | 491 |
491 _knownstatusnames = {'accepted', 'needsreview', 'needsrevision', 'closed', | 492 _knownstatusnames = {'accepted', 'needsreview', 'needsrevision', 'closed', |