Commits

Neil Muller committed 405e9ce

Prefix removed and added files

Comments (0)

Files changed (1)

             aFileInfo = dCommit['files']
             aFiles = []
             for dFileDetails in aFileInfo:
-                aFiles.append(dFileDetails['file'])
+                if dFileDetails['type'] == 'modified':
+                    aFiles.append(dFileDetails['file'])
+                elif dFileDetails['type'] == 'added':
+                    aFiles.append('+%s' % dFileDetails['file'])
+                elif dFileDetails['type'] == 'removed':
+                    aFiles.append('-%s' % dFileDetails['file'])
+                else:
+                    # Unknown type, so flag it for later investigation
+                    print dFileDetails['type']
+                    aFiles.append(dFileDetails['file'])
             sCommitMessage = dCommit['message']
             sRev = '%d' % dCommit['revision']
             sBranch = dCommit['branch']
             sAuthor = dCommit['committer']['name']
             # Files should be the combination of added, modified + removed
             aFiles = dCommit['modified']
-            aFiles.extend(dCommit['added'])
-            aFiles.extend(dCommit['removed'])
+            aFiles.extend(['+%s' % x for x in dCommit['added']])
+            aFiles.extend(['-%s' % x for x in dCommit['removed']])
             sCommitMessage = dCommit['message']
             sRev = dCommit['id']  # Shorten this?
             sMsg = format_info(sProject, sAuthor, sCommitMessage,