Commits

Michał Górny committed 8f18ee1

Drop support for --local-rev, require the saved rev.

Comments (0)

Files changed (3)

SmartLiveRebuild/cli.py

 		help='Disable emerging packages for which the update has failed.')
 	opt.add_option('-j', '--jobs', action='store', type='int', dest='jobs',
 		help='Spawn JOBS parallel processes to perform repository updates.')
-	opt.add_option('-l', '--local-rev', action='store_true', dest='local_rev',
-		help='Force determining the current package revision from the repository instead of using the one saved by portage.')
 	opt.add_option('-p', '--pretend', action='store_true', dest='pretend',
 		help='Only print a list of the packages which were updated; do not call emerge to rebuild them.')
 	opt.add_option('-P', '--profile', action='store', dest='profile',

SmartLiveRebuild/config.py

 			'diffstat': 'False',
 			'erraneous_merge': 'True',
 			'jobs': '1',
-			'local_rev': 'False',
 			'pretend': 'False',
 			'profile': 'smart-live-rebuild',
 			'quickpkg': 'False',

SmartLiveRebuild/vcs/__init__.py

 		try:
 			os.chdir(self.getpath())
 		except OSError:
-			# If the working copy was removed, we'll try to ping
-			# the remote server for updates. But for that:
-			# 1) user can't use --local-rev,
-			# 2) we have to able to get the saved rev,
-			# 3) VCS has to support that.
-			# Otherwise, just re-raise the exception.
-			if self._opts.local_rev or self.requires_workdir:
+			# If VCS requires workdir, re-raise the exception.
+			# Else try to proceed.
+			if self.requires_workdir:
 				raise
-			self.oldrev = self.getsavedrev()
-			if not self.oldrev:
-				raise
-			self.subprocess = None
-		else:
-			self.oldrev = (not self._opts.local_rev and self.getsavedrev()) or self.getrev()
+
+		self.oldrev = self.getsavedrev()
+		if not self.getsavedrev(): # TEMPORARY
+			raise Exception('getsavedrev() failed to return a revision')
 
 		cmd = self.getupdatecmd()
 		out.s2(str(self))