comparison mercurial/subrepo.py @ 41483:46ab0c6b28dc

subrepo: bytes/str cleanups on Git support Git subrepo tests now pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5768
author Augie Fackler <augie@google.com>
date Wed, 30 Jan 2019 19:29:32 -0500
parents 9199548525fc
children fa7d4e6a0c98
comparison
equal deleted inserted replaced
41482:b58d608ec6a0 41483:46ab0c6b28dc
1282 close_fds=procutil.closefds, 1282 close_fds=procutil.closefds,
1283 stdout=subprocess.PIPE, stderr=errpipe) 1283 stdout=subprocess.PIPE, stderr=errpipe)
1284 if stream: 1284 if stream:
1285 return p.stdout, None 1285 return p.stdout, None
1286 1286
1287 retdata = p.stdout.read().strip() 1287 retdata = pycompat.fsencode(p.stdout.read().strip())
1288 # wait for the child to exit to avoid race condition. 1288 # wait for the child to exit to avoid race condition.
1289 p.wait() 1289 p.wait()
1290 1290
1291 if p.returncode != 0 and p.returncode != 1: 1291 if p.returncode != 0 and p.returncode != 1:
1292 # there are certain error codes that are ok 1292 # there are certain error codes that are ok
1658 unit=_('files')) 1658 unit=_('files'))
1659 progress.update(0) 1659 progress.update(0)
1660 for info in tar: 1660 for info in tar:
1661 if info.isdir(): 1661 if info.isdir():
1662 continue 1662 continue
1663 if match and not match(info.name): 1663 bname = pycompat.fsencode(info.name)
1664 if match and not match(bname):
1664 continue 1665 continue
1665 if info.issym(): 1666 if info.issym():
1666 data = info.linkname 1667 data = info.linkname
1667 else: 1668 else:
1668 data = tar.extractfile(info).read() 1669 data = tar.extractfile(info).read()
1669 archiver.addfile(prefix + self._path + '/' + info.name, 1670 archiver.addfile(prefix + self._path + '/' + bname,
1670 info.mode, info.issym(), data) 1671 info.mode, info.issym(), data)
1671 total += 1 1672 total += 1
1672 progress.increment() 1673 progress.increment()
1673 progress.complete() 1674 progress.complete()
1674 return total 1675 return total