Commits

Michał Górny committed aa9cc5c

[mercurial] Support grabbing remote revision.

  • Participants
  • Parent commits eb1ae1f

Comments (0)

Files changed (1)

SmartLiveRebuild/vcs/mercurial.py

 from SmartLiveRebuild.vcs import VCSSupport
 
 class HgSupport(VCSSupport):
-	reqenv = ['EHG_PROJECT', 'EHG_PULL_CMD', 'EHG_REPO_URI']
+	reqenv = ['EHG_PROJECT', 'EHG_PULL_CMD', 'EHG_REPO_URI', 'EHG_REVISION']
 	optenv = ['HG_REV_ID']
 
 	trustopt = ['--config', 'trusted.users=portage']
 	def getrev(self):
 		return self.call(['hg', 'identify', '--id'] + self.trustopt)
 
+	def getremoterev(self):
+		return self.call(['hg', 'identify', '--id', '--rev', self.env['EHG_REVISION'],
+				self.env['EHG_REPO_URI']] + self.trustopt)
+
 	@staticmethod
 	def revcmp(oldrev, newrev):
 		return newrev.startswith(oldrev)