##// END OF EJS Templates
clone: use "official" API to create local clone destination...
marmoute -
r48235:d1c1fd7a default
parent child Browse files
Show More
@@ -857,20 +857,17 b' def clone('
857 857
858 858 if copy:
859 859 srcrepo.hook(b'preoutgoing', throw=True, source=b'clone')
860 hgdir = os.path.realpath(os.path.join(dest, b".hg"))
861 if not os.path.exists(dest):
862 util.makedirs(dest)
863 try:
864 destpath = hgdir
865 util.makedir(destpath, notindexed=True)
866 except OSError as inst:
867 if inst.errno == errno.EEXIST:
868 cleandir = None
869 raise error.Abort(
870 _(b"destination '%s' already exists") % dest
860
861 destrootpath = urlutil.urllocalpath(dest)
862 dest_reqs = localrepo.clone_requirements(ui, createopts, srcrepo)
863 localrepo.createrepository(
864 ui,
865 destrootpath,
866 requirements=dest_reqs,
871 867 )
872 raise
868 destrepo = localrepo.makelocalrepository(ui, destrootpath)
873 869
870 destpath = destrepo.vfs.base
874 871 destlock = copystore(ui, srcrepo, destpath)
875 872 # copy bookmarks over
876 873 srcbookmarks = srcrepo.vfs.join(b'bookmarks')
@@ -48,6 +48,7 b' Poke at a clone:'
48 48 hgrc
49 49 requires
50 50 store
51 wcache
51 52
52 53 Should be empty:
53 54
@@ -111,6 +111,7 b' Test basic extension support'
111 111 reposetup called for a
112 112 ui == repo.ui
113 113 uipopulate called (1 times)
114 uipopulate called (1 times)
114 115 reposetup called for b
115 116 ui == repo.ui
116 117 updating to branch default
General Comments 0
You need to be logged in to leave comments. Login now