jump right to v8, don't stop part way

* init --version: When the version given is one that automatically
  upgrades to a newer version, use the newer version instead.
* Auto upgrades from older repo versions, like v5, now jump right to v8.
This commit is contained in:
Joey Hess 2020-02-24 13:21:00 -04:00
parent 08d0b44f4d
commit 1bb32098d6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 36 additions and 5 deletions

View file

@ -36,11 +36,11 @@ upgradableVersions = map RepoVersion [2..7]
autoUpgradeableVersions :: M.Map RepoVersion RepoVersion
autoUpgradeableVersions = M.fromList
[ (RepoVersion 3, RepoVersion 5)
, (RepoVersion 4, RepoVersion 5)
, (RepoVersion 5, RepoVersion 6)
, (RepoVersion 6, RepoVersion 7)
, (RepoVersion 7, RepoVersion 8)
[ (RepoVersion 3, latestVersion)
, (RepoVersion 4, latestVersion)
, (RepoVersion 5, latestVersion)
, (RepoVersion 6, latestVersion)
, (RepoVersion 7, latestVersion)
]
versionField :: ConfigKey

View file

@ -29,6 +29,9 @@ git-annex (8.20200221) UNRELEASED; urgency=medium
on the locale.
* annex.maxextensionlength used to be the number of characters, not
bytes, when in a utf-8 locale. It's now always the number of bytes.
* init --version: When the version given is one that automatically
upgrades to a newer version, use the newer version instead.
* Auto upgrades from older repo versions, like v5, now jump right to v8.
-- Joey Hess <id@joeyh.name> Wed, 19 Feb 2020 12:48:58 -0400

View file

@ -49,3 +49,5 @@ lucky and it's passable Haskell, I'd be happy to send a patch.
[[!meta author=kyle]]
[[!tag projects/datalad]]
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,23 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2020-02-24T17:13:45Z"
content="""
Your patch is perfectly fine haskell code.
But, looking at it, the problem is deeper than init --version.
Running git-annex in a v3 repo produces a v5 repo,
then running git-annex again produces a v6 repo,
then v7, then v8.
So the problem is really that autoUpgradeableVersions
should map everything to latestVersion. At least currently,
since all versions should be upgraded to v8.
(Really it could just be a list of versions that all
are assumed to upgrade to latestVersion, but I left it a map
in case at some point there are two concurrent version
tracks without an autoupgrade between them.)
Anyway, attach a git format-patch next time so I can git am it. :)
"""]]

View file

@ -36,6 +36,9 @@ to the user who tries to run git-annex init.
Force the repository to be initialized using a different annex.version
than the current default.
When the version given is one that automatically upgrades to a newer
version, it will automatically use the newer version instead.
# SEE ALSO
[[git-annex]](1)