Anonymous committed 2b38b96

Support calling 'diff --stat' like git.eclass does.

Comments (0)

Files changed (1)

 		ret = subprocess.Popen(cmd, shell=True).wait()
 		return (ret == 0)
+	def diffstat(self, oldrev, newrev):
+		pass
 	def update(self):
 				out.s3('at rev %s%s%s (no changes)' % (, oldrev, out.reset))
 				return False
+				self.diffstat(oldrev, newrev)
 				out.s3('update from %s%s%s to %s%s%s' % (, oldrev, out.reset, out.lime, newrev, out.reset))
 				return True
 class GitSupport(VCSSupport):
 	inherit = 'git'
 	def __init__(self, cpv, env):
 		VCSSupport.__init__(self, cpv, env)
 	def getupdatecmd(self):
 		return '%s %s origin %s:%s' % (self.env['EGIT_UPDATE_CMD'], self.env['EGIT_OPTIONS'], self.env['EGIT_BRANCH'], self.env['EGIT_BRANCH'])
+	def diffstat(self, oldrev, newrev):
+		subprocess.Popen('%s %s..%s' % (self.env['EGIT_DIFFSTAT_CMD'] or 'git diff', oldrev, newrev), shell=True).wait()
 class HgSupport(VCSSupport):
 	inherit = 'mercurial'
 		# don't want to enforce user to 'su' before calling us
 		return '%s %s' % (self.env['EHG_PULL_CMD'], self.env['EHG_REPO_URI'])
+	def diffstat(self, oldrev, newrev):
+		subprocess.Popen('hg diff --stat -r %s -r %s' % (oldrev, newrev), shell=True).wait()
 class SvnSupport(VCSSupport):
 	inherit = 'subversion'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.