[PATCH V2] clone: allow clones into effectively empty directories

Dominik Psenner dpsenner at gmail.com
Fri Apr 8 01:40:54 CDT 2011


Again, I would propose to enable clones into non-empty directories if the
clone invokes also update. Hg would bail only if there exists an .hg
directory. On the automatic update one could either:

1* keep existing files on update => working dir represents revision, but one
could subsequently add/commit changed files

2* empty up directory on update => working dir represents exactly the
revision

Both cases cover the problems of the "effectively" empty directories as the
user can either remove the files or import existing files into the
repository by subsequently checking the working dir status, ignore files,
add files and commit changes.

I can think of other usecases where this behaviour would be neat:

Alice has downloaded a source archive and hacked a bit on that. Later she
finds out where the repository is and clones from there into that directory.
She could immediately commit all changes she made without copying the source
files around.

Of course this would solve also the problem of the "effectively" empty
directories as the problem is shifted to the user without requiring him to
do copy/move/delete operations on the files. This solution is free of any OS
specific stuff as the user decides to either overwrite or keep the files and
in case he kept them, to do whatever he pleases once he has a working copy
with the existing files inside.

Greetings,
D.

> -----Original Message-----
> From: mercurial-devel-bounces at selenic.com [mailto:mercurial-devel-
> bounces at selenic.com] On Behalf Of Steve Losh
> Sent: Thursday, April 07, 2011 3:37 PM
> To: mercurial-devel at selenic.com
> Subject: Re: [PATCH V2] clone: allow clones into effectively empty
> directories
> 
> On 04/07/11 at 10:47P, Dirkjan Ochtman wrote:
> > On Wed, Apr 6, 2011 at 11:00, Dominik Psenner <dpsenner at gmail.com>
> wrote:
> > > * enable hg to clone into non-empty directories
> >
> > I was thinking recently it would be nice to have a clone --force for
> this.
> 
> +1 on this.  I just played around with making a shell alias to replicate
> it with
> init+pull but there are too many edge cases.
> 
> >
> > Cheers,
> >
> > Dirkjan
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel at selenic.com
> > http://selenic.com/mailman/listinfo/mercurial-devel
> 
> --
> Steve Losh
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list