( )⚙ D125 phabricator: add a small language to query Differential Revisions

This is an archive of the discontinued Mercurial Phabricator instance.

phabricator: add a small language to query Differential Revisions
ClosedPublic

Authored by quark on Jul 18 2017, 5:10 AM.

Details

Summary

Previously, phabread can only be used to read a single patch, or a single
stack of patches. In the future, we want to have more complex queries like
filtering with status (open, accepted, closed, etc), or maybe more complex
like filtering by reviewers etc. The command line flag approach won't scale
with that.

Besides, we might want to have other commands to update Differential
Revision status in batch, like accepting a stack using a single command.

Therefore, this patch adds a small language. It has basic set operations:
&, +, - and an ancestor operator to support --stack.

Test Plan

Try querying this Phabricator instance:

hg phabread 1+2 # 1, 2
hg phabread D2+D1 # 2, 1
hg phabread ':118-115+:2-1' # 114, 116, 117, 118, 2
hg phabread '((:118-(D115+117)))&:117' # 114, 116
hg phabread ':2&:117' --debug # differential.query is called only once

Make sure the output is expected and prefetch works.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

quark created this revision.Jul 18 2017, 5:10 AM
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 487.
quark updated this revision to Diff 555.Aug 4 2017, 3:55 PM
quark updated this revision to Diff 570.Aug 4 2017, 6:13 PM
quark updated this revision to Diff 743.Aug 10 2017, 2:59 PM
quark updated this revision to Diff 840.Aug 13 2017, 12:41 AM
durin42 accepted this revision.Aug 15 2017, 5:43 PM
This revision is now accepted and ready to land.Aug 15 2017, 5:43 PM
This revision was automatically updated to reflect the committed changes.