##// 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-push-validation.t
92 lines | 1.9 KiB | text/troff | Tads3Lexer
/ tests / test-push-validation.t
$ hg init test
$ cd test
$ cat > .hg/hgrc <<EOF
> [server]
> validate=1
> EOF
$ echo alpha > alpha
$ echo beta > beta
$ hg addr
adding alpha
adding beta
$ hg ci -m 1
$ cd ..
$ hg clone test test-clone
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Test spurious filelog entries:
$ cd test-clone
$ echo blah >> beta
$ cp .hg/store/data/beta.i tmp1
$ hg ci -m 2
$ cp .hg/store/data/beta.i tmp2
$ hg -q rollback
$ mv tmp2 .hg/store/data/beta.i
$ echo blah >> beta
$ hg ci -m '2 (corrupt)'
Expected to fail:
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
beta@1: dddc47b3ba30 not in manifests
2 files, 2 changesets, 4 total revisions
1 integrity errors encountered!
(first damaged changeset appears to be 1)
[1]
$ hg push
pushing to $TESTTMP/test (glob)
searching for changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: received spurious file revlog entry
[255]
$ hg -q rollback
$ mv tmp1 .hg/store/data/beta.i
$ echo beta > beta
Test missing filelog entries:
$ cp .hg/store/data/beta.i tmp
$ echo blah >> beta
$ hg ci -m '2 (corrupt)'
$ mv tmp .hg/store/data/beta.i
Expected to fail:
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
beta@1: dddc47b3ba30 in manifests not found
2 files, 2 changesets, 2 total revisions
1 integrity errors encountered!
(first damaged changeset appears to be 1)
[1]
$ hg push
pushing to $TESTTMP/test (glob)
searching for changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
[255]
$ cd ..