diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -1658,15 +1658,16 @@ unit=_('files')) progress.update(0) for info in tar: + infoname = pycompat.bytestr(info.name) if info.isdir(): continue - if match and not match(info.name): + if match and not match(infoname): continue if info.issym(): data = info.linkname else: data = tar.extractfile(info).read() - archiver.addfile(prefix + self._path + '/' + info.name, + archiver.addfile(prefix + self._path + '/' + infoname, info.mode, info.issym(), data) total += 1 progress.increment()