# HG changeset patch # User FUJIWARA Katsunori # Date 1435874163 -32400 # Node ID cd1daab5d03650305ba6aa3b44a5c8ced147ff6b # Parent c380d5273e91cb21bebde23d96cb4e1ff5195070 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. diff -r c380d5273e91 -r cd1daab5d036 contrib/import-checker.py --- 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))) diff -r c380d5273e91 -r cd1daab5d036 tests/test-module-imports.t --- 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]