X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/blobdiff_plain/a504eefd8719a52b14217c2a1152db151504f99a..10fea9a7ddab6a654922514b13b135772cc98a01:/wizard/deploy.py diff --git a/wizard/deploy.py b/wizard/deploy.py index 158ad40..507fdf3 100644 --- a/wizard/deploy.py +++ b/wizard/deploy.py @@ -161,6 +161,13 @@ class Deployment(object): self._app_version = None self._read_cache = {} self._old_log = None + def setAppVersion(self, app_version): + """ + Manually resets the application version; useful if the working + copy is off in space (i.e. not anchored to something we can + git describe off of) or there is no metadata to be heard of. + """ + self._app_version = app_version def read(self, file, force = False): """ Reads a file's contents, possibly from cache unless ``force`` @@ -236,10 +243,12 @@ class Deployment(object): if not compare_tags(self.app_version.pristine_tag): raise InconsistentPristineTagError(self.app_version.pristine_tag) if not compare_tags(self.app_version.wizard_tag): + # Causes remastering raise InconsistentWizardTagError(self.app_version.wizard_tag) parent = repo_rev_parse(self.app_version.wizard_tag) merge_base = shell.safeCall("git", "merge-base", parent, "HEAD", strip=True) if merge_base != parent: + # Causes remastering raise HeadNotDescendantError(self.app_version.wizard_tag) def verifyConfigured(self): @@ -507,13 +516,6 @@ class WorkingCopy(Deployment): modifications to without fear of interfering with a production deployment. More operations are permitted on these copies. """ - def setAppVersion(self, app_version): - """ - Manually resets the application version; useful if the working - copy is off in space (i.e. not anchored to something we can - git describe off of.) - """ - self._app_version = app_version @chdir_to_location def parametrize(self, deployment): """ @@ -665,7 +667,8 @@ class InconsistentWizardTagError(Error): return """ ERROR: Local wizard tag %s did not match repository's. This -probably means an upstream rebase occurred.""" % self.tag +probably means an upstream rebase occurred. Try +'git fetch --tags && wizard remaster'.""" % self.tag class HeadNotDescendantError(Error): """HEAD is not connected to tag.""" @@ -678,7 +681,8 @@ class HeadNotDescendantError(Error): ERROR: HEAD is not a descendant of %s. This probably means that an upstream rebase occurred, and new tags were -pulled, but local user commits were never rebased.""" % self.tag +pulled, but local user commits were never rebased. Try +running 'wizard remaster'.""" % self.tag class VersionDetectionError(Error): """Could not detect real version of application."""