![]() |
|||||||||
| SnapshotCM User Guide | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The advanced technology in SnapshotCM simplifies tasks that used to be difficult, time-consuming or error-prone, while continuing to provide top-notch support for routine operations. This document describes user tasks, with the goal of helping new users more quickly learn SnapshotCM, while also providing insights to help an experienced user of SnapshotCM be even more productive. As always, feedback to support@truebluesoftware.com is welcomed. Logging in to SnapshotCMBefore you can access SnapshotCM, the SnapshotCM administrator must create a SnapshotCM account for you to use. Typically, the SnapshotCM account name will be created to match your operating system account (login) name and you will not need to do any explicit SnapshotCM account name configuration. But if they are different, you can explicitly configure the SnapshotCM account to use by setting the SNAPSHOTCM_ACCOUNT environment variable. Note also that SnapshotCM account names are case insensitive. That is, kate, KATE and Kate are all equivalent SnapshotCM account names. For example, Katelyn's operating system login account is kate on most of her systems, but is kkramer on some. Since her SnapshotCM account name (Kate) differs from her kkramer login, she will need to set the environment variable SNAPSHOTCM_ACCOUNT=kate on those systems. Trusted Login ConfigurationThe operating system account (login) name is also visible in the Trusted Logins/Hosts list associated with each SnapshotCM account. In this list, the logins referred to are the operating system accounts from which trusted access to the given account is to be allowed. Continuing the previous example, to add trusted access to the Kate SnapshotCM account for the kkramer and kate OS logins, add two lines to the Trusted Logins/Hosts patterns for the Kate SnapshotCM account:
Multiple entries for each OS login can be created if that facilitates defining appropriate host patterns. The GUI's help describes the wildcard patterns supported for these fields. Understanding WorkspacesA workspace is a location on your local file system which is associated with the file hierarchies of one or more snapshots. A workspace definition (or mapping) specifies several pieces of information:
A workspace is where SnapshotCM managed information is stored. SnapshotCM manages all files in the file system hierarchy rooted at the workspace root location. A workspace name is any unique name identifying the workspace. A workspace working set specifies the portion of all files and directories that you wish to have in the workspace. It consists of a set of include and exclude paths, the most specific of which takes priority. Paths are full paths (beginning with a slash) and are relative to the workspace root. Note: In releases which only supported mapping all of a single snapshot, workspace and a snapshot's file paths were equivalent. However, now that multiple snapshot mappings to a single workspace are supported, a snapshot's file path is no longer unique. Hence, the workspace path is now used. A workspace contains at least one mount. Each mount defines how one snapshot fits into the workspace. The mount location is specified as the workspace path where the snapshot's file hierarchy is mapped. A snapshot is defined by a SnapshotCM repository server name and a snapshot path within that repository. One can also specify a directory within the snapshot to map. The default is to map the root directory (or all of a snapshot). Each mount also has two attributes which specify whether to keep workspace files read-only unless locked, or to leave them always writable, and how to translate end-of-lines for text files. Once a workspace is defined, SnapshotCM needs no specifications other than what operations to perform on which files. Files are specified directly in the GUI. In the command-line, the normal case is equally simple. However, the command-line allows more flexibility which we discuss next. Most workspace commands need to know four things to operate: the server, the snapshot, the full path of the file in the snapshot and the full path of the file in the workspace. When operating on files in a workspace, relative file names are converted to full local paths and looked up in the workspace definition to determine the server, the snapshot, and the path in the snapshot. When a full file system path is given, it is used directly for look up. It is also possible to specify a workspace rooted full path (or just workspace path). A workspace path is the path in the workspace relative to the root of the workspace. It always begins with a slash. However, a workspace path alone is not sufficient, because it does not identify which workspace to operate upon. Workspace commands use the current working directory to determine the workspace when given a workspace path. However, there is a potential ambiguity in interpreting full paths. This arises because a full path can be interpreted as a local path to a file in a directory, or as a workspace path relative to the workspace root. This ambiguity is resolved by assuming first that it is a local path, and if that path extends into a workspace, it is used as such. If the path does not reference a workspace and the current directory is in a workspace, then the path is understood as a workspace path. Why support this ambiguity? It is true that local paths are sufficient. However, it is convenient to be able do some operations by full path. For example, to list all files in the current workspace (selected by your working directory), one simply runs "wlsr /". Otherwise, the command is either "wlsr C:/long/path/to/workspace/root" or "wlsr ../../..", and you have to know where you are to enter the appropriate relative path to get to the workspace root. Command-line path interpretation is further complicated by the ability to explicitly define a workspace on the command-line. If an existing workspace is referenced (using -N workspace), then path interpretation is as for implicitly found workspaces, except that workspace paths do not require that the current directory be in the target workspace. The following describes handling of paths. The following workspace definition is assumed:
The first three uses assume you have not specified a workspace mapping on the command-line:
Merge ScenariosThe simplest merge is the one no one has to do. Therefore we recommend structuring your work, as much as is practical, to avoid unnecessary merges. And when merges are likely, arrange for them to be trivial. Of course, sometimes merges are necessary or their benefit outweighs the cost. SnapshotCM handles merges of all attributes and in many cases, the merges are trivial and once selected, handled automatically. The following addresses those cases which are not so trivial. Merge TypesMost often, when changes are copied from one snapshot to another, no merge will be necessary because an item will be changed in only one snapshot. That change will be copied automatically without conflict. Only when the same attribute is modified independently in two or more snapshots will a conflict occur. These parallel changes, or variants, require manual resolution. Parallel changes to all attributes other than file content can be resolved directly during the copy between snapshots. Parallel file content changes are merged using a variation of the check out, edit (merge), check in process used for normal content changes, though much of the task is automated. Content MergingWhen parallel changes are applied to the content of a file, one can choose one of the revisions to keep, or one can, for text files, merge the changes together to create a new, merged revision. In SnapshotCM, the results of a content merge are always stored in a file in a workspace, which can then be verified and modified as necessary before the results are checked in to a snapshot. Parallel changes can occur in two different scenarios discussed next. Merge From a Snapshot into a WorkspaceWhen you modify a file in your workspace, and then your snapshot is updated with other changes to that file, your local file becomes both modified (by you) and out-of-date (changed by someone else since you checked out the revision). You have three choices:
This scenario does not result in any branches in the file history. Merge Between SnapshotsWhen parallel changes have been checked in (to different snapshots), a merge becomes necessary to combine the parallel content changes into one of the snapshots. In the Copy Changes dialog, a conflict will be identified by a double-ended red arrow. Clicking on the red arrow will bring up the Customize Resolution dialog box. While this dialog has many options for obscure conflict cases, the File Content: options of interest are shown on the left. The three most common options for resolving content conflicts are: Merge, Source and Target. Once Merge, Source or Target is selected. Press OK or Apply to set this resolution method. Select Apply Changes to merge the parallel changes, together with the original base revision, into the named workspace and then edit the workspace file to examine the results and resolve any conflicts. From the command-line, use ssupdate or sscopy to perform the same selections. Resolving Content Merge Conflicts using the Batch-mode Merge ToolIf you've configured a graphical merge tool, that tool will be used to resolve conflicts. The following discussion applies to the batch merge method. When the same region of a file is modified in different ways by both changes, the conflicting region will be bracketed in the workspace file. If a file region is modified by only one change, or is modified identically by both changes, it will not be bracketed. Bracketed conflicts must be manually resolved. Bracketed conflicts will contain three versions of the conflicting region of text: the original version plus each of the changed versions. The versions of the region are separated by four different separator lines. An example will illustrate:
Notice the complete conflict is bounded by the "<<<<<<<" and ">>>>>>>" separator lines. Searching for these lines will quickly locate bracketed conflicts. The first separator line identifies your version of the region (YOURS). In this example, it is FILE, revision 1 as modified in the local workspace. Next comes the ORIGINAL version of the region (the version from which the variants were created). It is FILE revision 1 in the example. Lastly comes the other changes (THEIRS), which is from FILE revision 2. To resolve the conflict, you need to reduce each bracketed conflict in the file to one merged version without separator lines and then verify the results. That, of course, is an exercise left to the reader. :--) Text and Binary Files In Your WorkspaceLet's start this discussion with a definition of what distinguishes text and binary files. In SnapshotCM, text files are those files which will have end-of-line (EOL) translation performed on them during check in and check out, while binary files are those for which no EOL translation will be performed. EOL translation is necessary because the various operating systems of our day do not agree on how to store EOL indications in text files. SnapshotCM understands three EOL text formats: Unix, Windows and Mac. Unix systems use a single nuline character ('\n' or ascii 10), Windows systems use carriage return and nuline characters ("\r\n" or ascii 13 followed by ascii 10), and Macintosh systems use a single carriage return character ('\r' or ascii 13). In order to allow seamless operation in such a mixed environment, SnapshotCM provides EOL text format translation on both check out and check in:
The net result is that any text file can be edited in any text format in any workspace and still be checked in without confusing SnapshotCM. Workspaces and Remote File SystemsOn check out, the format that is written is specified by the workspace mapping in effect. The workspace text format defaults to that of the execution platform, but can be set to other values. For example, using Samba or other remote file system, you can use the SnapshotCM Windows GUI to create and maintain a unix workspace. One simply need select the unix text format when creating the workspace and text files in that workspace will be written in unix format by all SnapshotCM tools. Sharing WorkspacesWith remote file system access, it may be tempting to share a workspace between systems with different EOL text formats. While we recommend setting up a workspace per platform, if all your tools on all your platforms can handle the same or both text formats involved, sharing a workspace will work. But if, for example, some Unix tools cannot handle Windows format and some Windows tools cannot handle Unix format, you will be setting yourself up for problems. Nevertheless, if such files need only be accessed from one system or the other, but not both, this can still work with a little care. For example, if most files are handled OK as unix format, that format can be used in the workspace and the few Windows-only format text files to be used only by Windows tools can be marked binary to disable the EOL text format conversions on check in and check out. As a binary file, the EOL characters will not be modified by SnapshotCM and the Windows tool can continue to get the desired format. This works as long as the Windows-only files need not be accessed by a tool that does not understand and preserve the format. Shared Workspaces and Auto-homeIf you have difficulties with SnapshotCM workspace mappings in an auto-home configuration, or if you are wanting to share a workspace between multiple machines, the following may be helpful.
SnapshotCM Environment VariablesSnapshotCM provides several environment variables to customize behavior. In common use, none of these need be set.
Enabling and Disabling SnapshotCM's SCC Integration on WindowsSnapshotCM integrates into Developer Studio and other tools using the SCC API, providing SnapshotCM operations directly from within these environments. This integration is installed and configured by the SnapshotCM installer on Windows. The following describes how to enable, restore or disable SnapshotCM's SCC integration. To enable or restore SnapshotCM's SCC integration, load the SnapshotCM.reg file from SnapshotCM's install directory: regedit "c:\Program Files\True Blue Software\SnapshotCM\SnapshotCM.reg" To disable SnapshotCM's SCC integration, load the SCCDisable.reg file in SnapshotCM's install directory: regedit "c:\Program Files\True Blue Software\SnapshotCM\SCCDisable.reg" Removing Snapshots and ProjectsIf a SnapshotCM project or snapshot becomes uninteresting or obsolete, you can remove it. Since recovery from such deletion is not easy, SnapshotCM requires confirmation before performing such removal. And a couple of conditions must be satisified before a snapshot or project is removed:
The above operations can be performed via the GUI. The following unix shell script also can be used to remove a project. Customize appropriately. # Remove snapshots in /Test project on host:
if [ $# -lt 1 ]; then
echo "usage: $0 host ..." >&2
exit 2
fi
for host in $*
do
sslist -RHX -h $host /Test | # list all snapshots in /Test project
sort -r |
while read ss
do
wset -quR -h $host -S "$ss" / # Unlock all files
ssremove -h $host "$ss" # Remove snapshot
done
done
SnapshotCM Error MessagesThe following is a partial list of SnapshotCM error messages. Each message contains a description of the possible causes of the error, and a discussion of what to do next.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
| Mailing Address:
True Blue Software Company - 5214 Keystone Creek Ct. - Fort Collins,
CO 80528-8556 - USA Telephone: 970-223-1200 - FAX: 970-223-9270 E-Mail: sales@truebluesoftware.com - support@truebluesoftware.com © 2010 True Blue Software Company. All rights reserved. |