Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hg.py @ 26026:d08e7449ff27 stable
hg: avoid auto sharing when the clone destination is remote
Before this patch, when auto sharing is enabled, 'hg.clone()' tries to
create local clone regardless of locality of the clone destination on
the host, and causes failure.
To avoid auto sharing when the clone destination is remote, this patch
adds examination of 'islocal(dest)' before auto sharing in
'hg.clone()'.
'islocal(dest)' is examined after 'sharepool', because:
- the former is more expensive than the latter
- without enabling share extension, the later is always negative
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 13 Aug 2015 15:07:07 +0900 |
parents | 0d37b9b21467 |
children | 5243890224ff |
comparison
equal
deleted
inserted
replaced
26025:ba8089433090 | 26026:d08e7449ff27 |
---|---|
402 raise util.Abort(_("destination '%s' is not empty") % dest) | 402 raise util.Abort(_("destination '%s' is not empty") % dest) |
403 | 403 |
404 shareopts = shareopts or {} | 404 shareopts = shareopts or {} |
405 sharepool = shareopts.get('pool') | 405 sharepool = shareopts.get('pool') |
406 sharenamemode = shareopts.get('mode') | 406 sharenamemode = shareopts.get('mode') |
407 if sharepool: | 407 if sharepool and islocal(dest): |
408 sharepath = None | 408 sharepath = None |
409 if sharenamemode == 'identity': | 409 if sharenamemode == 'identity': |
410 # Resolve the name from the initial changeset in the remote | 410 # Resolve the name from the initial changeset in the remote |
411 # repository. This returns nullid when the remote is empty. It | 411 # repository. This returns nullid when the remote is empty. It |
412 # raises RepoLookupError if revision 0 is filtered or otherwise | 412 # raises RepoLookupError if revision 0 is filtered or otherwise |