Eric Schrock <eric.schrock at sun.com> writes:
> I'm finding that if I try to run 'hg -y push', I'm getting booted out of
> cdm.pbconfirm despite the fact that I've specified '-y' to answer "yes"
> to everything. Looking at the code for yes_no(), we manually check
> ui.interactive, and then always return the default answer ("no" in this
> case) for the non-interactive case. Why are we not just using
> ui.prompt(), which is supposed to return the default answer in a
> non-interactive case, and presumably knows how to replace it with 'y' if
> 'hg -y' is specified? I hacked up my cdm.py to always call ui.prompt()
> and let it do the work, and that seems to work.
>
My recollection (and notes) suggest we did that to avoid a bug in
ui.prompt() where it didn't get the !isatty() case correct.
I think that is now fixed, so we could change.
However, what you seem to be disliking is that while -y is documented:
-y --noninteractive do not prompt, assume 'yes' for any required
answers
It actually assumes the *default* answer for any given answer, not
'yes', and pbconfirm defaults to "no".
I don't see ui.prompt() doing any magic such that the !isatty() case,
and the -y case are separate. So you'd still be defaulting to "No",
surely?
-- Rich