[PATCH 1 of 3 V2] py3: explicitly convert a list to bytes to pass in ui.debug

Pulkit Goyal 7895pulkit at gmail.com
Mon May 15 17:50:46 UTC 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1493837589 -19800
#      Thu May 04 00:23:09 2017 +0530
# Node ID d186d8361d0526413dd1399e92ccdb40f3ca2056
# Parent  1ada3d18e7fbc9069910f2c036992d2f2b28e058
py3: explicitly convert a list to bytes to pass in ui.debug

Here pats is a list obviously. Since we can't pass unicodes to ui.debug, we
have to pass this as bytes.

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -17,6 +17,7 @@
 from mercurial import (
     archival,
     cmdutil,
+    encoding,
     error,
     hg,
     match as matchmod,
@@ -380,8 +381,8 @@
             r = origmatchfn(f)
             return r
         m.matchfn = lfmatchfn
-
-        ui.debug('updated patterns: %s\n' % sorted(pats))
+        bytespats = '[' + ', '.join(sorted(pats)) + ']'
+        ui.debug('updated patterns: %s\n' % bytespats)
         return m, pats
 
     # For hg log --patch, the match object is used in two different senses:


More information about the Mercurial-devel mailing list