Mercurial > hg
annotate tests/test-check-code-hg.t @ 18969:257afe5489d4
largefiles: improve repo wrapping detection
Before this patch, repo wrapping detection in "reposetup()" of
largefiles can detect only limited repo wrapping: replacing target
functions by another one named as "wrap".
So, it can't detect repo wrapping even in recommended style: replacing
"__class__" of repo by derived class.
This patch can detect repo wrapping in both styles below:
- replacing "__class__" of repo by derived class (recommended style):
class derived(repo.__class__):
def push(self, *args, **kwargs):
return super(derived, self).push(*args, **kwargs)
repo.__class__ = derived
- replacing function of repo by another one (not recommended style):
orgpush = repo.push
def push(*args, **kwargs):
return orgpush(*args, **kwargs)
repo.push = push
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 10 Apr 2013 02:27:35 +0900 |
parents | 339a3fa19695 |
children | cba222f01056 |
rev | line source |
---|---|
15557
7bb5ed61b74c
tests: convert test-check-code-hg.py to .t
Mads Kiilerich <mads@kiilerich.com>
parents:
11771
diff
changeset
|
1 $ check_code="$TESTDIR"/../contrib/check-code.py |
7bb5ed61b74c
tests: convert test-check-code-hg.py to .t
Mads Kiilerich <mads@kiilerich.com>
parents:
11771
diff
changeset
|
2 $ cd "$TESTDIR"/.. |
18601
ce844e8e8af2
tests: guard against obsolete markers in the hg repo itself
Kevin Bullock <kbullock@ringworld.org>
parents:
18596
diff
changeset
|
3 $ if hg identify -q > /dev/null 2>&1; then : |
16485
f48b075ff088
tests: solaris sh can not negate exit status with '!'
Mads Kiilerich <mads@kiilerich.com>
parents:
16306
diff
changeset
|
4 > else |
16179
be6ac2ecc7f8
test-check-code-hg: skip test if not in a working dir (issue3248).
Greg Ward <greg@gerg.ca>
parents:
16156
diff
changeset
|
5 > echo "skipped: not a Mercurial working dir" >&2 |
be6ac2ecc7f8
test-check-code-hg: skip test if not in a working dir (issue3248).
Greg Ward <greg@gerg.ca>
parents:
16156
diff
changeset
|
6 > exit 80 |
be6ac2ecc7f8
test-check-code-hg: skip test if not in a working dir (issue3248).
Greg Ward <greg@gerg.ca>
parents:
16156
diff
changeset
|
7 > fi |
15558
c6b600d2348c
tests: run check-code with warnings and maintain a whitelist
Mads Kiilerich <mads@kiilerich.com>
parents:
15557
diff
changeset
|
8 |
17977
a6180647ead4
tests: only call check-code once
Matt Mackall <mpm@selenic.com>
parents:
17956
diff
changeset
|
9 New errors are not allowed. Warnings are strongly discouraged. |
a6180647ead4
tests: only call check-code once
Matt Mackall <mpm@selenic.com>
parents:
17956
diff
changeset
|
10 |
18601
ce844e8e8af2
tests: guard against obsolete markers in the hg repo itself
Kevin Bullock <kbullock@ringworld.org>
parents:
18596
diff
changeset
|
11 $ hg manifest 2>/dev/null \ |
ce844e8e8af2
tests: guard against obsolete markers in the hg repo itself
Kevin Bullock <kbullock@ringworld.org>
parents:
18596
diff
changeset
|
12 > | xargs "$check_code" --warnings --nolineno --per-file=0 \ |
ce844e8e8af2
tests: guard against obsolete markers in the hg repo itself
Kevin Bullock <kbullock@ringworld.org>
parents:
18596
diff
changeset
|
13 > || false |