Patchwork D7066: phabricator: convert phabhunk and phabchange keys to bytes when finalising

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2019, 8:51 p.m.
Message ID <4c6439b3f2ea123d16878395dbc48412@localhost.localdomain>
Download mbox | patch
Permalink /patch/42421/
State Not Applicable
Headers show

Comments

phabricator - Oct. 16, 2019, 8:51 p.m.
Closed by commit rHG7dca674a456b: phabricator: convert phabhunk and phabchange keys to bytes when finalising (authored by Kwan).
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/D7066?vs=17101&id=17255

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

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -518,7 +518,7 @@ 
     def addhunk(self, hunk):
         if not isinstance(hunk, phabhunk):
             raise error.Abort(b'phabchange.addhunk only takes phabhunks')
-        self.hunks.append(hunk)
+        self.hunks.append(pycompat.byteskwargs(attr.asdict(hunk)))
         # It's useful to include these stats since the Phab web UI shows them,
         # and uses them to estimate how large a change a Revision is. Also used
         # in email subjects for the [+++--] bit.
@@ -549,7 +549,9 @@ 
     def addchange(self, change):
         if not isinstance(change, phabchange):
             raise error.Abort(b'phabdiff.addchange only takes phabchanges')
-        self.changes[change.currentPath] = change
+        self.changes[change.currentPath] = pycompat.byteskwargs(
+            attr.asdict(change)
+        )
 
 
 def maketext(pchange, ctx, fname):