Problems with the "purge" command
Dr Rainer Woitok
rainer.woitok at gmail.com
Fri Jun 16 14:58:42 UTC 2023
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
More information about the Mercurial
mailing list