Patchwork D2551: match: some minimal pycompat fixes guided by test-hgignore.t

login
register
mail settings
Submitter phabricator
Date March 2, 2018, 2:51 p.m.
Message ID <differential-rev-PHID-DREV-gupl2cqohec2phb4szmn-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28682/
State Superseded
Headers show

Comments

phabricator - March 2, 2018, 2:51 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/match.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -16,6 +16,7 @@ 
     encoding,
     error,
     pathutil,
+    pycompat,
     util,
 )
 
@@ -226,7 +227,7 @@ 
             except IOError as inst:
                 if warn:
                     warn(_("skipping unreadable pattern file '%s': %s\n") %
-                         (pat, inst.strerror))
+                         (pat, util.forcebytestr(inst.strerror)))
             continue
         # else: re or relre - which cannot be normalized
         kindpats.append((kind, pat, ''))
@@ -428,7 +429,7 @@ 
 
     @encoding.strmethod
     def __repr__(self):
-        return ('<includematcher includes=%r>' % self._pats)
+        return ('<includematcher includes=%r>' % pycompat.bytestr(self._pats))
 
 class exactmatcher(basematcher):
     '''Matches the input files exactly. They are interpreted as paths, not