diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/diffmanifests.py | 21 | ||||
-rw-r--r-- | subcmds/forall.py | 11 | ||||
-rw-r--r-- | subcmds/sync.py | 2 |
3 files changed, 24 insertions, 10 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) |
diff --git a/subcmds/forall.py b/subcmds/forall.py index b10f34b3..07ee8d58 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py | |||
@@ -120,6 +120,9 @@ without iterating through the remaining projects. | |||
120 | p.add_option('-r', '--regex', | 120 | p.add_option('-r', '--regex', |
121 | dest='regex', action='store_true', | 121 | dest='regex', action='store_true', |
122 | help="Execute the command only on projects matching regex or wildcard expression") | 122 | help="Execute the command only on projects matching regex or wildcard expression") |
123 | p.add_option('-i', '--inverse-regex', | ||
124 | dest='inverse_regex', action='store_true', | ||
125 | help="Execute the command only on projects not matching regex or wildcard expression") | ||
123 | p.add_option('-g', '--groups', | 126 | p.add_option('-g', '--groups', |
124 | dest='groups', | 127 | dest='groups', |
125 | help="Execute the command only on projects matching the specified groups") | 128 | help="Execute the command only on projects matching the specified groups") |
@@ -215,10 +218,12 @@ without iterating through the remaining projects. | |||
215 | if os.path.isfile(smart_sync_manifest_path): | 218 | if os.path.isfile(smart_sync_manifest_path): |
216 | self.manifest.Override(smart_sync_manifest_path) | 219 | self.manifest.Override(smart_sync_manifest_path) |
217 | 220 | ||
218 | if not opt.regex: | 221 | if opt.regex: |
219 | projects = self.GetProjects(args, groups=opt.groups) | ||
220 | else: | ||
221 | projects = self.FindProjects(args) | 222 | projects = self.FindProjects(args) |
223 | elif opt.inverse_regex: | ||
224 | projects = self.FindProjects(args, inverse=True) | ||
225 | else: | ||
226 | projects = self.GetProjects(args, groups=opt.groups) | ||
222 | 227 | ||
223 | os.environ['REPO_COUNT'] = str(len(projects)) | 228 | os.environ['REPO_COUNT'] = str(len(projects)) |
224 | 229 | ||
diff --git a/subcmds/sync.py b/subcmds/sync.py index 4af411c9..9124a653 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -242,7 +242,7 @@ later is required to fix a server side protocol bug. | |||
242 | if show_smart: | 242 | if show_smart: |
243 | p.add_option('-s', '--smart-sync', | 243 | p.add_option('-s', '--smart-sync', |
244 | dest='smart_sync', action='store_true', | 244 | dest='smart_sync', action='store_true', |
245 | help='smart sync using manifest from a known good build') | 245 | help='smart sync using manifest from the latest known good build') |
246 | p.add_option('-t', '--smart-tag', | 246 | p.add_option('-t', '--smart-tag', |
247 | dest='smart_tag', action='store', | 247 | dest='smart_tag', action='store', |
248 | help='smart sync using manifest from a known tag') | 248 | help='smart sync using manifest from a known tag') |