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