comparison mercurial/hg.py @ 39185:143efea71c2a

clone: allow local cloning to create more than one level of directories I figure cloning a remote repository is more common, thus it's more likely that some people might be relying on the less restrictive behavior. Additionally, `hg init` will also create more than one level of missing directories. I also have a use case for reading the subrepos from .hgsub, and sharing them into the normal nested location on the server. SCM Manager doesn't host subrepos in the normal nested location, which is nice for deduplicating the repository data, but confuses `hg verify`. Some of the subrepos are in the root of the repositories, while others are one or two directories deep. So not having to build up the parent path first is desirable.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 18 Aug 2018 00:51:26 -0400
parents d58958676b3c
children e8deaa77c1b6
comparison
equal deleted inserted replaced
39184:8724de878268 39185:143efea71c2a
632 632
633 if copy: 633 if copy:
634 srcrepo.hook('preoutgoing', throw=True, source='clone') 634 srcrepo.hook('preoutgoing', throw=True, source='clone')
635 hgdir = os.path.realpath(os.path.join(dest, ".hg")) 635 hgdir = os.path.realpath(os.path.join(dest, ".hg"))
636 if not os.path.exists(dest): 636 if not os.path.exists(dest):
637 os.mkdir(dest) 637 util.makedirs(dest)
638 else: 638 else:
639 # only clean up directories we create ourselves 639 # only clean up directories we create ourselves
640 cleandir = hgdir 640 cleandir = hgdir
641 try: 641 try:
642 destpath = hgdir 642 destpath = hgdir