The motivation is simple: it's nicer to avoid gating basic
To reduce the risk of people shooting themselves in the feet, `hg
purge` without further argument fails. Instead we add a flag -u that
means "delete unknown files", and the user must pass one of -u,
-i, or --all.
When the extension is loaded, -u is implied for compatibility, but
it can be passed explicitly, so one can call hg purge -u and have
that work regardless of whether the extension is loaded.
For review of the body of the purge command, use this instead of what
hg/phabricator will show (the block of code is modified, not just
diff -U 1000 <(hg cat -r .^ hgext/purge.py) <(cat mercurial/commands.py | grep -B 1 -A 1000 'purge|clean' | grep -B 1000 "ui.write") | colordiff | less -R
This is not exactly what was discussed at the sprint (people mentioned
an interactive prompt if some flag is not given), but this seems more
natural and as safe?
Separately, we could, in principle, prevent prefixes of hg pur and
hg cle from running purge, if people are still worried about users
typing the wrong things.