The old infrastructure has been checking this for ages, but the new
forgot to do so until now.
Signed-off-by: Karl Hasselström <kha@treskal.com>
raise exception.StgException('%s: no such branch' % name)
self.__patchorder = PatchOrder(self)
self.__patches = Patches(self)
- stackupgrade.update_to_current_format_version(repository, name)
+ if not stackupgrade.update_to_current_format_version(repository, name):
+ raise exception.StgException('%s: branch not initialized' % name)
name = property(lambda self: self.__name)
repository = property(lambda self: self.__repository)
patchorder = property(lambda self: self.__patchorder)
set_format_version(2)
# Make sure we're at the latest version.
- if not get_format_version() in [None, FORMAT_VERSION]:
+ fv = get_format_version()
+ if not fv in [None, FORMAT_VERSION]:
raise StackException('Branch %s is at format version %d, expected %d'
- % (branch, get_format_version(), FORMAT_VERSION))
+ % (branch, fv, FORMAT_VERSION))
+ return fv != None # true if branch is initialized