Tracking Versions

In this section we’ll have a look at the archive versioning options available through the command line.

We’ll assume we have our api configured and that our manager and authority is already set-up. We go ahead and creat our sample archive again to demonstrate how versions are managed.

$ datafs create my_archive \
>   --my_metadata_field 'useful metadata'
created versioned archive <DataArchive local://my_archive>

So now we have our archive being tracked by manager.

$ datafs update my_archive --string \
>     'barba crescit caput nescit' # doctest: +NORMALIZE_WHITESPACE
uploaded data to <DataArchive local://my_archive>. new version 0.0.1

Explicit Versioning

As we learned in our section on writing and reading archives, the version is set to 0.0.1 on creation by default. If you wanted to specify a prerelease or a minor release you would do either of the following

$ datafs update my_archive --bumpversion patch --string \
>     'Aliquando et insanire iucundum est' # doctest: +NORMALIZE_WHITESPACE
uploaded data to <DataArchive local://my_archive>. version bumped 0.0.1 -->

$ datafs update my_archive --bumpversion minor --string \
>     'animum debes mutare non caelum' # doctest: +NORMALIZE_WHITESPACE
uploaded data to <DataArchive local://my_archive>. version bumped 0.0.2 -->

Get Version History

What if we want to view our versions?

$ datafs versions my_archive
['0.0.1', '0.0.2', '0.1']

Downloading Specific Versions

How can we get a specific version?

$ datafs download my_archive my_archive_versioned.txt --version 0.0.2
downloaded v0.0.2 to my_archive_versioned.txt