Michał Górny avatar Michał Górny committed 07d1d89

cvs -> CheckoutVCSSupport.

Comments (0)

Files changed (1)


 import hashlib, locale, tempfile
-from smartliverebuild.vcs import VCSSupport
+from smartliverebuild.vcs import CheckoutVCSSupport
-class CVSSupport(VCSSupport):
+class CVSSupport(CheckoutVCSSupport):
-	requires_workdir = True
-	def __init__(self, *args):
-		VCSSupport.__init__(self, *args)
+	def __init__(self, *args, **kwargs):
+		CheckoutVCSSupport.__init__(self, *args, **kwargs)
 		if self.env['ECVS_RUNAS']:
 			raise NotImplementedError('ECVS_RUNAS is not implemented (yet).')
 		elif self.env['ECVS_AUTH'] != 'pserver':
 			raise NotImplementedError('ECVS_AUTH=%s while only pserver is supported.' % self.env['ECVS_AUTH'])
-	def getpath(self):
+	@property
+	def workdir(self):
 		return '%s/%s' % (self.env['ECVS_TOP_DIR'], self.env['ECVS_LOCALNAME'] or self.env['ECVS_MODULE'])
 	def __str__(self):
-		return '%s (%s)' % (self.env['ECVS_SERVER'], self.env['ECVS_MODULE']) or VCSSupport.__str__(self)
-	def parseoutput(self, out):
-		# require calling getrev()
-		return None
+		return '%s (%s)' % (self.env['ECVS_SERVER'], self.env['ECVS_MODULE'])
-	def getsavedrev(self):
+	@property
+	def savedrev(self):
 		return self.env['ECVS_VERSION']
-	def getrev(self):
-		inp = self.call(['find', self.getpath()] + '-ipath */CVS/Entries -exec cat {} +'.split()).split('\n')
+	@property
+	def currentrev(self):
+		inp = self.call(['find', self.workdir] + '-ipath */CVS/Entries -exec cat {} +'.split()).split('\n')
 		del inp[-1] # drop the trailing newline for sorting
 		inp.append('') # and readd it
 		return hasher.hexdigest()
-	def getupdatecmd(self):
+	@property
+	def updatecmd(self):
 		opts = []
 		if self.env['ECVS_LOCAL']:
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 ProjectModifiedEvent.java.
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.