Mercurial > hg
annotate tests/sitecustomize.py @ 24882:995003a324da stable
bundlerepo: disable filtering of changelog while constructing revision text
This avoids the following error that happened if base revision of bundle file
was hidden. bundlerevlog needs it to construct revision texts from bundle
content as revlog.revision() does.
File "mercurial/context.py", line 485, in _changeset
return self._repo.changelog.read(self.rev())
File "mercurial/changelog.py", line 319, in read
text = self.revision(node)
File "mercurial/bundlerepo.py", line 124, in revision
text = self.baserevision(iterrev)
File "mercurial/bundlerepo.py", line 160, in baserevision
return changelog.changelog.revision(self, nodeorrev)
File "mercurial/revlog.py", line 1041, in revision
node = self.node(rev)
File "mercurial/changelog.py", line 211, in node
raise error.FilteredIndexError(rev)
mercurial.error.FilteredIndexError: 1
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 29 Apr 2015 19:47:37 +0900 |
parents | 031947baf4d0 |
children | b12bda49c3e3 |
rev | line source |
---|---|
24505
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
1 import os |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
2 |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
3 if os.environ.get('COVERAGE_PROCESS_START'): |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
4 try: |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
5 import coverage |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
6 import random |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
7 |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
8 # uuid is better, but not available in Python 2.4. |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
9 covpath = os.path.join(os.environ['COVERAGE_DIR'], |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
10 'cov.%s' % random.randrange(0, 1000000000000)) |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
11 cov = coverage.coverage(data_file=covpath, auto_data=True) |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
12 cov._warn_no_data = False |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
13 cov._warn_unimported_source = False |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
14 cov.start() |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
15 except ImportError: |
031947baf4d0
run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents:
14971
diff
changeset
|
16 pass |