##// END OF EJS Templates
py3: add test demonstrating TypeError when phabsending skips unchanged commits...
Ian Moody -
r43219:3355e0c2 default
parent child Browse files
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
@@ -131,6 +131,62 b' Commenting when phabsending:'
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
General Comments 0
You need to be logged in to leave comments. Login now