Mercurial > hg
comparison tests/run-tests.py @ 41759:aaad36b88298
cleanup: use () to wrap long lines instead of \
This is a little less brittle, and often helps indentation. In a
surprising number of cases the entire cleanup was deleting the \, as
the expression was *already* parenthesized in a workable way.
Differential Revision: https://phab.mercurial-scm.org/D5993
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 20 Feb 2019 19:28:51 -0500 |
parents | 15d3facfa40a |
children | 9f53a4e2e193 |
comparison
equal
deleted
inserted
replaced
41758:15d3facfa40a | 41759:aaad36b88298 |
---|---|
927 self.fail('timed out') | 927 self.fail('timed out') |
928 elif ret is False: | 928 elif ret is False: |
929 self.fail('no result code from test') | 929 self.fail('no result code from test') |
930 elif out != self._refout: | 930 elif out != self._refout: |
931 # Diff generation may rely on written .err file. | 931 # Diff generation may rely on written .err file. |
932 if (ret != 0 or out != self._refout) and not self._skipped \ | 932 if ((ret != 0 or out != self._refout) and not self._skipped |
933 and not self._debug: | 933 and not self._debug): |
934 with open(self.errpath, 'wb') as f: | 934 with open(self.errpath, 'wb') as f: |
935 for line in out: | 935 for line in out: |
936 f.write(line) | 936 f.write(line) |
937 | 937 |
938 # The result object handles diff calculation for us. | 938 # The result object handles diff calculation for us. |
976 if self._usechg: | 976 if self._usechg: |
977 # chgservers will stop automatically after they find the socket | 977 # chgservers will stop automatically after they find the socket |
978 # files are deleted | 978 # files are deleted |
979 shutil.rmtree(self._chgsockdir, True) | 979 shutil.rmtree(self._chgsockdir, True) |
980 | 980 |
981 if (self._ret != 0 or self._out != self._refout) and not self._skipped \ | 981 if ((self._ret != 0 or self._out != self._refout) and not self._skipped |
982 and not self._debug and self._out: | 982 and not self._debug and self._out): |
983 with open(self.errpath, 'wb') as f: | 983 with open(self.errpath, 'wb') as f: |
984 for line in self._out: | 984 for line in self._out: |
985 f.write(line) | 985 f.write(line) |
986 | 986 |
987 vlog("# Ret was:", self._ret, '(%s)' % self.name) | 987 vlog("# Ret was:", self._ret, '(%s)' % self.name) |
1103 env['HGIPV6'] = str(int(self._useipv6)) | 1103 env['HGIPV6'] = str(int(self._useipv6)) |
1104 # See contrib/catapipe.py for how to use this functionality. | 1104 # See contrib/catapipe.py for how to use this functionality. |
1105 if 'HGTESTCATAPULTSERVERPIPE' not in env: | 1105 if 'HGTESTCATAPULTSERVERPIPE' not in env: |
1106 # If we don't have HGTESTCATAPULTSERVERPIPE explicitly set, pull the | 1106 # If we don't have HGTESTCATAPULTSERVERPIPE explicitly set, pull the |
1107 # non-test one in as a default, otherwise set to devnull | 1107 # non-test one in as a default, otherwise set to devnull |
1108 env['HGTESTCATAPULTSERVERPIPE'] = \ | 1108 env['HGTESTCATAPULTSERVERPIPE'] = env.get( |
1109 env.get('HGCATAPULTSERVERPIPE', os.devnull) | 1109 'HGCATAPULTSERVERPIPE', os.devnull) |
1110 | 1110 |
1111 extraextensions = [] | 1111 extraextensions = [] |
1112 for opt in self._extraconfigopts: | 1112 for opt in self._extraconfigopts: |
1113 section, key = opt.encode('utf-8').split(b'.', 1) | 1113 section, key = opt.encode('utf-8').split(b'.', 1) |
1114 if section != 'extensions': | 1114 if section != 'extensions': |