Mercurial > dotfiles
diff unixSoft/bin/apply-patchbomb @ 521:6cc5a0550281
tools: port hg utility scripts to python 3
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Thu, 14 Jul 2022 14:09:04 -0400 |
parents | 0b8457903012 |
children |
line wrap: on
line diff
--- a/unixSoft/bin/apply-patchbomb +++ b/unixSoft/bin/apply-patchbomb @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # shebang for system python explicitly so we're sure to have pyobjc and # the scripting bridge. """apply-patchbomb: apply selected messages in Mail.app to an hg repo in pwd. @@ -18,12 +18,12 @@ def main(): messages = list(sorted(mail.selection(), cmp=lambda x,y: cmp(x.subject(), y.subject()))) for m in messages: - print 'Applying', m.subject() + print('Applying', m.subject()) p = subprocess.Popen(['hg', 'import', '--obsolete', '-'], stdin=subprocess.PIPE) p.stdin.write(m.source()) p.stdin.close() if p.wait() != 0: - print 'hg import failed, bailing' + print('hg import failed, bailing') return 2 return 0