comparison tests/test-phabricator.t @ 44329:d1177d39012e stable

phabricator: fix a phabsend crash when processing a renamed binary This was a trivial fix, and some more tests are added to cover binary files. Since the old filecontext is passed in, the old name is still available. But I noticed some weirdness around what it marked as binary and not, and what is viewable in Phabricator. Those things have been flagged, and will probably take some digging. Differential Revision: https://phab.mercurial-scm.org/D8133
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 18 Feb 2020 13:46:10 -0500
parents 5d85e9ddc7b9
children 09f3e003fc2a
comparison
equal deleted inserted replaced
44328:60bc043d7df7 44329:d1177d39012e
154 uploading bin@d8d62a881b54 154 uploading bin@d8d62a881b54
155 D8008 - created - d8d62a881b54: modify binary 155 D8008 - created - d8d62a881b54: modify binary
156 D8009 - created - af55645b2e29: remove binary 156 D8009 - created - af55645b2e29: remove binary
157 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/aa24a81f55de-a3a0cf24-phabsend.hg 157 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/aa24a81f55de-a3a0cf24-phabsend.hg
158 158
159 Phabsend a renamed binary and a copied binary, with and without content changes
160 to src and dest
161
162 >>> open('bin2', 'wb').write(b'\0c') and None
163 $ hg ci -Am 'add another binary'
164 adding bin2
165
166 TODO: "bin2" can't be viewed in this commit (left or right side), and the URL
167 looks much different than when viewing "bin2_moved". No idea if this is a phab
168 bug, or phabsend bug. The patch (as printed by phabread) look reasonable
169 though.
170
171 $ hg mv bin2 bin2_moved
172 $ hg ci -m "moved binary"
173
174 Note: "bin2_moved" is also not viewable in phabricator with this review
175
176 $ hg cp bin2_moved bin2_copied
177 $ hg ci -m "copied binary"
178
179 Note: "bin2_moved_again" is marked binary in phabricator, and both sides of it
180 are viewable in their proper state. "bin2_copied" is not viewable, and not
181 listed as binary in phabricator.
182
183 >>> open('bin2_copied', 'wb').write(b'\0move+mod') and None
184 $ hg mv bin2_copied bin2_moved_again
185 $ hg ci -m "move+mod copied binary"
186
187 Note: "bin2_moved" and "bin2_moved_copy" are both marked binary, and both
188 viewable on each side.
189
190 >>> open('bin2_moved', 'wb').write(b'\0precopy mod') and None
191 $ hg cp bin2_moved bin2_moved_copied
192 >>> open('bin2_moved', 'wb').write(b'\0copy src+mod') and None
193 $ hg ci -m "copy+mod moved binary"
194
195 $ hg phabsend -r .~4:: --test-vcr "$VCR/phabsend-binary-renames.json"
196 uploading bin2@f42f9195e00c
197 D8128 - created - f42f9195e00c: add another binary
198 D8129 - created - 834ab31d80ae: moved binary
199 D8130 - created - 494b750e5194: copied binary
200 uploading bin2_moved_again@25f766b50cc2
201 D8131 - created - 25f766b50cc2: move+mod copied binary
202 uploading bin2_moved_copied@1b87b363a5e4
203 uploading bin2_moved@1b87b363a5e4
204 D8132 - created - 1b87b363a5e4: copy+mod moved binary
205 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/f42f9195e00c-e82a0769-phabsend.hg
206
159 Phabreading a DREV with a local:commits time as a string: 207 Phabreading a DREV with a local:commits time as a string:
160 $ hg phabread --test-vcr "$VCR/phabread-str-time.json" D1285 208 $ hg phabread --test-vcr "$VCR/phabread-str-time.json" D1285
161 # HG changeset patch 209 # HG changeset patch
162 # User Pulkit Goyal <7895pulkit@gmail.com> 210 # User Pulkit Goyal <7895pulkit@gmail.com>
163 # Date 1509404054 -19800 211 # Date 1509404054 -19800