Create and manage snapshots
A snapshot is a copy of your repository at a specific point in time. It allows you to do the following things:
-
Debug or experiment without affecting the primary repository.
-
Test a different state of your application without having to recreate test assets or tests.
In this topic, you'll learn how to create, work in, and delete snapshots.
Snapshots replace the old branch functionality. You can still access, work in, and delete existing branches following the same steps we describe in this topic, but you can't create new branches anymore.
Understand the basics
You can only create snapshots of the primary repository. You can’t create a snapshot of a snapshot.
Also, Tosca doesn't support merging snapshots back into primary. If a snapshot contains objects you'd like to have in your primary, use subsets to move them.
Create a new snapshot
You can create a snapshot in one of the following ways:
-
With the Tosca Commander command line tool, TCShell. For details, check out "Create new snapshot".
-
In Tosca Commander.
To create a new snapshot in Tosca Commander, follow these steps:
-
Make sure of the following:
-
You have administrator rights.
-
Your team has checked in their changes, so the repository is up to date.
-
-
Open a workspace that's connected to the repository you want to snapshot.
-
Right-click the project root element and select Create snapshot from the context menu.
-
Enter a name for the snapshot and select OK.
Access a snapshot
To access your snapshot, create a multi-user workspace for it. Make sure you use the option Create workspace for snapshot or branch in the create workspace dialog.
We recommend that you create the first workspace soon after you create the snapshot, even if you don’t plan to use the snapshot right away. When Tosca creates the workspace, it has to walk back through the commit history to reach the point where you created the snapshot. If Tosca has to process weeks of commits, this will take a long time.
So, create your first workspace after you create the snapshot. If you want to give other users access later, clone the workspace.
Work in a snapshot
A snapshot workspace functions much like any other workspace. Since it's multi-user, you need to use checkin and checkout. Any changes you make only apply to this snapshot.
Tosca Commander displays the snapshot name in the following locations:
-
In the header, at the end of the workspace path and name.
-
Under Project > Info.
Limitations
The following tasks aren't available in a snapshot workspace:
Delete a snapshot
If you don't need a snapshot anymore, you can delete it:
-
Make sure you have administrator rights.
-
Open a workspace that's connected to the primary repository.
-
Right-click the project root element and select Delete snapshot from the context menu.
-
In the subsequent dialog, select the branch you want to delete, then select OK.
When you delete a snapshot, you can still access the snapshot workspace and view all objects in it, but you can't actively work with them anymore. To continue working with objects you have in a defunct snapshot workspace, export a subset.