equal
deleted
inserted
replaced
823 abspath = origsource |
823 abspath = origsource |
824 if islocal(origsource): |
824 if islocal(origsource): |
825 abspath = os.path.abspath(urlutil.urllocalpath(origsource)) |
825 abspath = os.path.abspath(urlutil.urllocalpath(origsource)) |
826 |
826 |
827 if islocal(dest): |
827 if islocal(dest): |
828 cleandir = dest |
828 if os.path.exists(dest): |
|
829 # only clean up directories we create ourselves |
|
830 hgdir = os.path.realpath(os.path.join(dest, b".hg")) |
|
831 cleandir = hgdir |
|
832 else: |
|
833 cleandir = dest |
829 |
834 |
830 copy = False |
835 copy = False |
831 if ( |
836 if ( |
832 srcrepo |
837 srcrepo |
833 and srcrepo.cancopy() |
838 and srcrepo.cancopy() |
853 if copy: |
858 if copy: |
854 srcrepo.hook(b'preoutgoing', throw=True, source=b'clone') |
859 srcrepo.hook(b'preoutgoing', throw=True, source=b'clone') |
855 hgdir = os.path.realpath(os.path.join(dest, b".hg")) |
860 hgdir = os.path.realpath(os.path.join(dest, b".hg")) |
856 if not os.path.exists(dest): |
861 if not os.path.exists(dest): |
857 util.makedirs(dest) |
862 util.makedirs(dest) |
858 else: |
|
859 # only clean up directories we create ourselves |
|
860 cleandir = hgdir |
|
861 try: |
863 try: |
862 destpath = hgdir |
864 destpath = hgdir |
863 util.makedir(destpath, notindexed=True) |
865 util.makedir(destpath, notindexed=True) |
864 except OSError as inst: |
866 except OSError as inst: |
865 if inst.errno == errno.EEXIST: |
867 if inst.errno == errno.EEXIST: |