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

r19650:36f48c7d default
r21195:9336bc7d stable
Show More
test-symlink-placeholder.t
79 lines | 1.9 KiB | text/troff | Tads3Lexer
/ tests / test-symlink-placeholder.t
Mads Kiilerich
tests: use 'hghave symlink' for tests using symlinks
r15441 $ "$TESTDIR/hghave" symlink || exit 80
Matt Mackall
windows: sanity-check symlink placeholders...
r15348 Create extension that can disable symlink support:
$ cat > nolink.py <<EOF
> from mercurial import extensions, util
> def setflags(orig, f, l, x):
> pass
> def checklink(orig, path):
> return False
> def extsetup(ui):
> extensions.wrapfunction(util, 'setflags', setflags)
> extensions.wrapfunction(util, 'checklink', checklink)
> EOF
$ hg init unix-repo
$ cd unix-repo
$ echo foo > a
$ ln -s a b
$ hg ci -Am0
adding a
adding b
$ cd ..
Simulate a checkout shared on NFS/Samba:
$ hg clone -q unix-repo shared
$ cd shared
$ rm b
$ echo foo > b
$ hg --config extensions.n=$TESTTMP/nolink.py status --debug
ignoring suspect symlink placeholder "b"
Make a clone using placeholders:
$ hg --config extensions.n=$TESTTMP/nolink.py clone . ../win-repo
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd ../win-repo
$ cat b
a (no-eol)
$ hg --config extensions.n=$TESTTMP/nolink.py st --debug
Siddharth Agarwal
localrepo.status: ignore empty symlink placeholders...
r19650 Empty placeholder:
$ rm b
$ touch b
$ hg --config extensions.n=$TESTTMP/nolink.py st --debug
ignoring suspect symlink placeholder "b"
Matt Mackall
windows: sanity-check symlink placeholders...
r15348 Write binary data to the placeholder:
>>> open('b', 'w').write('this is a binary\0')
$ hg --config extensions.n=$TESTTMP/nolink.py st --debug
ignoring suspect symlink placeholder "b"
Write a long string to the placeholder:
>>> open('b', 'w').write('this' * 1000)
$ hg --config extensions.n=$TESTTMP/nolink.py st --debug
ignoring suspect symlink placeholder "b"
Commit shouldn't succeed:
$ hg --config extensions.n=$TESTTMP/nolink.py ci -m1
nothing changed
[1]
Write a valid string to the placeholder:
>>> open('b', 'w').write('this')
$ hg --config extensions.n=$TESTTMP/nolink.py st --debug
M b
$ hg --config extensions.n=$TESTTMP/nolink.py ci -m1
$ hg manifest tip --verbose
644 a
644 @ b
Mads Kiilerich
tests: add missing trailing 'cd ..'...
r16913
$ cd ..