Commits

Michał Górny committed c7eda48

Print diffstats only when requested.

Comments (0)

Files changed (3)

SmartLiveRebuild/cli.py

 		help='Configuration file (default: /etc/portage/smart-live-rebuild.conf)')
 	opt.add_option('-C', '--no-color', action='store_false', dest='color',
 		help='Disable colorful output.')
+	opt.add_option('-d', '--diffstat', action='store_true', dest='diffstat',
+		help='Print a diffstat after the update (if VCS supports that)')
 	opt.add_option('-D', '--allow-downgrade', action='store', type='downgrade', dest='allow_downgrade',
 		help="When to allow downgrading package (one of 'never', 'same-pv', 'always')")
 	opt.add_option('-E', '--no-erraneous-merge', action='store_false', dest='erraneous_merge',

SmartLiveRebuild/config.py

 			'allow_downgrade': 'same-pv',
 			'color': 'True',
 			'config_file': '/etc/portage/smart-live-rebuild.conf',
+			'diffstat': 'False',
 			'erraneous_merge': 'True',
 			'jobs': '1',
 			'local_rev': 'False',

SmartLiveRebuild/vcs/__init__.py

 				out.s3('at rev %s%s%s (no changes)' % (out.green, self.oldrev, out.reset))
 				return False
 			else:
-				self.diffstat(self.oldrev, newrev)
+				if self._opts.diffstat:
+					self.diffstat(self.oldrev, newrev)
 				out.s3('update from %s%s%s to %s%s%s' % (out.green, self.oldrev, out.reset, out.lime, newrev, out.reset))
 				return True
 		else: