hg clone doesn't really clone

Douglas Philips dgou at mac.com
Mon Aug 10 18:53:53 CDT 2009


On 2009 Aug 10, at 7:46 PM, Nick wrote:
> It seems to be adding in an extra "working" copy of the files in the
> repo.  Is there any way to get a real clone?  It seems silly to waste
> space in this fashion.  I could do the clone and then manually delete
> the files at the root, but that seems really stupid and inefficient.

Perhaps what you want is the noupdate option?
from 'hg help clone':

     By default, clone will check out the head of the 'default' branch.
     If the -U/--noupdate option is used, the new clone will contain
     only a repository (.hg) and no working copy (the working copy
     parent is the null revision).

Also, if you are doing the clone locally, you should be aware of:
from 'hg help clone':

     For efficiency, hardlinks are used for cloning whenever the source
     and destination are on the same filesystem (note this applies only
     to the repository data, not to the checked out files). Some
     filesystems, such as AFS, implement hardlinking incorrectly, but
     do not report errors. In these cases, use the --pull option to
     avoid hardlinking.


HTH,
	-Doug



More information about the Mercurial mailing list