diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/diffmanifests.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/subcmds/diffmanifests.py b/subcmds/diffmanifests.py index 05998681..751a2026 100644 --- a/subcmds/diffmanifests.py +++ b/subcmds/diffmanifests.py | |||
@@ -71,6 +71,10 @@ synced and their revisions won't be found. | |||
71 | p.add_option('--no-color', | 71 | p.add_option('--no-color', |
72 | dest='color', action='store_false', default=True, | 72 | dest='color', action='store_false', default=True, |
73 | help='does not display the diff in color.') | 73 | help='does not display the diff in color.') |
74 | p.add_option('--pretty-format', | ||
75 | dest='pretty_format', action='store', | ||
76 | metavar='<FORMAT>', | ||
77 | help='print the log using a custom git pretty format string') | ||
74 | 78 | ||
75 | def _printRawDiff(self, diff): | 79 | def _printRawDiff(self, diff): |
76 | for project in diff['added']: | 80 | for project in diff['added']: |
@@ -92,7 +96,7 @@ synced and their revisions won't be found. | |||
92 | otherProject.revisionExpr)) | 96 | otherProject.revisionExpr)) |
93 | self.out.nl() | 97 | self.out.nl() |
94 | 98 | ||
95 | def _printDiff(self, diff, color=True): | 99 | def _printDiff(self, diff, color=True, pretty_format=None): |
96 | if diff['added']: | 100 | if diff['added']: |
97 | self.out.nl() | 101 | self.out.nl() |
98 | self.printText('added projects : \n') | 102 | self.printText('added projects : \n') |
@@ -124,7 +128,8 @@ synced and their revisions won't be found. | |||
124 | self.printText(' to ') | 128 | self.printText(' to ') |
125 | self.printRevision(otherProject.revisionExpr) | 129 | self.printRevision(otherProject.revisionExpr) |
126 | self.out.nl() | 130 | self.out.nl() |
127 | self._printLogs(project, otherProject, raw=False, color=color) | 131 | self._printLogs(project, otherProject, raw=False, color=color, |
132 | pretty_format=pretty_format) | ||
128 | self.out.nl() | 133 | self.out.nl() |
129 | 134 | ||
130 | if diff['unreachable']: | 135 | if diff['unreachable']: |
@@ -139,9 +144,13 @@ synced and their revisions won't be found. | |||
139 | self.printText(' not found') | 144 | self.printText(' not found') |
140 | self.out.nl() | 145 | self.out.nl() |
141 | 146 | ||
142 | def _printLogs(self, project, otherProject, raw=False, color=True): | 147 | def _printLogs(self, project, otherProject, raw=False, color=True, |
143 | logs = project.getAddedAndRemovedLogs(otherProject, oneline=True, | 148 | pretty_format=None): |
144 | color=color) | 149 | |
150 | logs = project.getAddedAndRemovedLogs(otherProject, | ||
151 | oneline=(pretty_format is None), | ||
152 | color=color, | ||
153 | pretty_format=pretty_format) | ||
145 | if logs['removed']: | 154 | if logs['removed']: |
146 | removedLogs = logs['removed'].split('\n') | 155 | removedLogs = logs['removed'].split('\n') |
147 | for log in removedLogs: | 156 | for log in removedLogs: |
@@ -192,4 +201,4 @@ synced and their revisions won't be found. | |||
192 | if opt.raw: | 201 | if opt.raw: |
193 | self._printRawDiff(diff) | 202 | self._printRawDiff(diff) |
194 | else: | 203 | else: |
195 | self._printDiff(diff, color=opt.color) | 204 | self._printDiff(diff, color=opt.color, pretty_format=opt.pretty_format) |