##// END OF EJS Templates
phabricator: allow multiple DREVSPEC args to phabread|phabimport|phabupdate...
Matt Harbison -
r45071:a7f8c657 default
parent child Browse files
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -0,0 +1,277 b''
1 {
2 "version": 1,
3 "interactions": [
4 {
5 "response": {
6 "status": {
7 "message": "OK",
8 "code": 200
9 },
10 "body": {
11 "string": "{\"result\":[{\"id\":\"7918\",\"phid\":\"PHID-DREV-sfsckrwrwc77rdl3k5rz\",\"title\":\"create draft change for phabricator testing\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7918\",\"dateCreated\":\"1579221164\",\"dateModified\":\"1579222305\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"4\",\"statusName\":\"Abandoned\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":1,\"lines.removed\":2},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"3\",\"activeDiffPHID\":\"PHID-DIFF-pqdlhei24n47fzeofjph\",\"diffs\":[\"19394\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[\"PHID-DREV-yhl3yvijs4jploa5iqm4\"]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"},{\"id\":\"7917\",\"phid\":\"PHID-DREV-yhl3yvijs4jploa5iqm4\",\"title\":\"create public change for phabricator testing\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7917\",\"dateCreated\":\"1579221160\",\"dateModified\":\"1579222286\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"4\",\"statusName\":\"Abandoned\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":1,\"lines.removed\":1},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"2\",\"activeDiffPHID\":\"PHID-DIFF-e64weyerxtutv2jvj2dt\",\"diffs\":[\"19393\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"}],\"error_code\":null,\"error_info\":null}"
12 },
13 "headers": {
14 "expires": [
15 "Sat, 01 Jan 2000 00:00:00 GMT"
16 ],
17 "transfer-encoding": [
18 "chunked"
19 ],
20 "strict-transport-security": [
21 "max-age=0; includeSubdomains; preload"
22 ],
23 "x-xss-protection": [
24 "1; mode=block"
25 ],
26 "date": [
27 "Wed, 04 Mar 2020 22:52:46 GMT"
28 ],
29 "referrer-policy": [
30 "no-referrer"
31 ],
32 "content-type": [
33 "application/json"
34 ],
35 "x-frame-options": [
36 "Deny"
37 ],
38 "x-content-type-options": [
39 "nosniff"
40 ],
41 "cache-control": [
42 "no-store"
43 ],
44 "server": [
45 "Apache/2.4.10 (Debian)"
46 ]
47 }
48 },
49 "request": {
50 "method": "POST",
51 "uri": "https://phab.mercurial-scm.org//api/differential.query",
52 "body": "output=json&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7917%2C+7918%5D%7D&__conduit__=1",
53 "headers": {
54 "user-agent": [
55 "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
56 ],
57 "host": [
58 "phab.mercurial-scm.org"
59 ],
60 "content-type": [
61 "application/x-www-form-urlencoded"
62 ],
63 "accept": [
64 "application/mercurial-0.1"
65 ],
66 "content-length": [
67 "154"
68 ]
69 }
70 }
71 },
72 {
73 "response": {
74 "status": {
75 "message": "OK",
76 "code": 200
77 },
78 "body": {
79 "string": "{\"result\":{\"19394\":{\"id\":\"19394\",\"revisionID\":\"7918\",\"dateCreated\":\"1579221161\",\"dateModified\":\"1579221164\",\"sourceControlBaseRevision\":\"7b4185ab5d16acf98e41d566be38c5dbea10878d\",\"sourceControlPath\":\"\\/\",\"sourceControlSystem\":\"hg\",\"branch\":\"default\",\"bookmark\":null,\"creationMethod\":\"phabsend\",\"description\":null,\"unitStatus\":\"0\",\"lintStatus\":\"0\",\"changes\":[{\"id\":\"52927\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"sjHKTvwwqRoW\"},\"oldPath\":\"alpha\",\"currentPath\":\"alpha\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"1\",\"delLines\":\"2\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"2\",\"newLength\":\"1\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"-alpha\\n-more\\n+draft change\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"parent\":\"7b4185ab5d16acf98e41d566be38c5dbea10878d\",\"user\":\"test\"},\"local:commits\":{\"3244dc4a33342b4d91ad534ae091685244ac5ed4\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"3244dc4a33342b4d91ad534ae091685244ac5ed4\",\"parents\":[\"7b4185ab5d16acf98e41d566be38c5dbea10878d\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"},\"19393\":{\"id\":\"19393\",\"revisionID\":\"7917\",\"dateCreated\":\"1579221158\",\"dateModified\":\"1579221160\",\"sourceControlBaseRevision\":\"a692622e693757674f85ff481c7ff77057a7f82a\",\"sourceControlPath\":\"\\/\",\"sourceControlSystem\":\"hg\",\"branch\":\"default\",\"bookmark\":null,\"creationMethod\":\"phabsend\",\"description\":null,\"unitStatus\":\"0\",\"lintStatus\":\"0\",\"changes\":[{\"id\":\"52926\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"uKa4JPWhh2di\"},\"oldPath\":\"beta\",\"currentPath\":\"beta\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":[],\"type\":\"2\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"1\",\"delLines\":\"1\",\"hunks\":[{\"oldOffset\":\"1\",\"newOffset\":\"1\",\"oldLength\":\"1\",\"newLength\":\"1\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"-beta\\n+public change\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"7b4185ab5d16acf98e41d566be38c5dbea10878d\",\"parent\":\"a692622e693757674f85ff481c7ff77057a7f82a\",\"user\":\"test\"},\"local:commits\":{\"7b4185ab5d16acf98e41d566be38c5dbea10878d\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"7b4185ab5d16acf98e41d566be38c5dbea10878d\",\"parents\":[\"a692622e693757674f85ff481c7ff77057a7f82a\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"}},\"error_code\":null,\"error_info\":null}"
80 },
81 "headers": {
82 "expires": [
83 "Sat, 01 Jan 2000 00:00:00 GMT"
84 ],
85 "transfer-encoding": [
86 "chunked"
87 ],
88 "strict-transport-security": [
89 "max-age=0; includeSubdomains; preload"
90 ],
91 "x-xss-protection": [
92 "1; mode=block"
93 ],
94 "date": [
95 "Wed, 04 Mar 2020 22:52:46 GMT"
96 ],
97 "referrer-policy": [
98 "no-referrer"
99 ],
100 "content-type": [
101 "application/json"
102 ],
103 "x-frame-options": [
104 "Deny"
105 ],
106 "x-content-type-options": [
107 "nosniff"
108 ],
109 "cache-control": [
110 "no-store"
111 ],
112 "server": [
113 "Apache/2.4.10 (Debian)"
114 ]
115 }
116 },
117 "request": {
118 "method": "POST",
119 "uri": "https://phab.mercurial-scm.org//api/differential.querydiffs",
120 "body": "output=json&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B19393%2C+19394%5D%7D&__conduit__=1",
121 "headers": {
122 "user-agent": [
123 "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
124 ],
125 "host": [
126 "phab.mercurial-scm.org"
127 ],
128 "content-type": [
129 "application/x-www-form-urlencoded"
130 ],
131 "accept": [
132 "application/mercurial-0.1"
133 ],
134 "content-length": [
135 "156"
136 ]
137 }
138 }
139 },
140 {
141 "response": {
142 "status": {
143 "message": "OK",
144 "code": 200
145 },
146 "body": {
147 "string": "{\"result\":\"diff --git a\\/beta b\\/beta\\n--- a\\/beta\\n+++ b\\/beta\\n@@ -1 +1 @@\\n-beta\\n+public change\\n\\n\",\"error_code\":null,\"error_info\":null}"
148 },
149 "headers": {
150 "expires": [
151 "Sat, 01 Jan 2000 00:00:00 GMT"
152 ],
153 "transfer-encoding": [
154 "chunked"
155 ],
156 "strict-transport-security": [
157 "max-age=0; includeSubdomains; preload"
158 ],
159 "x-xss-protection": [
160 "1; mode=block"
161 ],
162 "date": [
163 "Wed, 04 Mar 2020 22:52:47 GMT"
164 ],
165 "referrer-policy": [
166 "no-referrer"
167 ],
168 "content-type": [
169 "application/json"
170 ],
171 "x-frame-options": [
172 "Deny"
173 ],
174 "x-content-type-options": [
175 "nosniff"
176 ],
177 "cache-control": [
178 "no-store"
179 ],
180 "server": [
181 "Apache/2.4.10 (Debian)"
182 ]
183 }
184 },
185 "request": {
186 "method": "POST",
187 "uri": "https://phab.mercurial-scm.org//api/differential.getrawdiff",
188 "body": "output=json&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22diffID%22%3A+19393%7D&__conduit__=1",
189 "headers": {
190 "user-agent": [
191 "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
192 ],
193 "host": [
194 "phab.mercurial-scm.org"
195 ],
196 "content-type": [
197 "application/x-www-form-urlencoded"
198 ],
199 "accept": [
200 "application/mercurial-0.1"
201 ],
202 "content-length": [
203 "144"
204 ]
205 }
206 }
207 },
208 {
209 "response": {
210 "status": {
211 "message": "OK",
212 "code": 200
213 },
214 "body": {
215 "string": "{\"result\":\"diff --git a\\/alpha b\\/alpha\\n--- a\\/alpha\\n+++ b\\/alpha\\n@@ -1,2 +1 @@\\n-alpha\\n-more\\n+draft change\\n\\n\",\"error_code\":null,\"error_info\":null}"
216 },
217 "headers": {
218 "expires": [
219 "Sat, 01 Jan 2000 00:00:00 GMT"
220 ],
221 "transfer-encoding": [
222 "chunked"
223 ],
224 "strict-transport-security": [
225 "max-age=0; includeSubdomains; preload"
226 ],
227 "x-xss-protection": [
228 "1; mode=block"
229 ],
230 "date": [
231 "Wed, 04 Mar 2020 22:52:47 GMT"
232 ],
233 "referrer-policy": [
234 "no-referrer"
235 ],
236 "content-type": [
237 "application/json"
238 ],
239 "x-frame-options": [
240 "Deny"
241 ],
242 "x-content-type-options": [
243 "nosniff"
244 ],
245 "cache-control": [
246 "no-store"
247 ],
248 "server": [
249 "Apache/2.4.10 (Debian)"
250 ]
251 }
252 },
253 "request": {
254 "method": "POST",
255 "uri": "https://phab.mercurial-scm.org//api/differential.getrawdiff",
256 "body": "output=json&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22diffID%22%3A+19394%7D&__conduit__=1",
257 "headers": {
258 "user-agent": [
259 "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
260 ],
261 "host": [
262 "phab.mercurial-scm.org"
263 ],
264 "content-type": [
265 "application/x-www-form-urlencoded"
266 ],
267 "accept": [
268 "application/mercurial-0.1"
269 ],
270 "content-length": [
271 "144"
272 ]
273 }
274 }
275 }
276 ]
277 } No newline at end of file
@@ -0,0 +1,73 b''
1 {
2 "version": 1,
3 "interactions": [
4 {
5 "request": {
6 "uri": "https://phab.mercurial-scm.org//api/differential.query",
7 "method": "POST",
8 "headers": {
9 "accept": [
10 "application/mercurial-0.1"
11 ],
12 "host": [
13 "phab.mercurial-scm.org"
14 ],
15 "content-length": [
16 "146"
17 ],
18 "user-agent": [
19 "mercurial/proto-1.0 (Mercurial 5.3+33-bb58931d0c4f)"
20 ],
21 "content-type": [
22 "application/x-www-form-urlencoded"
23 ]
24 },
25 "body": "__conduit__=1&params=%7B%22__conduit__%22%3A+%7B%22token%22%3A+%22cli-hahayouwish%22%7D%2C+%22ids%22%3A+%5B7917%5D%7D&output=json"
26 },
27 "response": {
28 "status": {
29 "code": 200,
30 "message": "OK"
31 },
32 "headers": {
33 "x-content-type-options": [
34 "nosniff"
35 ],
36 "x-frame-options": [
37 "Deny"
38 ],
39 "referrer-policy": [
40 "no-referrer"
41 ],
42 "server": [
43 "Apache/2.4.10 (Debian)"
44 ],
45 "cache-control": [
46 "no-store"
47 ],
48 "content-type": [
49 "application/json"
50 ],
51 "transfer-encoding": [
52 "chunked"
53 ],
54 "expires": [
55 "Sat, 01 Jan 2000 00:00:00 GMT"
56 ],
57 "x-xss-protection": [
58 "1; mode=block"
59 ],
60 "date": [
61 "Thu, 05 Mar 2020 16:19:23 GMT"
62 ],
63 "strict-transport-security": [
64 "max-age=0; includeSubdomains; preload"
65 ]
66 },
67 "body": {
68 "string": "{\"result\":[{\"id\":\"7917\",\"phid\":\"PHID-DREV-yhl3yvijs4jploa5iqm4\",\"title\":\"create public change for phabricator testing\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D7917\",\"dateCreated\":\"1579221160\",\"dateModified\":\"1579222286\",\"authorPHID\":\"PHID-USER-tzhaient733lwrlbcag5\",\"status\":\"4\",\"statusName\":\"Abandoned\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":1,\"lines.removed\":1},\"branch\":\"default\",\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"2\",\"activeDiffPHID\":\"PHID-DIFF-e64weyerxtutv2jvj2dt\",\"diffs\":[\"19393\"],\"commits\":[],\"reviewers\":{\"PHID-PROJ-3dvcxzznrjru2xmmses3\":\"PHID-PROJ-3dvcxzznrjru2xmmses3\"},\"ccs\":[\"PHID-USER-q42dn7cc3donqriafhjx\"],\"hashes\":[[\"hgcm\",\"\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000\"]],\"auxiliary\":{\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":\"\\/\"}],\"error_code\":null,\"error_info\":null}"
69 }
70 }
71 }
72 ]
73 } No newline at end of file
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
The requested commit or file is too big and content was truncated. Show full diff
@@ -1694,17 +1694,19 b' def readpatch(ui, drevs, write):'
1694 @vcrcommand(
1694 @vcrcommand(
1695 b'phabread',
1695 b'phabread',
1696 [(b'', b'stack', False, _(b'read dependencies'))],
1696 [(b'', b'stack', False, _(b'read dependencies'))],
1697 _(b'DREVSPEC [OPTIONS]'),
1697 _(b'DREVSPEC... [OPTIONS]'),
1698 helpcategory=command.CATEGORY_IMPORT_EXPORT,
1698 helpcategory=command.CATEGORY_IMPORT_EXPORT,
1699 optionalrepo=True,
1699 optionalrepo=True,
1700 )
1700 )
1701 def phabread(ui, repo, spec, **opts):
1701 def phabread(ui, repo, *specs, **opts):
1702 """print patches from Phabricator suitable for importing
1702 """print patches from Phabricator suitable for importing
1703
1703
1704 DREVSPEC could be a Differential Revision identity, like ``D123``, or just
1704 DREVSPEC could be a Differential Revision identity, like ``D123``, or just
1705 the number ``123``. It could also have common operators like ``+``, ``-``,
1705 the number ``123``. It could also have common operators like ``+``, ``-``,
1706 ``&``, ``(``, ``)`` for complex queries. Prefix ``:`` could be used to
1706 ``&``, ``(``, ``)`` for complex queries. Prefix ``:`` could be used to
1707 select a stack.
1707 select a stack. If multiple DREVSPEC values are given, the result is the
1708 union of each individually evaluated value. No attempt is currently made
1709 to reorder the values to run from parent to child.
1708
1710
1709 ``abandoned``, ``accepted``, ``closed``, ``needsreview``, ``needsrevision``
1711 ``abandoned``, ``accepted``, ``closed``, ``needsreview``, ``needsrevision``
1710 could be used to filter patches by status. For performance reason, they
1712 could be used to filter patches by status. For performance reason, they
@@ -1718,9 +1720,7 b' def phabread(ui, repo, spec, **opts):'
1718 It is equivalent to the ``:`` operator.
1720 It is equivalent to the ``:`` operator.
1719 """
1721 """
1720 opts = pycompat.byteskwargs(opts)
1722 opts = pycompat.byteskwargs(opts)
1721 if opts.get(b'stack'):
1723 drevs = _getdrevs(ui, opts.get(b'stack'), specs)
1722 spec = b':(%s)' % spec
1723 drevs = querydrev(ui, spec)
1724
1724
1725 def _write(patches):
1725 def _write(patches):
1726 for drev, content in patches:
1726 for drev, content in patches:
@@ -1732,10 +1732,10 b' def phabread(ui, repo, spec, **opts):'
1732 @vcrcommand(
1732 @vcrcommand(
1733 b'phabimport',
1733 b'phabimport',
1734 [(b'', b'stack', False, _(b'import dependencies as well'))],
1734 [(b'', b'stack', False, _(b'import dependencies as well'))],
1735 _(b'DREVSPEC [OPTIONS]'),
1735 _(b'DREVSPEC... [OPTIONS]'),
1736 helpcategory=command.CATEGORY_IMPORT_EXPORT,
1736 helpcategory=command.CATEGORY_IMPORT_EXPORT,
1737 )
1737 )
1738 def phabimport(ui, repo, spec, **opts):
1738 def phabimport(ui, repo, *specs, **opts):
1739 """import patches from Phabricator for the specified Differential Revisions
1739 """import patches from Phabricator for the specified Differential Revisions
1740
1740
1741 The patches are read and applied starting at the parent of the working
1741 The patches are read and applied starting at the parent of the working
@@ -1785,9 +1785,7 b' def phabimport(ui, repo, spec, **opts):'
1785 ui.note(msg + b'\n')
1785 ui.note(msg + b'\n')
1786 parents = [repo[node]]
1786 parents = [repo[node]]
1787
1787
1788 if opts.get(b'stack'):
1788 drevs = _getdrevs(ui, opts.get(b'stack'), specs)
1789 spec = b':(%s)' % spec
1790 drevs = querydrev(repo.ui, spec)
1791
1789
1792 readpatch(repo.ui, drevs, _write)
1790 readpatch(repo.ui, drevs, _write)
1793
1791
@@ -1801,11 +1799,11 b' def phabimport(ui, repo, spec, **opts):'
1801 (b'', b'reclaim', False, _(b'reclaim revisions')),
1799 (b'', b'reclaim', False, _(b'reclaim revisions')),
1802 (b'm', b'comment', b'', _(b'comment on the last revision')),
1800 (b'm', b'comment', b'', _(b'comment on the last revision')),
1803 ],
1801 ],
1804 _(b'DREVSPEC [OPTIONS]'),
1802 _(b'DREVSPEC... [OPTIONS]'),
1805 helpcategory=command.CATEGORY_IMPORT_EXPORT,
1803 helpcategory=command.CATEGORY_IMPORT_EXPORT,
1806 optionalrepo=True,
1804 optionalrepo=True,
1807 )
1805 )
1808 def phabupdate(ui, repo, spec, **opts):
1806 def phabupdate(ui, repo, *specs, **opts):
1809 """update Differential Revision in batch
1807 """update Differential Revision in batch
1810
1808
1811 DREVSPEC selects revisions. See :hg:`help phabread` for its usage.
1809 DREVSPEC selects revisions. See :hg:`help phabread` for its usage.
@@ -1819,7 +1817,7 b' def phabupdate(ui, repo, spec, **opts):'
1819 for f in flags:
1817 for f in flags:
1820 actions.append({b'type': f, b'value': True})
1818 actions.append({b'type': f, b'value': True})
1821
1819
1822 drevs = querydrev(ui, spec)
1820 drevs = _getdrevs(ui, opts.get(b'stack'), specs)
1823 for i, drev in enumerate(drevs):
1821 for i, drev in enumerate(drevs):
1824 if i + 1 == len(drevs) and opts.get(b'comment'):
1822 if i + 1 == len(drevs) and opts.get(b'comment'):
1825 actions.append({b'type': b'comment', b'value': opts[b'comment']})
1823 actions.append({b'type': b'comment', b'value': opts[b'comment']})
@@ -29,19 +29,20 b' this test.'
29 > --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head
29 > --test-vcr "$VCR/phabread-conduit-error.json" D4480 | head
30 abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long.
30 abort: Conduit Error (ERR-INVALID-AUTH): API token "cli-notavalidtoken" has the wrong length. API tokens should be 32 characters long.
31
31
32 Missing arguments print the command help
32 Missing arguments don't crash, and may print the command help
33
33
34 $ hg phabread
34 $ hg debugcallconduit
35 hg phabread: invalid arguments
35 hg debugcallconduit: invalid arguments
36 hg phabread DREVSPEC [OPTIONS]
36 hg debugcallconduit METHOD
37
37
38 print patches from Phabricator suitable for importing
38 call Conduit API
39
39
40 options:
40 options:
41
41
42 --stack read dependencies
42 (use 'hg debugcallconduit -h' to show more help)
43
43 [255]
44 (use 'hg phabread -h' to show more help)
44 $ hg phabread
45 abort: empty DREVSPEC set
45 [255]
46 [255]
46
47
47 Basic phabread:
48 Basic phabread:
@@ -57,6 +58,22 b' Basic phabread:'
57
58
58 This commit establishes a new exchangev2 module for holding
59 This commit establishes a new exchangev2 module for holding
59
60
61 Phabread with multiple DREVSPEC
62
63 TODO: attempt to order related revisions like --stack?
64 $ hg phabread --test-vcr "$VCR/phabread-multi-drev.json" D8205 8206 D8207 \
65 > | grep '^Differential Revision'
66 Differential Revision: https://phab.mercurial-scm.org/D8205
67 Differential Revision: https://phab.mercurial-scm.org/D8206
68 Differential Revision: https://phab.mercurial-scm.org/D8207
69
70 Empty DREVSPECs don't crash
71
72 $ hg phabread --test-vcr "$VCR/phabread-empty-drev.json" D7917-D7917
73 abort: empty DREVSPEC set
74 [255]
75
76
60 phabupdate with an accept:
77 phabupdate with an accept:
61 $ hg phabupdate --accept D4564 \
78 $ hg phabupdate --accept D4564 \
62 > -m 'I think I like where this is headed. Will read rest of series later.'\
79 > -m 'I think I like where this is headed. Will read rest of series later.'\
@@ -370,5 +387,12 b' Phabimport can create secret commits'
370 date: Thu Jan 01 00:00:00 1970 +0000
387 date: Thu Jan 01 00:00:00 1970 +0000
371 summary: create beta for phabricator test
388 summary: create beta for phabricator test
372
389
390 Phabimport accepts multiple DREVSPECs
391
392 $ hg rollback --config ui.rollback=True
393 repository tip rolled back to revision 1 (undo phabimport)
394 $ hg phabimport --no-stack D7917 D7918 --test-vcr "$VCR/phabimport-multi-drev.json"
395 applying patch from D7917
396 applying patch from D7918
373
397
374 $ cd ..
398 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now