[PATCH] purge: add options for deleting only files or only directories

Kevin Bullock kbullock+mercurial at ringworld.org
Sat Nov 16 14:54:43 CST 2013


On 16 Nov 2013, at 3:15 PM, Ben Kehoe <benk at berkeley.edu> wrote:

> On Sat, Nov 16, 2013 at 11:51 AM, Matt Mackall <mpm at selenic.com> wrote:
> 
>> Perhaps we can do this with filesets.
> 
> The primary motivation was that when mercurial is being used to version the state of another program, that program may only do directory creation at an initial point, and then afterwards assume the directory structure is intact (poor design, but what can you do?), although some directories may be empty (e.g., bin before a build is run). Restoring a previous state would then be:
> hg revert -aC && hg purge --files
> The code for purge makes a clear distinction between files and directories, which is why it seemed natural to add those simple options.

I agree with Matt, I think for the user-facing portion of this it doesn't make much sense to add options when we have a mechanism for specifying arbitrary groups of files. I'm not sure how useful it will be outside purge to specify just regular files or just directories, but I _can_ see a use case for e.g. specifying all executable files.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list