(ci, compact=False, stream=sys.stdout.write)
| 136 | |
| 137 | |
| 138 | def commit(ci, compact=False, stream=sys.stdout.write): |
| 139 | merge_commit = len(ci.parent_ids) > 1 |
| 140 | color = colored.magenta if merge_commit else colored.yellow |
| 141 | if compact: |
| 142 | title = ci.message.splitlines()[0] |
| 143 | puts('{0} {1}'.format(color(str(ci.id)[:7]), title), stream=stream) |
| 144 | return |
| 145 | puts(color('Commit Id: {0}'.format(ci.id)), stream=stream) |
| 146 | if merge_commit: |
| 147 | merges_str = ' '.join(str(oid)[:7] for oid in ci.parent_ids) |
| 148 | puts(color('Merges: {0}'.format(merges_str)), stream=stream) |
| 149 | puts( |
| 150 | color('Author: {0} <{1}>'.format(ci.author.name, ci.author.email)), |
| 151 | stream=stream) |
| 152 | ci_author_dt = datetime.fromtimestamp( |
| 153 | ci.author.time, FixedOffset(ci.author.offset)) |
| 154 | puts(color('Date: {0:%c %z}'.format(ci_author_dt)), stream=stream) |
| 155 | puts(stream=stream) |
| 156 | with indent(4): |
| 157 | puts(ci.message, stream=stream) |
| 158 | |
| 159 | # Op Callbacks |
| 160 |
no test coverage detected