Patchwork [stable] convert: use bytes for value in extra dict

login
register
mail settings
Submitter Manuel Jacob
Date July 14, 2020, 8:26 a.m.
Message ID <12971abe344f9a88e695.1594715180@tmp>
Download mbox | patch
Permalink /patch/46722/
State Accepted
Headers show

Comments

Manuel Jacob - July 14, 2020, 8:26 a.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1594715141 -7200
#      Tue Jul 14 10:25:41 2020 +0200
# Branch stable
# Node ID 12971abe344f9a88e695666af8c6f60ca9019821
# Parent  2c0043977b6d640d237e52abb75562a741c0c919
# EXP-Topic test-convert-mtn
convert: use bytes for value in extra dict

The keys and values of the extra dict are expected to be bytes. Before this
fix, there was a crash in mercurial.changelog.encodeextra().
Yuya Nishihara - July 14, 2020, 9:31 a.m.
On Tue, 14 Jul 2020 10:26:20 +0200, Manuel Jacob wrote:
> # HG changeset patch
> # User Manuel Jacob <me@manueljacob.de>
> # Date 1594715141 -7200
> #      Tue Jul 14 10:25:41 2020 +0200
> # Branch stable
> # Node ID 12971abe344f9a88e695666af8c6f60ca9019821
> # Parent  2c0043977b6d640d237e52abb75562a741c0c919
> # EXP-Topic test-convert-mtn
> convert: use bytes for value in extra dict

Queued for stable, thanks.

Patch

diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py
--- a/hgext/convert/monotone.py
+++ b/hgext/convert/monotone.py
@@ -337,7 +337,7 @@ 
         extra = {}
         certs = self.mtngetcerts(rev)
         if certs.get(b'suspend') == certs[b"branch"]:
-            extra[b'close'] = 1
+            extra[b'close'] = b'1'
         dateformat = b"%Y-%m-%dT%H:%M:%S"
         return common.commit(
             author=certs[b"author"],