Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hg.py @ 49859:8a38cd76588f
clone: explicitly detect the need to fetch a peer
Instead of having `peer()` method on all `peer()` for this usecase, we could
simply handle it explicitly.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 03 Dec 2022 03:45:39 +0100 |
parents | 2a5feacc4085 |
children | 78af51ba73c5 |
comparison
equal
deleted
inserted
replaced
49858:2a5feacc4085 | 49859:8a38cd76588f |
---|---|
715 srcpeer = peer(ui, peeropts, src_path) | 715 srcpeer = peer(ui, peeropts, src_path) |
716 origsource = src_path.rawloc | 716 origsource = src_path.rawloc |
717 branches = (src_path.branch, branch or []) | 717 branches = (src_path.branch, branch or []) |
718 source = src_path.loc | 718 source = src_path.loc |
719 else: | 719 else: |
720 if util.safehasattr(source, 'peer'): | |
721 srcpeer = source.peer() # in case we were called with a localrepo | |
722 else: | |
723 srcpeer = source | |
724 branches = (None, branch or []) | |
720 # XXX path: simply use the peer `path` object when this become available | 725 # XXX path: simply use the peer `path` object when this become available |
721 srcpeer = source.peer() # in case we were called with a localrepo | 726 srcpeer = source.peer() # in case we were called with a localrepo |
722 branches = (None, branch or []) | 727 branches = (None, branch or []) |
723 origsource = source = srcpeer.url() | 728 origsource = source = srcpeer.url() |
724 srclock = destlock = destwlock = cleandir = None | 729 srclock = destlock = destwlock = cleandir = None |