Show More
@@ -0,0 +1,149 b'' | |||||
|
1 | { | |||
|
2 | "version": 1, | |||
|
3 | "interactions": [ | |||
|
4 | { | |||
|
5 | "response": { | |||
|
6 | "headers": { | |||
|
7 | "x-xss-protection": [ | |||
|
8 | "1; mode=block" | |||
|
9 | ], | |||
|
10 | "content-length": [ | |||
|
11 | "6067" | |||
|
12 | ], | |||
|
13 | "content-type": [ | |||
|
14 | "application/json" | |||
|
15 | ], | |||
|
16 | "expires": [ | |||
|
17 | "Sat, 01 Jan 2000 00:00:00 GMT" | |||
|
18 | ], | |||
|
19 | "vary": [ | |||
|
20 | "Accept-Encoding" | |||
|
21 | ], | |||
|
22 | "connection": [ | |||
|
23 | "keep-alive" | |||
|
24 | ], | |||
|
25 | "strict-transport-security": [ | |||
|
26 | "max-age=31536000; includeSubdomains; preload" | |||
|
27 | ], | |||
|
28 | "cache-control": [ | |||
|
29 | "no-store" | |||
|
30 | ], | |||
|
31 | "referrer-policy": [ | |||
|
32 | "no-referrer", | |||
|
33 | "strict-origin-when-cross-origin" | |||
|
34 | ], | |||
|
35 | "x-frame-options": [ | |||
|
36 | "Deny" | |||
|
37 | ], | |||
|
38 | "date": [ | |||
|
39 | "Tue, 17 Sep 2019 21:22:31 GMT" | |||
|
40 | ], | |||
|
41 | "x-content-type-options": [ | |||
|
42 | "nosniff" | |||
|
43 | ] | |||
|
44 | }, | |||
|
45 | "body": { | |||
|
46 | "string": "{\"result\":{\"2175\":{\"id\":\"2175\",\"revisionID\":\"1253\",\"dateCreated\":\"1568754923\",\"dateModified\":\"1568754927\",\"sourceControlBaseRevision\":null,\"sourceControlPath\":null,\"sourceControlSystem\":null,\"branch\":null,\"bookmark\":null,\"creationMethod\":\"web\",\"description\":null,\"unitStatus\":\"4\",\"lintStatus\":\"4\",\"changes\":[{\"id\":\"5562\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"sOtQ9WtAYaL5\"},\"oldPath\":null,\"currentPath\":\"comment\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"2\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"2\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+comment\\n+comment2\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"1acd4b60af38c934182468719a8a431248f49bef\",\"parent\":\"a19f1434f9a578325eb9799c9961b5465d4e6e40\",\"user\":\"test\"},\"local:commits\":{\"1acd4b60af38c934182468719a8a431248f49bef\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"1acd4b60af38c934182468719a8a431248f49bef\",\"parents\":[\"a19f1434f9a578325eb9799c9961b5465d4e6e40\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"},\"2172\":{\"id\":\"2172\",\"revisionID\":\"1253\",\"dateCreated\":\"1568752955\",\"dateModified\":\"1568752959\",\"sourceControlBaseRevision\":null,\"sourceControlPath\":null,\"sourceControlSystem\":null,\"branch\":null,\"bookmark\":null,\"creationMethod\":\"web\",\"description\":null,\"unitStatus\":\"4\",\"lintStatus\":\"4\",\"changes\":[{\"id\":\"5559\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"sOtQ9WtAYaL5\"},\"oldPath\":null,\"currentPath\":\"comment\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"2\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"2\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+comment\\n+comment2\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"a2ee35bb90599d36732e25eaa3522e813807c436\",\"parent\":\"a19f1434f9a578325eb9799c9961b5465d4e6e40\",\"user\":\"test\"},\"local:commits\":{\"a2ee35bb90599d36732e25eaa3522e813807c436\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"a2ee35bb90599d36732e25eaa3522e813807c436\",\"parents\":[\"a19f1434f9a578325eb9799c9961b5465d4e6e40\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"},\"2171\":{\"id\":\"2171\",\"revisionID\":\"1253\",\"dateCreated\":\"1568752852\",\"dateModified\":\"1568752856\",\"sourceControlBaseRevision\":null,\"sourceControlPath\":null,\"sourceControlSystem\":null,\"branch\":null,\"bookmark\":null,\"creationMethod\":\"web\",\"description\":null,\"unitStatus\":\"4\",\"lintStatus\":\"4\",\"changes\":[{\"id\":\"5558\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"sOtQ9WtAYaL5\"},\"oldPath\":null,\"currentPath\":\"comment\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"2\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"2\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+comment\\n+comment2\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"a2ee35bb90599d36732e25eaa3522e813807c436\",\"parent\":\"a19f1434f9a578325eb9799c9961b5465d4e6e40\",\"user\":\"test\"},\"local:commits\":{\"a2ee35bb90599d36732e25eaa3522e813807c436\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"a2ee35bb90599d36732e25eaa3522e813807c436\",\"parents\":[\"a19f1434f9a578325eb9799c9961b5465d4e6e40\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"},\"1990\":{\"id\":\"1990\",\"revisionID\":\"1253\",\"dateCreated\":\"1559939219\",\"dateModified\":\"1559939221\",\"sourceControlBaseRevision\":null,\"sourceControlPath\":null,\"sourceControlSystem\":null,\"branch\":null,\"bookmark\":null,\"creationMethod\":\"web\",\"description\":null,\"unitStatus\":\"4\",\"lintStatus\":\"4\",\"changes\":[{\"id\":\"5274\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"sOtQ9WtAYaL5\"},\"oldPath\":null,\"currentPath\":\"comment\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"2\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"2\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+comment\\n+comment2\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"26e841a56a257327455a2d61b4cdce5a23603e0f\",\"parent\":\"bbe10799509c2879ee316782805e70541cd5fd67\",\"user\":\"test\"},\"local:commits\":{\"26e841a56a257327455a2d61b4cdce5a23603e0f\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"26e841a56a257327455a2d61b4cdce5a23603e0f\",\"parents\":[\"bbe10799509c2879ee316782805e70541cd5fd67\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"},\"1989\":{\"id\":\"1989\",\"revisionID\":\"1253\",\"dateCreated\":\"1559938985\",\"dateModified\":\"1559938988\",\"sourceControlBaseRevision\":null,\"sourceControlPath\":null,\"sourceControlSystem\":null,\"branch\":null,\"bookmark\":null,\"creationMethod\":\"web\",\"description\":null,\"unitStatus\":\"4\",\"lintStatus\":\"4\",\"changes\":[{\"id\":\"5273\",\"metadata\":{\"line:first\":1,\"hash.effect\":\"mzg_LBhhVYqb\"},\"oldPath\":null,\"currentPath\":\"comment\",\"awayPaths\":[],\"oldProperties\":[],\"newProperties\":{\"unix:filemode\":\"100644\"},\"type\":\"1\",\"fileType\":\"1\",\"commitHash\":null,\"addLines\":\"1\",\"delLines\":\"0\",\"hunks\":[{\"oldOffset\":\"0\",\"newOffset\":\"1\",\"oldLength\":\"0\",\"newLength\":\"1\",\"addLines\":null,\"delLines\":null,\"isMissingOldNewline\":null,\"isMissingNewNewline\":null,\"corpus\":\"+comment\\n\"}]}],\"properties\":{\"hg:meta\":{\"branch\":\"default\",\"date\":\"0 0\",\"node\":\"0025df7d064f9c916862d19e207429a0f799fa7d\",\"parent\":\"bbe10799509c2879ee316782805e70541cd5fd67\",\"user\":\"test\"},\"local:commits\":{\"0025df7d064f9c916862d19e207429a0f799fa7d\":{\"author\":\"test\",\"authorEmail\":\"test\",\"branch\":\"default\",\"commit\":\"0025df7d064f9c916862d19e207429a0f799fa7d\",\"parents\":[\"bbe10799509c2879ee316782805e70541cd5fd67\"],\"time\":0}}},\"authorName\":\"test\",\"authorEmail\":\"test\"}},\"error_code\":null,\"error_info\":null}" | |||
|
47 | }, | |||
|
48 | "status": { | |||
|
49 | "code": 200, | |||
|
50 | "message": "OK" | |||
|
51 | } | |||
|
52 | }, | |||
|
53 | "request": { | |||
|
54 | "headers": { | |||
|
55 | "content-length": [ | |||
|
56 | "66" | |||
|
57 | ], | |||
|
58 | "content-type": [ | |||
|
59 | "application/x-www-form-urlencoded" | |||
|
60 | ], | |||
|
61 | "user-agent": [ | |||
|
62 | "mercurial/proto-1.0 (Mercurial 5.1.1+7-32677ec7df40+20190917)" | |||
|
63 | ], | |||
|
64 | "accept": [ | |||
|
65 | "application/mercurial-0.1" | |||
|
66 | ], | |||
|
67 | "host": [ | |||
|
68 | "phab.mercurial-scm.org" | |||
|
69 | ] | |||
|
70 | }, | |||
|
71 | "body": "revisionIDs%5B0%5D=1253&api.token=cli-hahayouwish", | |||
|
72 | "uri": "https://phab.mercurial-scm.org//api/differential.querydiffs", | |||
|
73 | "method": "POST" | |||
|
74 | } | |||
|
75 | }, | |||
|
76 | { | |||
|
77 | "response": { | |||
|
78 | "headers": { | |||
|
79 | "x-xss-protection": [ | |||
|
80 | "1; mode=block" | |||
|
81 | ], | |||
|
82 | "content-length": [ | |||
|
83 | "1055" | |||
|
84 | ], | |||
|
85 | "content-type": [ | |||
|
86 | "application/json" | |||
|
87 | ], | |||
|
88 | "expires": [ | |||
|
89 | "Sat, 01 Jan 2000 00:00:00 GMT" | |||
|
90 | ], | |||
|
91 | "vary": [ | |||
|
92 | "Accept-Encoding" | |||
|
93 | ], | |||
|
94 | "connection": [ | |||
|
95 | "keep-alive" | |||
|
96 | ], | |||
|
97 | "strict-transport-security": [ | |||
|
98 | "max-age=31536000; includeSubdomains; preload" | |||
|
99 | ], | |||
|
100 | "cache-control": [ | |||
|
101 | "no-store" | |||
|
102 | ], | |||
|
103 | "referrer-policy": [ | |||
|
104 | "no-referrer", | |||
|
105 | "strict-origin-when-cross-origin" | |||
|
106 | ], | |||
|
107 | "x-frame-options": [ | |||
|
108 | "Deny" | |||
|
109 | ], | |||
|
110 | "date": [ | |||
|
111 | "Tue, 17 Sep 2019 21:22:32 GMT" | |||
|
112 | ], | |||
|
113 | "x-content-type-options": [ | |||
|
114 | "nosniff" | |||
|
115 | ] | |||
|
116 | }, | |||
|
117 | "body": { | |||
|
118 | "string": "{\"result\":[{\"id\":\"1253\",\"phid\":\"PHID-DREV-4rhqd6v3yxbtodc7wbv7\",\"title\":\"create comment for phabricator test\",\"uri\":\"https:\\/\\/phab.mercurial-scm.org\\/D1253\",\"dateCreated\":\"1559938988\",\"dateModified\":\"1568754928\",\"authorPHID\":\"PHID-USER-qmzis76vb2yh3ogldu6r\",\"status\":\"0\",\"statusName\":\"Needs Review\",\"properties\":{\"draft.broadcast\":true,\"lines.added\":2,\"lines.removed\":0,\"buildables\":{\"PHID-HMBB-hsvjwe4uccbkgjpvffhz\":{\"status\":\"passed\"},\"PHID-HMBB-fwvmqztsgs3r3tpz3q5x\":{\"status\":\"passed\"},\"PHID-HMBB-hkx7mvm7pfacmg2pwwo2\":{\"status\":\"passed\"},\"PHID-HMBB-qfk7ksky77lpzlmzojtz\":{\"status\":\"passed\"},\"PHID-HMBB-p5eo6q67kttzuhdtg2d3\":{\"status\":\"passed\"}}},\"branch\":null,\"summary\":\"\",\"testPlan\":\"\",\"lineCount\":\"2\",\"activeDiffPHID\":\"PHID-DIFF-pigorrruetzslmwaard3\",\"diffs\":[\"2175\",\"2172\",\"2171\",\"1990\",\"1989\"],\"commits\":[],\"reviewers\":[],\"ccs\":[],\"hashes\":[],\"auxiliary\":{\"bugzilla.bug-id\":null,\"phabricator:projects\":[],\"phabricator:depends-on\":[]},\"repositoryPHID\":\"PHID-REPO-bvunnehri4u2isyr7bc3\",\"sourcePath\":null}],\"error_code\":null,\"error_info\":null}" | |||
|
119 | }, | |||
|
120 | "status": { | |||
|
121 | "code": 200, | |||
|
122 | "message": "OK" | |||
|
123 | } | |||
|
124 | }, | |||
|
125 | "request": { | |||
|
126 | "headers": { | |||
|
127 | "content-length": [ | |||
|
128 | "58" | |||
|
129 | ], | |||
|
130 | "content-type": [ | |||
|
131 | "application/x-www-form-urlencoded" | |||
|
132 | ], | |||
|
133 | "user-agent": [ | |||
|
134 | "mercurial/proto-1.0 (Mercurial 5.1.1+7-32677ec7df40+20190917)" | |||
|
135 | ], | |||
|
136 | "accept": [ | |||
|
137 | "application/mercurial-0.1" | |||
|
138 | ], | |||
|
139 | "host": [ | |||
|
140 | "phab.mercurial-scm.org" | |||
|
141 | ] | |||
|
142 | }, | |||
|
143 | "body": "ids%5B0%5D=1253&api.token=cli-hahayouwish", | |||
|
144 | "uri": "https://phab.mercurial-scm.org//api/differential.query", | |||
|
145 | "method": "POST" | |||
|
146 | } | |||
|
147 | } | |||
|
148 | ] | |||
|
149 | } No newline at end of file |
@@ -1,153 +1,209 b'' | |||||
1 | #require vcr |
|
1 | #require vcr | |
2 | $ cat >> $HGRCPATH <<EOF |
|
2 | $ cat >> $HGRCPATH <<EOF | |
3 | > [extensions] |
|
3 | > [extensions] | |
4 | > phabricator = |
|
4 | > phabricator = | |
5 | > EOF |
|
5 | > EOF | |
6 | $ hg init repo |
|
6 | $ hg init repo | |
7 | $ cd repo |
|
7 | $ cd repo | |
8 | $ cat >> .hg/hgrc <<EOF |
|
8 | $ cat >> .hg/hgrc <<EOF | |
9 | > [phabricator] |
|
9 | > [phabricator] | |
10 | > url = https://phab.mercurial-scm.org/ |
|
10 | > url = https://phab.mercurial-scm.org/ | |
11 | > callsign = HG |
|
11 | > callsign = HG | |
12 | > |
|
12 | > | |
13 | > [auth] |
|
13 | > [auth] | |
14 | > hgphab.schemes = https |
|
14 | > hgphab.schemes = https | |
15 | > hgphab.prefix = phab.mercurial-scm.org |
|
15 | > hgphab.prefix = phab.mercurial-scm.org | |
16 | > # When working on the extension and making phabricator interaction |
|
16 | > # When working on the extension and making phabricator interaction | |
17 | > # changes, edit this to be a real phabricator token. When done, edit |
|
17 | > # changes, edit this to be a real phabricator token. When done, edit | |
18 | > # it back. The VCR transcripts will be auto-sanitised to replace your real |
|
18 | > # it back. The VCR transcripts will be auto-sanitised to replace your real | |
19 | > # token with this value. |
|
19 | > # token with this value. | |
20 | > hgphab.phabtoken = cli-hahayouwish |
|
20 | > hgphab.phabtoken = cli-hahayouwish | |
21 | > EOF |
|
21 | > EOF | |
22 | $ VCR="$TESTDIR/phabricator" |
|
22 | $ VCR="$TESTDIR/phabricator" | |
23 |
|
23 | |||
24 | Error is handled reasonably. We override the phabtoken here so that |
|
24 | Error is handled reasonably. We override the phabtoken here so that | |
25 | when you're developing changes to phabricator.py you can edit the |
|
25 | when you're developing changes to phabricator.py you can edit the | |
26 | above config and have a real token in the test but not have to edit |
|
26 | above config and have a real token in the test but not have to edit | |
27 | this test. |
|
27 | this test. | |
28 | $ hg phabread --config auth.hgphab.phabtoken=cli-notavalidtoken \ |
|
28 | $ hg phabread --config auth.hgphab.phabtoken=cli-notavalidtoken \ | |
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 | Basic phabread: |
|
32 | Basic phabread: | |
33 | $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head |
|
33 | $ hg phabread --test-vcr "$VCR/phabread-4480.json" D4480 | head | |
34 | # HG changeset patch |
|
34 | # HG changeset patch | |
35 | # Date 1536771503 0 |
|
35 | # Date 1536771503 0 | |
36 | # Parent a5de21c9e3703f8e8eb064bd7d893ff2f703c66a |
|
36 | # Parent a5de21c9e3703f8e8eb064bd7d893ff2f703c66a | |
37 | exchangev2: start to implement pull with wire protocol v2 |
|
37 | exchangev2: start to implement pull with wire protocol v2 | |
38 |
|
38 | |||
39 | Wire protocol version 2 will take a substantially different |
|
39 | Wire protocol version 2 will take a substantially different | |
40 | approach to exchange than version 1 (at least as far as pulling |
|
40 | approach to exchange than version 1 (at least as far as pulling | |
41 | is concerned). |
|
41 | is concerned). | |
42 |
|
42 | |||
43 | This commit establishes a new exchangev2 module for holding |
|
43 | This commit establishes a new exchangev2 module for holding | |
44 |
|
44 | |||
45 | phabupdate with an accept: |
|
45 | phabupdate with an accept: | |
46 | $ hg phabupdate --accept D4564 \ |
|
46 | $ hg phabupdate --accept D4564 \ | |
47 | > -m 'I think I like where this is headed. Will read rest of series later.'\ |
|
47 | > -m 'I think I like where this is headed. Will read rest of series later.'\ | |
48 | > --test-vcr "$VCR/accept-4564.json" |
|
48 | > --test-vcr "$VCR/accept-4564.json" | |
49 |
|
49 | |||
50 | Create a differential diff: |
|
50 | Create a differential diff: | |
51 | $ HGENCODING=utf-8; export HGENCODING |
|
51 | $ HGENCODING=utf-8; export HGENCODING | |
52 | $ echo alpha > alpha |
|
52 | $ echo alpha > alpha | |
53 | $ hg ci --addremove -m 'create alpha for phabricator test β¬' |
|
53 | $ hg ci --addremove -m 'create alpha for phabricator test β¬' | |
54 | adding alpha |
|
54 | adding alpha | |
55 | $ hg phabsend -r . --test-vcr "$VCR/phabsend-create-alpha.json" |
|
55 | $ hg phabsend -r . --test-vcr "$VCR/phabsend-create-alpha.json" | |
56 | D1190 - created - d386117f30e6: create alpha for phabricator test \xe2\x82\xac (esc) |
|
56 | D1190 - created - d386117f30e6: create alpha for phabricator test \xe2\x82\xac (esc) | |
57 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d386117f30e6-24ffe649-phabsend.hg |
|
57 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d386117f30e6-24ffe649-phabsend.hg | |
58 | $ echo more >> alpha |
|
58 | $ echo more >> alpha | |
59 | $ HGEDITOR=true hg ci --amend |
|
59 | $ HGEDITOR=true hg ci --amend | |
60 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a86ed7d85e86-b7a54f3b-amend.hg |
|
60 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a86ed7d85e86-b7a54f3b-amend.hg | |
61 | $ echo beta > beta |
|
61 | $ echo beta > beta | |
62 | $ hg ci --addremove -m 'create beta for phabricator test' |
|
62 | $ hg ci --addremove -m 'create beta for phabricator test' | |
63 | adding beta |
|
63 | adding beta | |
64 | $ hg phabsend -r ".^::" --test-vcr "$VCR/phabsend-update-alpha-create-beta.json" |
|
64 | $ hg phabsend -r ".^::" --test-vcr "$VCR/phabsend-update-alpha-create-beta.json" | |
65 | D1190 - updated - d940d39fb603: create alpha for phabricator test \xe2\x82\xac (esc) |
|
65 | D1190 - updated - d940d39fb603: create alpha for phabricator test \xe2\x82\xac (esc) | |
66 | D1191 - created - 4b2486dfc8c7: create beta for phabricator test |
|
66 | D1191 - created - 4b2486dfc8c7: create beta for phabricator test | |
67 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/4b2486dfc8c7-d90584fa-phabsend.hg |
|
67 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/4b2486dfc8c7-d90584fa-phabsend.hg | |
68 | $ unset HGENCODING |
|
68 | $ unset HGENCODING | |
69 |
|
69 | |||
70 | The amend won't explode after posting a public commit. The local tag is left |
|
70 | The amend won't explode after posting a public commit. The local tag is left | |
71 | behind to identify it. |
|
71 | behind to identify it. | |
72 |
|
72 | |||
73 | $ echo 'public change' > beta |
|
73 | $ echo 'public change' > beta | |
74 | $ hg ci -m 'create public change for phabricator testing' |
|
74 | $ hg ci -m 'create public change for phabricator testing' | |
75 | $ hg phase --public . |
|
75 | $ hg phase --public . | |
76 | $ echo 'draft change' > alpha |
|
76 | $ echo 'draft change' > alpha | |
77 | $ hg ci -m 'create draft change for phabricator testing' |
|
77 | $ hg ci -m 'create draft change for phabricator testing' | |
78 | $ hg phabsend --amend -r '.^::' --test-vcr "$VCR/phabsend-create-public.json" |
|
78 | $ hg phabsend --amend -r '.^::' --test-vcr "$VCR/phabsend-create-public.json" | |
79 | D1192 - created - 24ffd6bca53a: create public change for phabricator testing |
|
79 | D1192 - created - 24ffd6bca53a: create public change for phabricator testing | |
80 | D1193 - created - ac331633be79: create draft change for phabricator testing |
|
80 | D1193 - created - ac331633be79: create draft change for phabricator testing | |
81 | warning: not updating public commit 2:24ffd6bca53a |
|
81 | warning: not updating public commit 2:24ffd6bca53a | |
82 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/ac331633be79-719b961c-phabsend.hg |
|
82 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/ac331633be79-719b961c-phabsend.hg | |
83 | $ hg tags -v |
|
83 | $ hg tags -v | |
84 | tip 3:a19f1434f9a5 |
|
84 | tip 3:a19f1434f9a5 | |
85 | D1192 2:24ffd6bca53a local |
|
85 | D1192 2:24ffd6bca53a local | |
86 |
|
86 | |||
87 | $ hg debugcallconduit user.search --test-vcr "$VCR/phab-conduit.json" <<EOF |
|
87 | $ hg debugcallconduit user.search --test-vcr "$VCR/phab-conduit.json" <<EOF | |
88 | > { |
|
88 | > { | |
89 | > "constraints": { |
|
89 | > "constraints": { | |
90 | > "isBot": true |
|
90 | > "isBot": true | |
91 | > } |
|
91 | > } | |
92 | > } |
|
92 | > } | |
93 | > EOF |
|
93 | > EOF | |
94 | { |
|
94 | { | |
95 | "cursor": { |
|
95 | "cursor": { | |
96 | "after": null, |
|
96 | "after": null, | |
97 | "before": null, |
|
97 | "before": null, | |
98 | "limit": 100, |
|
98 | "limit": 100, | |
99 | "order": null |
|
99 | "order": null | |
100 | }, |
|
100 | }, | |
101 | "data": [], |
|
101 | "data": [], | |
102 | "maps": {}, |
|
102 | "maps": {}, | |
103 | "query": { |
|
103 | "query": { | |
104 | "queryKey": null |
|
104 | "queryKey": null | |
105 | } |
|
105 | } | |
106 | } |
|
106 | } | |
107 |
|
107 | |||
108 | Template keywords |
|
108 | Template keywords | |
109 | $ hg log -T'{rev} {phabreview|json}\n' |
|
109 | $ hg log -T'{rev} {phabreview|json}\n' | |
110 | 3 {"id": "D1193", "url": "https://phab.mercurial-scm.org/D1193"} |
|
110 | 3 {"id": "D1193", "url": "https://phab.mercurial-scm.org/D1193"} | |
111 | 2 {"id": "D1192", "url": "https://phab.mercurial-scm.org/D1192"} |
|
111 | 2 {"id": "D1192", "url": "https://phab.mercurial-scm.org/D1192"} | |
112 | 1 {"id": "D1191", "url": "https://phab.mercurial-scm.org/D1191"} |
|
112 | 1 {"id": "D1191", "url": "https://phab.mercurial-scm.org/D1191"} | |
113 | 0 {"id": "D1190", "url": "https://phab.mercurial-scm.org/D1190"} |
|
113 | 0 {"id": "D1190", "url": "https://phab.mercurial-scm.org/D1190"} | |
114 |
|
114 | |||
115 | $ hg log -T'{rev} {if(phabreview, "{phabreview.url} {phabreview.id}")}\n' |
|
115 | $ hg log -T'{rev} {if(phabreview, "{phabreview.url} {phabreview.id}")}\n' | |
116 | 3 https://phab.mercurial-scm.org/D1193 D1193 |
|
116 | 3 https://phab.mercurial-scm.org/D1193 D1193 | |
117 | 2 https://phab.mercurial-scm.org/D1192 D1192 |
|
117 | 2 https://phab.mercurial-scm.org/D1192 D1192 | |
118 | 1 https://phab.mercurial-scm.org/D1191 D1191 |
|
118 | 1 https://phab.mercurial-scm.org/D1191 D1191 | |
119 | 0 https://phab.mercurial-scm.org/D1190 D1190 |
|
119 | 0 https://phab.mercurial-scm.org/D1190 D1190 | |
120 |
|
120 | |||
121 | Commenting when phabsending: |
|
121 | Commenting when phabsending: | |
122 | $ echo comment > comment |
|
122 | $ echo comment > comment | |
123 | $ hg ci --addremove -m "create comment for phabricator test" |
|
123 | $ hg ci --addremove -m "create comment for phabricator test" | |
124 | adding comment |
|
124 | adding comment | |
125 | $ hg phabsend -r . -m "For default branch" --test-vcr "$VCR/phabsend-comment-created.json" |
|
125 | $ hg phabsend -r . -m "For default branch" --test-vcr "$VCR/phabsend-comment-created.json" | |
126 | D1253 - created - a7ee4bac036a: create comment for phabricator test |
|
126 | D1253 - created - a7ee4bac036a: create comment for phabricator test | |
127 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a7ee4bac036a-8009b5a0-phabsend.hg |
|
127 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/a7ee4bac036a-8009b5a0-phabsend.hg | |
128 | $ echo comment2 >> comment |
|
128 | $ echo comment2 >> comment | |
129 | $ hg ci --amend |
|
129 | $ hg ci --amend | |
130 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/81fce7de1b7d-05339e5b-amend.hg |
|
130 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/81fce7de1b7d-05339e5b-amend.hg | |
131 | $ hg phabsend -r . -m "Address review comments" --test-vcr "$VCR/phabsend-comment-updated.json" |
|
131 | $ hg phabsend -r . -m "Address review comments" --test-vcr "$VCR/phabsend-comment-updated.json" | |
132 | D1253 - updated - 1acd4b60af38: create comment for phabricator test |
|
132 | D1253 - updated - 1acd4b60af38: create comment for phabricator test | |
133 |
|
133 | |||
|
134 | Phabsending a skipped commit: | |||
|
135 | #if no-py3 | |||
|
136 | $ hg phabsend --no-amend -r . --test-vcr "$VCR/phabsend-skipped.json" | |||
|
137 | D1253 - skipped - 1acd4b60af38: create comment for phabricator test | |||
|
138 | #endif | |||
|
139 | BROKEN: shouldn't error under py3 | |||
|
140 | #if py3 | |||
|
141 | $ hg phabsend --no-amend -r . --test-vcr "$VCR/phabsend-skipped.json" | |||
|
142 | ** unknown exception encountered, please report by visiting | |||
|
143 | ** https://mercurial-scm.org/wiki/BugTracker | |||
|
144 | ** Python 3* (glob) | |||
|
145 | ** Mercurial Distributed SCM (version *) (glob) | |||
|
146 | ** Extensions loaded: phabricator | |||
|
147 | Traceback (most recent call last): | |||
|
148 | File "*/install/bin/hg", line *, in <module> (glob) | |||
|
149 | dispatch.run() | |||
|
150 | File "*/install/lib/python/mercurial/dispatch.py", line *, in run (glob) | |||
|
151 | status = dispatch(req) | |||
|
152 | File "*/install/lib/python/mercurial/dispatch.py", line *, in dispatch (glob) | |||
|
153 | ret = _runcatch(req) or 0 | |||
|
154 | File "*/install/lib/python/mercurial/dispatch.py", line *, in _runcatch (glob) | |||
|
155 | return _callcatch(ui, _runcatchfunc) | |||
|
156 | File "*/install/lib/python/mercurial/dispatch.py", line *, in _callcatch (glob) | |||
|
157 | return scmutil.callcatch(ui, func) | |||
|
158 | File "*/install/lib/python/mercurial/scmutil.py", line *, in callcatch (glob) | |||
|
159 | return func() | |||
|
160 | File "*/install/lib/python/mercurial/dispatch.py", line *, in _runcatchfunc (glob) | |||
|
161 | return _dispatch(req) | |||
|
162 | File "*/install/lib/python/mercurial/dispatch.py", line *, in _dispatch (glob) | |||
|
163 | cmdpats, cmdoptions) | |||
|
164 | File "*/install/lib/python/mercurial/dispatch.py", line *, in runcommand (glob) | |||
|
165 | ret = _runcommand(ui, options, cmd, d) | |||
|
166 | File "*/install/lib/python/mercurial/dispatch.py", line *, in _runcommand (glob) | |||
|
167 | return cmdfunc() | |||
|
168 | File "*/install/lib/python/mercurial/dispatch.py", line *, in <lambda> (glob) | |||
|
169 | d = lambda: util.checksignature(func)(ui, *args, **strcmdopt) | |||
|
170 | File "*/install/lib/python/mercurial/util.py", line *, in check (glob) | |||
|
171 | return func(*args, **kwargs) | |||
|
172 | File "*/install/lib/python/hgext/phabricator.py", line *, in inner (glob) | |||
|
173 | return fn(*args, **kwargs) | |||
|
174 | File "*/install/lib/python/hgext/phabricator.py", line *, in phabsend (glob) | |||
|
175 | newrevphid = querydrev(repo, str(revid))[0][b'phid'] | |||
|
176 | File "*/install/lib/python/hgext/phabricator.py", line *, in querydrev (glob) | |||
|
177 | tree = _parse(spec) | |||
|
178 | File "*/install/lib/python/hgext/phabricator.py", line *, in _parse (glob) | |||
|
179 | tree, pos = parser.parser(_elements).parse(_tokenize(text)) | |||
|
180 | File "*/install/lib/python/mercurial/parser.py", line *, in parse (glob) | |||
|
181 | self._advance() | |||
|
182 | File "*/install/lib/python/mercurial/parser.py", line *, in _advance (glob) | |||
|
183 | self.current = next(self._iter, None) | |||
|
184 | File "*/install/lib/python/hgext/phabricator.py", line *, in _tokenize (glob) | |||
|
185 | view = memoryview(text) # zero-copy slice | |||
|
186 | TypeError: memoryview: a bytes-like object is required, not 'str' | |||
|
187 | [1] | |||
|
188 | #endif | |||
|
189 | ||||
134 | Phabreading a DREV with a local:commits time as a string: |
|
190 | Phabreading a DREV with a local:commits time as a string: | |
135 | $ hg phabread --test-vcr "$VCR/phabread-str-time.json" D1285 |
|
191 | $ hg phabread --test-vcr "$VCR/phabread-str-time.json" D1285 | |
136 | # HG changeset patch |
|
192 | # HG changeset patch | |
137 | # User test <test> |
|
193 | # User test <test> | |
138 |
|
|
194 | # Date 1562019844 0 | |
139 |
|
|
195 | # Branch default | |
140 |
|
|
196 | # Node ID da5c8c6bf23a36b6e3af011bc3734460692c23ce | |
141 |
|
|
197 | # Parent 1f634396406d03e565ed645370e5fecd062cf215 | |
142 | test string time |
|
198 | test string time | |
143 |
|
|
199 | ||
144 | Differential Revision: https://phab.mercurial-scm.org/D1285 |
|
200 | Differential Revision: https://phab.mercurial-scm.org/D1285 | |
145 | diff --git a/test b/test |
|
201 | diff --git a/test b/test | |
146 | new file mode 100644 |
|
202 | new file mode 100644 | |
147 | --- /dev/null |
|
203 | --- /dev/null | |
148 | +++ b/test |
|
204 | +++ b/test | |
149 | @@ * @@ (glob) |
|
205 | @@ * @@ (glob) | |
150 | +test |
|
206 | +test | |
151 |
|
|
207 | ||
152 |
|
208 | |||
153 | $ cd .. |
|
209 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now