##// 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:

r18506:ef60083b stable
r21195:9336bc7d stable
Show More
test-dispatch.t
64 lines | 1.2 KiB | text/troff | Tads3Lexer
test command parsing and dispatch
$ hg init a
$ cd a
Redundant options used to crash (issue436):
$ hg -v log -v
$ hg -v log -v x
$ echo a > a
$ hg ci -Ama
adding a
Missing arg:
$ hg cat
hg cat: invalid arguments
hg cat [OPTION]... FILE...
output the current or given revision of files
options:
-o --output FORMAT print output to file with formatted name
-r --rev REV print the given revision
--decode apply any matching decode filter
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
[+] marked option can be specified multiple times
use "hg help cat" to show the full help text
[255]
[defaults]
$ hg cat a
a
$ cat >> $HGRCPATH <<EOF
> [defaults]
> cat = -r null
> EOF
$ hg cat a
a: no such file in rev 000000000000
[1]
$ cd "$TESTTMP"
OSError "No such file or directory" / "The system cannot find the path
specified" should include filename even when it is empty
$ hg -R a archive ''
abort: *: '' (glob)
[255]
#if no-outer-repo
No repo:
$ hg cat
abort: no repository found in '$TESTTMP' (.hg not found)!
[255]
#endif