comparison hgext/phabricator.py @ 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 adb93aa98c78
comparison
equal deleted inserted replaced
44328:60bc043d7df7 44329:d1177d39012e
890 pchange.type = DiffChangeType.ADD 890 pchange.type = DiffChangeType.ADD
891 891
892 if fctx.isbinary() or notutf8(fctx): 892 if fctx.isbinary() or notutf8(fctx):
893 makebinary(pchange, fctx) 893 makebinary(pchange, fctx)
894 if renamed: 894 if renamed:
895 addoldbinary(pchange, fctx, originalfname) 895 addoldbinary(pchange, fctx)
896 else: 896 else:
897 maketext(pchange, ctx, fname) 897 maketext(pchange, ctx, fname)
898 898
899 pdiff.addchange(pchange) 899 pdiff.addchange(pchange)
900 900