Mercurial > hg
annotate tests/test-match.py @ 39809:23a00bc90a3c stable
chgserver: do not send system() back to client if stdio redirected (issue5992)
As the chg client doesn't know server-side stdio redirection, the server
shouldn't upcall on "runsystem" request if the stdio streams are redirected.
This patch teaches ui to remember the redirection flag, which is updated by
the caller right now. Future patches (for default) will add ui methods to
manage this flag internally.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 26 Sep 2018 21:24:14 +0900 |
parents | 44bc181b9835 |
children | 987d3a4b989f |
rev | line source |
---|---|
33582
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
1 from __future__ import absolute_import |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
2 |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
3 import unittest |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
4 |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
5 import silenttestrunner |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
6 |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
7 from mercurial import ( |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
8 match as matchmod, |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
9 ) |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
10 |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
11 class NeverMatcherTests(unittest.TestCase): |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
12 |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
13 def testVisitdir(self): |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
14 m = matchmod.nevermatcher('', '') |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
15 self.assertFalse(m.visitdir('.')) |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
16 self.assertFalse(m.visitdir('dir')) |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
17 |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
18 if __name__ == '__main__': |
44bc181b9835
match: override visitdir() in nevermatcher to return False
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff
changeset
|
19 silenttestrunner.main(__name__) |