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

Ben Kehoe benk at berkeley.edu
Sat Nov 16 14:15:50 CST 2013


On Sat, Nov 16, 2013 at 11:51 AM, Matt Mackall <mpm at selenic.com> wrote:

> On Sat, 2013-11-16 at 12:55 -0500, Mads Kiilerich wrote:
> > On 11/16/2013 12:44 PM, Augie Fackler wrote:
> > > On Thu, Nov 07, 2013 at 05:29:08PM -0800, Ben Kehoe wrote:
> > >> # HG changeset patch
> > >> # User Ben Kehoe <benk at berkeley.edu>
> > >> # Date 1383873854 28800
> > >> #      Thu Nov 07 17:24:14 2013 -0800
> > >> # Node ID 8d80f5d4459447b7b85571dba6274e6ed8ab2c36
> > >> # Parent  c38c3fdc8b9317ba09e03ab09364c3800da7c50c
> > >> purge: add options for deleting only files or only directories
> > > I think I like this. Anyone else have an opinion?
> >
> > What are the good use cases?
> >
> > It seems to me like the (admittedly very small) cost it has is bigger
> > than the value it adds.
>
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20131116/bc9375bd/attachment.html>


More information about the Mercurial-devel mailing list