clone: make default path absolute for all local paths

This fixes the default path when cloning local repositories with hg-git, since
hg-git cancopy() is false even for local repositories.
This commit is contained in:
Brendan Cully 2011-05-18 23:20:26 -07:00
parent 2bda8cbde2
commit b1b428c2d8

View File

@ -243,13 +243,15 @@ def clone(ui, source, dest=None, pull=False, rev=None, update=True,
src_lock = dest_lock = dir_cleanup = None src_lock = dest_lock = dir_cleanup = None
try: try:
abspath = origsource
if islocal(origsource):
abspath = os.path.abspath(util.localpath(origsource))
if islocal(dest): if islocal(dest):
dir_cleanup = DirCleanup(dest) dir_cleanup = DirCleanup(dest)
abspath = origsource
copy = False copy = False
if src_repo.cancopy() and islocal(dest): if src_repo.cancopy() and islocal(dest):
abspath = os.path.abspath(util.localpath(origsource))
copy = not pull and not rev copy = not pull and not rev
if copy: if copy: