D127: phabricator: add phabupdate command to update status in batch

2017-08-15 Thread quark (Jun Wu)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6e666cd59879: phabricator: add phabupdate command to update 
status in batch (authored by quark).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D127?vs=842=962

REVISION DETAIL
  https://phab.mercurial-scm.org/D127

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -9,7 +9,7 @@
 This extension provides a ``phabsend`` command which sends a stack of
 changesets to Phabricator without amending commit messages, and a ``phabread``
 command which prints a stack of revisions in a format suitable
-for :hg:`import`.
+for :hg:`import`, and a ``phabupdate`` command to update statuses in batch.
 
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
@@ -798,3 +798,32 @@
 spec = ':(%s)' % spec
 drevs = querydrev(repo, spec)
 readpatch(repo, drevs, ui.write)
+
+@command('phabupdate',
+ [('', 'accept', False, _('accept revisions')),
+  ('', 'reject', False, _('reject revisions')),
+  ('', 'abandon', False, _('abandon revisions')),
+  ('', 'reclaim', False, _('reclaim revisions')),
+  ('m', 'comment', '', _('comment on the last revision')),
+ ], _('DREVSPEC [OPTIONS]'))
+def phabupdate(ui, repo, spec, **opts):
+"""update Differential Revision in batch
+
+DREVSPEC selects revisions. See :hg:`help phabread` for its usage.
+"""
+flags = [n for n in 'accept reject abandon reclaim'.split() if opts.get(n)]
+if len(flags) > 1:
+raise error.Abort(_('%s cannot be used together') % ', '.join(flags))
+
+actions = []
+for f in flags:
+actions.append({'type': f, 'value': 'true'})
+
+drevs = querydrev(repo, spec)
+for i, drev in enumerate(drevs):
+if i + 1 == len(drevs) and opts.get('comment'):
+actions.append({'type': 'comment', 'value': opts['comment']})
+if actions:
+params = {'objectIdentifier': drev[r'phid'],
+  'transactions': actions}
+callconduit(repo, 'differential.revision.edit', params)



To: quark, #hg-reviewers, durin42
Cc: durin42, krbullock, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D127: phabricator: add phabupdate command to update status in batch

2017-08-15 Thread durin42 (Augie Fackler)
durin42 accepted this revision.
durin42 added a comment.
This revision is now accepted and ready to land.


  queued, thanks

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D127

To: quark, #hg-reviewers, durin42
Cc: durin42, krbullock, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D127: phabricator: add phabupdate command to update status in batch

2017-08-12 Thread quark (Jun Wu)
quark updated this revision to Diff 842.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D127?vs=572=842

REVISION DETAIL
  https://phab.mercurial-scm.org/D127

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -9,7 +9,7 @@
 This extension provides a ``phabsend`` command which sends a stack of
 changesets to Phabricator without amending commit messages, and a ``phabread``
 command which prints a stack of revisions in a format suitable
-for :hg:`import`.
+for :hg:`import`, and a ``phabupdate`` command to update statuses in batch.
 
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
@@ -798,3 +798,32 @@
 spec = ':(%s)' % spec
 drevs = querydrev(repo, spec)
 readpatch(repo, drevs, ui.write)
+
+@command('phabupdate',
+ [('', 'accept', False, _('accept revisions')),
+  ('', 'reject', False, _('reject revisions')),
+  ('', 'abandon', False, _('abandon revisions')),
+  ('', 'reclaim', False, _('reclaim revisions')),
+  ('m', 'comment', '', _('comment on the last revision')),
+ ], _('DREVSPEC [OPTIONS]'))
+def phabupdate(ui, repo, spec, **opts):
+"""update Differential Revision in batch
+
+DREVSPEC selects revisions. See :hg:`help phabread` for its usage.
+"""
+flags = [n for n in 'accept reject abandon reclaim'.split() if opts.get(n)]
+if len(flags) > 1:
+raise error.Abort(_('%s cannot be used together') % ', '.join(flags))
+
+actions = []
+for f in flags:
+actions.append({'type': f, 'value': 'true'})
+
+drevs = querydrev(repo, spec)
+for i, drev in enumerate(drevs):
+if i + 1 == len(drevs) and opts.get('comment'):
+actions.append({'type': 'comment', 'value': opts['comment']})
+if actions:
+params = {'objectIdentifier': drev[r'phid'],
+  'transactions': actions}
+callconduit(repo, 'differential.revision.edit', params)



To: quark, #hg-reviewers
Cc: krbullock, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D127: phabricator: add phabupdate command to update status in batch

2017-08-04 Thread quark (Jun Wu)
quark updated this revision to Diff 572.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D127?vs=557=572

REVISION DETAIL
  https://phab.mercurial-scm.org/D127

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -9,7 +9,7 @@
 This extension provides a ``phabsend`` command which sends a stack of
 changesets to Phabricator without amending commit messages, and a ``phabread``
 command which prints a stack of revisions in a format suitable
-for :hg:`import`.
+for :hg:`import`, and a ``phabupdate`` command to update statuses in batch.
 
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
@@ -799,3 +799,32 @@
 spec = ':(%s)' % spec
 drevs = querydrev(repo, spec)
 readpatch(repo, drevs, ui.write)
+
+@command('phabupdate',
+ [('', 'accept', False, _('accept revisions')),
+  ('', 'reject', False, _('reject revisions')),
+  ('', 'abandon', False, _('abandon revisions')),
+  ('', 'reclaim', False, _('reclaim revisions')),
+  ('m', 'comment', '', _('comment on the last revision')),
+ ], _('DREVSPEC [OPTIONS]'))
+def phabupdate(ui, repo, spec, **opts):
+"""update Differential Revision in batch
+
+DREVSPEC selects revisions. See :hg:`help phabread` for its usage.
+"""
+flags = [n for n in 'accept reject abandon reclaim'.split() if opts.get(n)]
+if len(flags) > 1:
+raise error.Abort(_('%s cannot be used together') % ', '.join(flags))
+
+actions = []
+for f in flags:
+actions.append({'type': f, 'value': 'true'})
+
+drevs = querydrev(repo, spec)
+for i, drev in enumerate(drevs):
+if i + 1 == len(drevs) and opts.get('comment'):
+actions.append({'type': 'comment', 'value': opts['comment']})
+if actions:
+params = {'objectIdentifier': drev[r'phid'],
+  'transactions': actions}
+callconduit(repo, 'differential.revision.edit', params)



To: quark, #hg-reviewers
Cc: krbullock, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D127: phabricator: add phabupdate command to update status in batch

2017-08-04 Thread quark (Jun Wu)
quark updated this revision to Diff 557.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D127?vs=239=557

REVISION DETAIL
  https://phab.mercurial-scm.org/D127

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -9,7 +9,7 @@
 This extension provides a ``phabsend`` command which sends a stack of
 changesets to Phabricator without amending commit messages, and a ``phabread``
 command which prints a stack of revisions in a format suitable
-for :hg:`import`.
+for :hg:`import`, and a ``phabupdate`` command to update statuses in batch.
 
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
@@ -765,3 +765,32 @@
 spec = ':(%s)' % spec
 drevs = querydrev(repo, spec)
 readpatch(repo, drevs, ui.write)
+
+@command('phabupdate',
+ [('', 'accept', False, _('accept revisions')),
+  ('', 'reject', False, _('reject revisions')),
+  ('', 'abandon', False, _('abandon revisions')),
+  ('', 'reclaim', False, _('reclaim revisions')),
+  ('m', 'comment', '', _('comment on the last revision')),
+ ], _('DREVSPEC [OPTIONS]'))
+def phabupdate(ui, repo, spec, **opts):
+"""update Differential Revision in batch
+
+DREVSPEC selects revisions. See :hg:`help phabread` for its usage.
+"""
+flags = [n for n in 'accept reject abandon reclaim'.split() if opts.get(n)]
+if len(flags) > 1:
+raise error.Abort(_('%s cannot be used together') % ', '.join(flags))
+
+actions = []
+for f in flags:
+actions.append({'type': f, 'value': 'true'})
+
+drevs = querydrev(repo, spec)
+for i, drev in enumerate(drevs):
+if i + 1 == len(drevs) and opts.get('comment'):
+actions.append({'type': 'comment', 'value': opts['comment']})
+if actions:
+params = {'objectIdentifier': drev[r'phid'],
+  'transactions': actions}
+callconduit(repo, 'differential.revision.edit', params)



To: quark, #hg-reviewers
Cc: krbullock, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D127: phabricator: add phabupdate command to update status in batch

2017-07-18 Thread krbullock (Kevin Bullock)
krbullock added a comment.


  These all look like they're heading the right direction, but I'm not prepared 
to land them in 4.3-rc. Let's revisit after the freeze.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D127

EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: quark, #hg-reviewers
Cc: krbullock, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D127: phabricator: add phabupdate command to update status in batch

2017-07-18 Thread quark (Jun Wu)
quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Changing status (accept, etc) on the webpage is not very convenient -
  currently there is no way to accept (or abandon etc.) a stack using a single
  click or command.
  
  This patch adds a `phabupdate` command that could be used to change status
  in batch. It also supports `--comment` which will write a comment on the
  last revision, which is similar to what we do using emails.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D127

AFFECTED FILES
  contrib/phabricator.py

CHANGE DETAILS

diff --git a/contrib/phabricator.py b/contrib/phabricator.py
--- a/contrib/phabricator.py
+++ b/contrib/phabricator.py
@@ -9,7 +9,7 @@
 This extension provides a ``phabsend`` command which sends a stack of
 changesets to Phabricator without amending commit messages, and a ``phabread``
 command which prints a stack of revisions in a format suitable
-for :hg:`import`.
+for :hg:`import`, and a ``phabupdate`` command to update statuses in batch.
 
 By default, Phabricator requires ``Test Plan`` which might prevent some
 changeset from being sent. The requirement could be disabled by changing
@@ -748,3 +748,32 @@
 spec = ':(%s)' % spec
 drevs = querydrev(repo, spec)
 readpatch(repo, drevs, ui.write)
+
+@command('phabupdate',
+ [('', 'accept', False, _('accept revisions')),
+  ('', 'reject', False, _('reject revisions')),
+  ('', 'abandon', False, _('abandon revisions')),
+  ('', 'reclaim', False, _('reclaim revisions')),
+  ('m', 'comment', '', _('comment on the last revision')),
+ ], _('DREVSPEC [OPTIONS]'))
+def phabupdate(ui, repo, spec, **opts):
+"""update Differential Revision in batch
+
+DREVSPEC selects revisions. See :hg:`help phabread` for its usage.
+"""
+flags = [n for n in 'accept reject abandon reclaim'.split() if opts.get(n)]
+if len(flags) > 1:
+raise error.Abort(_('%s cannot be used together') % ', '.join(flags))
+
+actions = []
+for f in flags:
+actions.append({'type': f, 'value': 'true'})
+
+drevs = querydrev(repo, spec)
+for i, drev in enumerate(drevs):
+if i + 1 == len(drevs) and opts.get('comment'):
+actions.append({'type': 'comment', 'value': opts['comment']})
+if actions:
+params = {'objectIdentifier': drev[r'phid'],
+  'transactions': actions}
+callconduit(repo, 'differential.revision.edit', params)



EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: quark, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel