##// END OF EJS Templates
cmdserver: forcibly use L channel to read password input (issue3161)...
cmdserver: forcibly use L channel to read password input (issue3161) Command server is designed to use the channel protocol even if the server process is accessible to tty, whereas vanilla hg should be able to read password from tty in that case. So it isn't enough to swap sys.stdin: # works only if the server process is detached from the console sys.stdin = self.fin getpass.getpass('') sys.stdin = oldin or test isatty: # vanilla hg can't talk to tty if stdin is redirected if self._isatty(self.fin): return getpass.getpass('') else: ... Since ui.nontty flag is undocumented and command-server channels don't provide isatty(), this change won't affect the other uses of ui._isatty(). issue3161 also suggests to provide some context of messages. I think it can be implemented by using the generic templating function.

File last commit:

r20896:9fae0183 default
r21195:9336bc7d stable
Show More
test-hup.t
37 lines | 926 B | text/troff | Tads3Lexer
Test hangup signal in the middle of transaction
$ "$TESTDIR/hghave" serve fifo || exit 80
$ hg init
$ mkfifo p
$ hg serve --stdio < p 1>out 2>&1 &
$ P=$!
Do test while holding fifo open
$ (
> echo lock
> echo addchangegroup
> start=`date +%s`
> # 10 second seems much enough to let the server catch up
> deadline=`expr $start + 10`
> while [ ! -s .hg/store/journal ]; do
> sleep 0;
> if [ `date +%s` -gt $deadline ]; then
> echo "transaction did not start after 10 seconds" >&2;
> exit 1;
> fi
> done
> kill -HUP $P
> ) > p
$ wait
$ cat out
0
0
adding changesets
transaction abort!
rollback completed
killed!
$ echo .hg/* .hg/store/*
.hg/00changelog.i .hg/journal.bookmarks .hg/journal.branch .hg/journal.desc .hg/journal.dirstate .hg/requires .hg/store .hg/store/00changelog.i .hg/store/00changelog.i.a .hg/store/journal.phaseroots