Problems with the "purge" command

Craig Ozancin c.ozancin at gmail.com
Fri Jun 16 16:07:22 UTC 2023


On Fri, Jun 16, 2023 at 9:54 AM John W <jwdevel at gmail.com> wrote:

> I find that putting "hgext.purge =" in my [extensions] makes the
> difference.
>
> Though I don't know why that is; is purge built-in, or an extension?
> Or an extension that was later moved to be built-in? Seems like maybe
> a bug.
>

This is currently the only way to get purge to not query. When purge was
moved to core, the default behavior was changed to always
query the user. This can be overridden by adding purge as an extension.
Downside is that the purge extension is marked as deprecated. It would be
nice if a --no-query option was added. As far as I know, the extension is
not actually used.


> Anyway, might be a workaround for you.
> So the full line could be:
>
>     $ HGPLAINEXCEPT= HGRCPATH= $h --config 'extensions.hgext.purge=' purge
>
> -John
>
> On 6/16/23, Dr Rainer Woitok <rainer.woitok at gmail.com> wrote:
> > Greetings,
> >
> > is there a way to have  "hg purge"  just remove  untracked files without
> > asking?  I mean apart from the ancient
> >
> >    purge = !$HG status -nu0 | xargs -0 rm -f
> >
> > in the "[alias]" section of one's "~/.hgrc" file?
> >
> > $ hg version
> > Mercurial Distributed SCM (version 6.4.3+hg3.660cf5c34820)
> > (see https://mercurial-scm.org for more information)
> >
> > Copyright (C) 2005-2023 Olivia Mackall and others
> > This is free software; see the source for copying conditions. There is NO
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
> > $ hg st
> > $ touch xxx
> > $ hg st
> > ? xxx
> > $ HGPLAINEXCEPT= HGRCPATH= hg purge
> > permanently delete 1 unknown files? (yN) n
> > abort: removal cancelled
> > $ HGPLAINEXCEPT= HGRCPATH= hg purge --noninteractive
> > permanently delete 1 unknown files? (yN) n
> > abort: removal cancelled
> > $ HGPLAINEXCEPT= HGRCPATH= hg purge --confirm
> > permanently delete 1 unknown files? (yN) n
> > abort: removal cancelled
> > $
> >
> > Since there is a "--confirm" option,  I expected not specifying it would
> > do the trick,  but apparently  this option  is totally irrelevant.   And
> > "--noninteractive",  which just prints its choice after the question and
> > then continues, is said to "pick the FIRST choice" (capitalzation by me)
> > which would be "y" rather than "N",  but apparently it prefers the CAPI-
> > TALIZED choice instead (or even the last).
> >
> > What else could I try?
> >
> > Sincerely,
> >   Rainer
> > _______________________________________________
> > Mercurial mailing list
> > Mercurial at lists.mercurial-scm.org
> > https://lists.mercurial-scm.org/mailman/listinfo/mercurial
> >
> _______________________________________________
> Mercurial mailing list
> Mercurial at lists.mercurial-scm.org
> https://lists.mercurial-scm.org/mailman/listinfo/mercurial
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20230616/400bb77a/attachment.html>


More information about the Mercurial mailing list