Patchwork D8221: phabricator: also check parent fctx for binary where it is checked for UTF-8

login
register
mail settings
Submitter phabricator
Date March 4, 2020, 7:07 p.m.
Message ID <1b468df7ecaf75eae56a6e12fc079a1d@localhost.localdomain>
Download mbox | patch
Permalink /patch/45480/
State Not Applicable
Headers show

Comments

phabricator - March 4, 2020, 7:07 p.m.
Closed by commit rHG4ce2330f2d0b: phabricator: also check parent fctx for binary where it is checked for UTF-8 (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8221?vs=20469&id=20483

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8221/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8221

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: Kwan, mercurial-devel

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -831,7 +831,12 @@ 
             pchange.addoldmode(originalmode)
             pchange.addnewmode(filemode)
 
-        if fctx.isbinary() or notutf8(fctx) or notutf8(oldfctx):
+        if (
+            fctx.isbinary()
+            or notutf8(fctx)
+            or oldfctx.isbinary()
+            or notutf8(oldfctx)
+        ):
             makebinary(pchange, fctx)
             addoldbinary(pchange, fctx.p1(), fctx)
         else:
@@ -892,7 +897,11 @@ 
             pchange.addnewmode(gitmode[fctx.flags()])
             pchange.type = DiffChangeType.ADD
 
-        if fctx.isbinary() or notutf8(fctx) or (oldfctx and notutf8(oldfctx)):
+        if (
+            fctx.isbinary()
+            or notutf8(fctx)
+            or (oldfctx and (oldfctx.isbinary() or notutf8(oldfctx)))
+        ):
             makebinary(pchange, fctx)
             if renamed:
                 addoldbinary(pchange, oldfctx, fctx)