# HG changeset patch # User Augie Fackler # Date 1286246842 18000 # Node ID e8170eba88cd0b21873b54898900873163815a2d # Parent f8a4c55ad070624a339da36e2e02db0704c700b5 apply-patchbomb: clean up imports and improve exit status diff --git a/unixSoft/bin/apply-patchbomb b/unixSoft/bin/apply-patchbomb --- a/unixSoft/bin/apply-patchbomb +++ b/unixSoft/bin/apply-patchbomb @@ -6,10 +6,11 @@ This uses the scripting bridge to talk to Mail and subprocess to pass the patch to Mercurial on stdin. """ - +import email +import subprocess +import sys import ScriptingBridge -import subprocess def main(): mail = ScriptingBridge.SBApplication.applicationWithBundleIdentifier_( @@ -23,7 +24,8 @@ def main(): p.stdin.close() if p.wait() != 0: print 'hg import failed, bailing' - break + return 2 + return 0 if __name__ == '__main__': - main() + sys.exit(main())