From 31ae4cf5e903a9df4b6bee1a28d0c58c09afb029 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 18 Jul 2016 19:17:06 +0300 Subject: Version the format id for green albatross --- NEWS | 12 +++++++++--- obnamlib/__init__.py | 1 + obnamlib/app.py | 7 ++++--- obnamlib/fmt_ga/__init__.py | 3 +-- obnamlib/fmt_ga/format.py | 5 ++++- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 0732518f..2dff53bb 100644 --- a/NEWS +++ b/NEWS @@ -4,13 +4,19 @@ Obnam NEWS This file summarizes changes between releases of Obnam. NOTE: Obnam has an **EXPERIMENTAL** repository format under -development, called `green-albatross`. It is **NOT** meant for real -use. It is likely to change in incompatible ways without warning. Do -not use it unless you're willing to lose your backup. +development, called `green-albatross-YYYYMMDD`. It is **NOT** meant +for real use. It is likely to change in incompatible ways without +warning. Do not use it unless you're willing to lose your backup. Version 1.20, not yet released --------------------------------- +* The format name for `green-albatross` is renamed to + `green-albatross-20160718` and will henceforth be renamed every time + there's a change, to avoid confusing Lars because of backwards + incompatibilities. When it reaches stability and the on-disk format + is frozen, it'll be renamed back to a date-less version. + * Those using the experimental green-albatross repository format will have to start over with fresh repositories. This release contains backwards incompatible changes that mean existing repositories no diff --git a/obnamlib/__init__.py b/obnamlib/__init__.py index 48ebe95e..ee5f5516 100644 --- a/obnamlib/__init__.py +++ b/obnamlib/__init__.py @@ -176,6 +176,7 @@ from .backup_progress import BackupProgress # from .fmt_ga import ( + GREEN_ALBATROSS_VERSION, RepositoryFormatGA, GAClientList, GAClient, diff --git a/obnamlib/app.py b/obnamlib/app.py index b8493775..362ecf58 100644 --- a/obnamlib/app.py +++ b/obnamlib/app.py @@ -88,8 +88,9 @@ class App(cliapp.Application): self.settings.choice( ['repository-format'], - ['6', 'green-albatross'], - 'use FORMAT for new repositories; one of "6", "green-albatross"', + ['6', obnamlib.GREEN_ALBATROSS_VERSION], + 'use FORMAT for new repositories; ' + 'one of "6", "{}"'.format(obnamlib.GREEN_ALBATROSS_VERSION), metavar='FORMAT') algos = list(obnamlib.checksum_algorithms) @@ -285,7 +286,7 @@ class App(cliapp.Application): def get_default_repository_class(self): classes = { '6': obnamlib.RepositoryFormat6, - 'green-albatross': obnamlib.RepositoryFormatGA, + obnamlib.GREEN_ALBATROSS_VERSION: obnamlib.RepositoryFormatGA, } return classes[self.settings['repository-format']] diff --git a/obnamlib/fmt_ga/__init__.py b/obnamlib/fmt_ga/__init__.py index dc710d5c..0546458d 100644 --- a/obnamlib/fmt_ga/__init__.py +++ b/obnamlib/fmt_ga/__init__.py @@ -15,11 +15,10 @@ # # =*= License: GPL-3+ =*= - from .client_list import GAClientList from .chunk_store import GAChunkStore from .indexes import GAChunkIndexes from .dirobj import GADirectory, GAImmutableError, create_gadirectory_from_dict from .tree import GATree from .client import GAClient -from .format import RepositoryFormatGA +from .format import RepositoryFormatGA, GREEN_ALBATROSS_VERSION diff --git a/obnamlib/fmt_ga/format.py b/obnamlib/fmt_ga/format.py index 7fd3b83f..046187a8 100644 --- a/obnamlib/fmt_ga/format.py +++ b/obnamlib/fmt_ga/format.py @@ -19,9 +19,12 @@ import obnamlib +GREEN_ALBATROSS_VERSION = 'green-albatross-20160718' + + class RepositoryFormatGA(obnamlib.RepositoryDelegator): - format = 'green-albatross' + format = GREEN_ALBATROSS_VERSION def __init__(self, **kwargs): obnamlib.RepositoryDelegator.__init__(self, **kwargs) -- cgit v1.2.1