diff hgext/phabricator.py @ 44141:5d85e9ddc7b9 stable

phabricator: fix a crash when submitting binaries (issue6260) I think this assumed that `p1()` returned the changectx instead of the previous filelog entry. Differential Revision: https://phab.mercurial-scm.org/D8010
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 25 Jan 2020 01:06:46 -0500
parents ff396501e841
children d1177d39012e
line wrap: on
line diff
--- a/hgext/phabricator.py	Wed Jan 22 20:01:38 2020 -0800
+++ b/hgext/phabricator.py	Sat Jan 25 01:06:46 2020 -0500
@@ -747,11 +747,11 @@
     return fphid
 
 
-def addoldbinary(pchange, fctx, originalfname):
+def addoldbinary(pchange, fctx):
     """add the metadata for the previous version of a binary file to the
     phabchange for the new version
     """
-    oldfctx = fctx.p1()[originalfname]
+    oldfctx = fctx.p1()
     if fctx.cmp(oldfctx):
         # Files differ, add the old one
         pchange.metadata[b'old:file:size'] = oldfctx.size()
@@ -832,7 +832,7 @@
 
         if fctx.isbinary() or notutf8(fctx):
             makebinary(pchange, fctx)
-            addoldbinary(pchange, fctx, fname)
+            addoldbinary(pchange, fctx)
         else:
             maketext(pchange, ctx, fname)