# HG changeset patch # User Alecs King # Date 1281602561 -28800 # Node ID e1359ad582f61eff0095483ee06401d46864a8f2 # Parent 20a88cf7ee92ce82f3c421f5e4460cf7f2a4fb84 check-code: add exit status so that we can use it in a shell command combination and/or in hg hooks. diff -r 20a88cf7ee92 -r e1359ad582f6 contrib/check-code.py --- a/contrib/check-code.py Thu Aug 12 09:40:48 2010 +0100 +++ b/contrib/check-code.py Thu Aug 12 16:42:41 2010 +0800 @@ -7,7 +7,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -import re, glob, os +import re, glob, os, sys import optparse def repquote(m): @@ -261,5 +261,8 @@ check = args for f in check: - checkfile(f, maxerr=options.per_file, warnings=options.warnings, - blame=options.blame) + ret = 0 + if not checkfile(f, maxerr=options.per_file, warnings=options.warnings, + blame=options.blame): + ret = 1 + sys.exit(ret)