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

Dominik Psenner dpsenner at gmail.com
Wed Apr 6 03:17:41 CDT 2011


> -----Original Message-----
> From: mercurial-devel-bounces at selenic.com [mailto:mercurial-devel-
> bounces at selenic.com] On Behalf Of Jason Harris
> Sent: Tuesday, April 05, 2011 2:13 PM
> To: Frank Kingswood
> Cc: mercurial-devel at selenic.com
> Subject: Re: [PATCH V2] clone: allow clones into effectively empty
> directories
> 
> On Apr 5, 2011, at 1:46 PM, Frank Kingswood wrote:
> 
> > On 05/04/11 11:58, Jason Harris wrote:
> >> # HG changeset patch
> >> # User jfh<jason at jasonfharris.com>
> >> # Date 1301985969 -7200
> >> # Node ID 730ee0bb855649b63c93318434e657b3432fa1dd
> >> # Parent  0995eee8ffe4a24478379fb16fd6c38812bc3dd5
> >> clone: allow clones into effectively empty directories
> >>
> >> In OSX many empty directories actually have a '.DS_Store' file
> >> in them, which is effectively ignored by lots of things.  The
> >> presence of this .DS_Store file shouldn't mean that the directory
> >> is treated as though it really has stuff in it.
> >>
> >> Similarly, ignore the thumbs.db and desktop.ini files for windows
> >> support.
> >
> > This is getting far too magic for my liking. What if someone actually
> has such a file in his repository?
> 
> It doesn't matter if such a file is in a repository. The question is: if
> you clone into a directory and the directory is to all essentially
> purposes empty. Should we still bail even if there is OS cruft in the
> directory? Right now if its totally empty then Mercurial allows the clone
> into the directory. This patch changes things so that if there is a
> directory and it *only* contains something like a '.DS_Store' file it
> means that the user has created this in the OSX finder and we should be
> able to clone a repo *into* that directory, and so we allow the clone. (It
> certainly is not hard to imagine a user creating a folder in the windows
> explorer or the OSX finder and then wanting to clone into it...)
> 
> (Actually I created this patch in response to:
> https://bitbucket.org/jfh/machg/issue/222)
> 
> Its not of course a critical issue, and maybe we would want these files to
> be platform specific? 

*uoh* What if I mounted a winX folder into unix?

Certainly the case of anyone ever having a single
> directory with the file .DS_Store in windows or linux and them actually
> storing useful information in this single file is pretty vanishingly
> small...
> 
> 
> > Really this is just a change to allow users to avoid the stop-and-think
> when overwriting a directory -- it is not really all that much work to
> delete a directory.
> 
> Its a small detail, but it smooths the process on OSX, for users. A good
> UI just does such things unobtrusively and without hassling the user.
> 
> Cheers,
>   Jas
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list