]> andersk Git - zcommit.git/commitdiff
Improved zephyred message
authorGreg Brockman <gdb@mit.edu>
Tue, 23 Mar 2010 08:08:18 +0000 (04:08 -0400)
committerGreg Brockman <gdb@mit.edu>
Tue, 23 Mar 2010 08:08:18 +0000 (04:08 -0400)
zcommit.py

index 15a223640c693a193245c5a5c0e2a9c2f4d78fa3..dcfb201dde3d3449f58c6ba724d7d3ed134458ce 100755 (executable)
@@ -68,16 +68,26 @@ class Application(object):
                 logger.debug('Set zsig')
                 for c in reversed(payload['commits']):
                     inst = opts.get('instance', c['id'][:8])
+                    actions = []
+                    if c.get('added'):
+                        actions.append('Added: %s\n' % c['added'])
+                    if c.get('removed'):
+                        actions.append('Removed: %s\n' % c['removed'])
+                    if c.get('modified'):
+                        actions.append('Modified: %s\n' % c['modified'])
+                    if not actions:
+                        actions = 'Something weird happened... could not figure out what action to take'
                     info = {'name' : c['author']['name'],
                             'email' : c['author']['email'],
                             'message' : c['message'],
                             'timestamp' : c['timestamp'],
-                            'added' :  '\n'.join(c['added'])}
+                            'actions' : actions}
+                    
                     msg = """%(name)s <%(email)s>
 %(message)s
 %(timestamp)s
 --
-%(added)s""" % info
+%(actions)s""" % info
                     zephyr(opts['class'], inst, zsig, msg)
                 msg = 'Thanks for posting!'
             else:
This page took 0.23538 seconds and 5 git commands to generate.