Mercurial > hg-stable
changeset 25731:cd1daab5d036
import-checker.py: exit with code 0 if no error is detected
Before this patch, `import-checker.py` exits with non-0 code, if no
error is detected. This is unusual as Unix command.
This change may be a one of preparations for issue4677, because this
can avoid extra explanation about unusual exit code of
`import-checker.py` for third party tool developers.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 03 Jul 2015 06:56:03 +0900 |
parents | c380d5273e91 |
children | b94df10cc3b5 |
files | contrib/import-checker.py tests/test-module-imports.t |
diffstat | 2 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/import-checker.py Fri Jul 03 06:56:03 2015 +0900 +++ b/contrib/import-checker.py Fri Jul 03 06:56:03 2015 +0900 @@ -564,7 +564,7 @@ print 'Import cycle:', c firstmods.add(first) any_errors = True - return not any_errors + return any_errors != 0 if __name__ == '__main__': sys.exit(int(main(sys.argv)))
--- a/tests/test-module-imports.t Fri Jul 03 06:56:03 2015 +0900 +++ b/tests/test-module-imports.t Fri Jul 03 06:56:03 2015 +0900 @@ -101,6 +101,7 @@ testpackage/subpackage/levelpriority.py higher-level import should come first: testpackage testpackage/symbolimport.py direct symbol import from testpackage.unsorted testpackage/unsorted.py imports not lexically sorted: os < sys + [1] $ cd "$TESTDIR"/.. @@ -129,3 +130,4 @@ Import cycle: mercurial.cmdutil -> mercurial.context -> mercurial.subrepo -> mercurial.cmdutil Import cycle: hgext.largefiles.basestore -> hgext.largefiles.localstore -> hgext.largefiles.basestore Import cycle: mercurial.commands -> mercurial.commandserver -> mercurial.dispatch -> mercurial.commands + [1]