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

r16913:f2719b38 default
r21195:9336bc7d stable
Show More
test-import-unknown.t
69 lines | 1.4 KiB | text/troff | Tads3Lexer
/ tests / test-import-unknown.t
$ cat <<EOF >> $HGRCPATH
> [extensions]
> purge =
> EOF
$ hg init test
$ cd test
$ echo a > changed
$ echo a > removed
$ echo a > source
$ hg ci -Am addfiles
adding changed
adding removed
adding source
$ echo a >> changed
$ echo a > added
$ hg add added
$ hg rm removed
$ hg cp source copied
$ hg diff --git > ../unknown.diff
Test adding on top of an unknown file
$ hg up -qC 0
$ hg purge
$ echo a > added
$ hg import --no-commit ../unknown.diff
applying ../unknown.diff
file added already exists
1 out of 1 hunks FAILED -- saving rejects to file added.rej
abort: patch failed to apply
[255]
Test modifying an unknown file
$ hg revert -aq
$ hg purge
$ hg rm changed
$ hg ci -m removechanged
$ echo a > changed
$ hg import --no-commit ../unknown.diff
applying ../unknown.diff
abort: cannot patch changed: file is not tracked
[255]
Test removing an unknown file
$ hg up -qC 0
$ hg purge
$ hg rm removed
$ hg ci -m removeremoved
created new head
$ echo a > removed
$ hg import --no-commit ../unknown.diff
applying ../unknown.diff
abort: cannot patch removed: file is not tracked
[255]
Test copying onto an unknown file
$ hg up -qC 0
$ hg purge
$ echo a > copied
$ hg import --no-commit ../unknown.diff
applying ../unknown.diff
abort: cannot create copied: destination already exists
[255]
$ cd ..