Commits

Michał Górny  committed c5ab177

darcs -> CheckoutVCSSupport.

  • Participants
  • Parent commits 07d1d89

Comments (0)

Files changed (1)

File smartliverebuild/vcs/darcs.py

 
 import re
 
-from smartliverebuild.vcs import VCSSupport
+from smartliverebuild.vcs import CheckoutVCSSupport
 
-class DarcsSupport(VCSSupport):
+class DarcsSupport(CheckoutVCSSupport):
 	reqenv = ['EDARCS_REPOSITORY', 'EDARCS_GET_CMD', 'EDARCS_UPDATE_CMD',
 			'EDARCS_LOCALREPO', 'EDARCS_TOP_DIR', 'EDARCS_OPTIONS',
 			'EDARCS_DARCS_CMD']
 	optenv = ['EDARCS_PATCHCOUNT']
 
-	requires_workdir = True
-
-	def getpath(self):
+	@property
+	def workdir(self):
 		return '%s/%s' \
 			% (self.env['EDARCS_TOP_DIR'], self.env['EDARCS_LOCALREPO'])
 
 	def __str__(self):
-		return self.env['EDARCS_REPOSITORY'] or VCSSupport.__str__(self)
-
-	def parseoutput(self, out):
-		return None
+		return self.env['EDARCS_REPOSITORY']
 
-	def getrev(self):
+	@property
+	def currentrev(self):
 		result = self.call(['darcs', 'show', 'repo'])
 		return int(re.search('Num Patches: ([0-9]+)', result).group(1))
 
-	def getsavedrev(self):
+	@property
+	def savedrev(self):
 		pc = self.env['EDARCS_PATCHCOUNT']
 		return int(pc) if pc else None
 
-	@staticmethod
-	def revcmp(oldrev, newrev):
-		return oldrev == newrev
-
-	def getupdatecmd(self):
+	@property
+	def updatecmd(self):
 		return '%s %s --all %s %s >&2' % \
 			(self.env['EDARCS_DARCS_CMD'],
 			self.env['EDARCS_UPDATE_CMD'],