Show More
@@ -313,7 +313,8 b' def userphids(repo, names):' | |||||
313 |
|
313 | |||
314 | @command('phabsend', |
|
314 | @command('phabsend', | |
315 | [('r', 'rev', [], _('revisions to send'), _('REV')), |
|
315 | [('r', 'rev', [], _('revisions to send'), _('REV')), | |
316 |
('', 'reviewer', [], _('specify reviewers')) |
|
316 | ('', 'reviewer', [], _('specify reviewers')), | |
|
317 | ('', 'confirm', None, _('ask for confirmation before sending'))], | |||
317 | _('REV [OPTIONS]')) |
|
318 | _('REV [OPTIONS]')) | |
318 | def phabsend(ui, repo, *revs, **opts): |
|
319 | def phabsend(ui, repo, *revs, **opts): | |
319 | """upload changesets to Phabricator |
|
320 | """upload changesets to Phabricator | |
@@ -326,6 +327,13 b' def phabsend(ui, repo, *revs, **opts):' | |||||
326 | maintain the association. After the first time, phabsend will check |
|
327 | maintain the association. After the first time, phabsend will check | |
327 | obsstore and tags information so it can figure out whether to update an |
|
328 | obsstore and tags information so it can figure out whether to update an | |
328 | existing Differential Revision, or create a new one. |
|
329 | existing Differential Revision, or create a new one. | |
|
330 | ||||
|
331 | The --confirm option lets you confirm changesets before sending them. You | |||
|
332 | can also add following to your configuration file to make it default | |||
|
333 | behaviour. | |||
|
334 | ||||
|
335 | [phabsend] | |||
|
336 | confirm = true | |||
329 | """ |
|
337 | """ | |
330 | revs = list(revs) + opts.get('rev', []) |
|
338 | revs = list(revs) + opts.get('rev', []) | |
331 | revs = scmutil.revrange(repo, revs) |
|
339 | revs = scmutil.revrange(repo, revs) | |
@@ -333,6 +341,13 b' def phabsend(ui, repo, *revs, **opts):' | |||||
333 | if not revs: |
|
341 | if not revs: | |
334 | raise error.Abort(_('phabsend requires at least one changeset')) |
|
342 | raise error.Abort(_('phabsend requires at least one changeset')) | |
335 |
|
343 | |||
|
344 | confirm = ui.configbool('phabsend', 'confirm') | |||
|
345 | confirm |= bool(opts.get('confirm')) | |||
|
346 | if confirm: | |||
|
347 | confirmed = _confirmbeforesend(repo, revs) | |||
|
348 | if not confirmed: | |||
|
349 | raise error.Abort(_('phabsend cancelled')) | |||
|
350 | ||||
336 | actions = [] |
|
351 | actions = [] | |
337 | reviewers = opts.get('reviewer', []) |
|
352 | reviewers = opts.get('reviewer', []) | |
338 | if reviewers: |
|
353 | if reviewers: | |
@@ -379,6 +394,20 b' def phabsend(ui, repo, *revs, **opts):' | |||||
379 | _metanamemap = util.sortdict([(r'user', 'User'), (r'date', 'Date'), |
|
394 | _metanamemap = util.sortdict([(r'user', 'User'), (r'date', 'Date'), | |
380 | (r'node', 'Node ID'), (r'parent', 'Parent ')]) |
|
395 | (r'node', 'Node ID'), (r'parent', 'Parent ')]) | |
381 |
|
396 | |||
|
397 | def _confirmbeforesend(repo, revs): | |||
|
398 | ui = repo.ui | |||
|
399 | for rev in revs: | |||
|
400 | ctx = repo[rev] | |||
|
401 | desc = ctx.description().splitlines()[0] | |||
|
402 | ui.write(('%d: ' % rev), label='phabsend.revnumber') | |||
|
403 | ui.write(('%s\n' % desc), label='phabsend.desc') | |||
|
404 | ||||
|
405 | if ui.promptchoice(_('Phabsend the above changes (yn)?' | |||
|
406 | '$$ &Yes $$ &No')): | |||
|
407 | return False | |||
|
408 | ||||
|
409 | return True | |||
|
410 | ||||
382 | def querydrev(repo, params, stack=False): |
|
411 | def querydrev(repo, params, stack=False): | |
383 | """return a list of "Differential Revision" dicts |
|
412 | """return a list of "Differential Revision" dicts | |
384 |
|
413 |
General Comments 0
You need to be logged in to leave comments.
Login now