Using a Specific Version of an Element

Most commands have defaults for which versions to use; many of them let you specify a different version with the –v option. For instance, the diff command defaults to comparing the file in your workspace with the most recently kept version. Using the –v option, you can compare the file in your workspace with any version:

accurev diff -v 1/4 foo.doc

The version specification following –v can be either of the following:

<stream-name> /<version-number>

If your current directory is within a workspace, which establishes a particular depot as the “current depot”, then you can also use either of the following with –v:

<stream-number> / <version-number>

(Stream names are unique throughout the repository; but all depots use the same stream numbers. Thus, you need a current depot context to make a stream number, such as 2, unambiguous. To do so, either you must be in a workspace, or you must specify a depot using the –p option.)

You can use a forward slash ( / ) or a backslash ( \ ) on any platform. With UNIX/Linux shells, you’ll need to quote or escape the backslash character.

A specification that includes a <version-number> is completely deterministic and invariant. Once someone creates version 13 in stream tulip_dvt, the version specification tulip_dvt/13 always refers to that version, no matter what happens in the future (well, almost — see the Note below).

A specification that includes only a <stream-name> or <stream-number>, not a <version-number>, says “the version that is currently in use by the specified stream”:

  • If the element is active in that stream — that is, the element is in the stream’s default group — this means the most recent (highest-numbered) version in the stream.

  • If the element is not active in that stream, the steam “inherits” its current version of the element from its parent stream. The parent stream might, in turn, inherit its current version from the next higher stream in the hierarchy.

    Note: AccuRev’s TimeSafe property means that once a version is created, it can never be destroyed. If a stream is renamed (chstream command), a version specification can still use the old stream name — or the stream number, which never changes. If a stream is deactivated (remove command), its versions become inaccessible. This is not irrevocable, though: you can reactivate a stream, making its versions accessible again, with the reactivate command.