comparison mercurial/hg.py @ 32970:11c0bb4ccc76

py3: replace str with bytes in isinstance() We were using str because on Python 2, str were bytes but now we have to use bytes. Otherwise the if conditions fails and we have weird results from commands on Python 3.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 20 Jun 2017 23:46:18 +0530
parents a25cc3ca874f
children 071732d9c210
comparison
equal deleted inserted replaced
32969:30d0cb279bac 32970:11c0bb4ccc76
475 repository. "identity" means the name is derived from the node of the first 475 repository. "identity" means the name is derived from the node of the first
476 changeset in the repository. "remote" means the name is derived from the 476 changeset in the repository. "remote" means the name is derived from the
477 remote's path/URL. Defaults to "identity." 477 remote's path/URL. Defaults to "identity."
478 """ 478 """
479 479
480 if isinstance(source, str): 480 if isinstance(source, bytes):
481 origsource = ui.expandpath(source) 481 origsource = ui.expandpath(source)
482 source, branch = parseurl(origsource, branch) 482 source, branch = parseurl(origsource, branch)
483 srcpeer = peer(ui, peeropts, source) 483 srcpeer = peer(ui, peeropts, source)
484 else: 484 else:
485 srcpeer = source.peer() # in case we were called with a localrepo 485 srcpeer = source.peer() # in case we were called with a localrepo