A few command-line options are recognized by many of the accurev commands, and work identically (or nearly identically) in each command. These options act as filters, selecting a subset of the depot’s elements based on their element status. This makes it easy to select sets of elements for a command to operate on. You can use these filter options alone or in combination with filename arguments. Examples:
Invoke the keep command on all items in the current directory:
Invoke the keep command on all items in the current directory with
(modified) status.
Invoke the add command on all items in the current directory with
(external) status and a
.png filename suffix.
Invoke the stat command on all items in the workspace, in all directories.
The –m option selects modified elements. By default, it selects all modified elements. When combined with other selection criteria, it narrows the selection to just the modified elements. This is how we obtained the earlier example with
keep. To keep all modified elements:
To simply find out which elements match a given set of criteria, use the stat command. As in the previous example, to list all modified elements in the current directory:
To select all kept elements, use the –k option. This command promotes all the elements in the depot that you’ve kept:
When combined with other selection criteria, –k narrows the selection to just the kept elements. To promote all kept elements in the current directory:
The purge and
promote commands remove elements from the default group.
You can restrict a command to using the elements in the default group, by using the –d option. This is very useful when you’re working on a large depot: determining the contents of the default group is a relatively quick operation, whereas examining all the elements in the depot is comparatively time-consuming. For instance, if you are working on a depot with 1000 files but you only have 10 files in your default group, using the options
–m –d to select the modified elements in the default group only has to check 10 files. This will run much faster than using just the
–m option, for which
accurev must examine all 1000 files.
If you want to make the best use of the default group, you will periodically need to add modified elements to the default group if they aren’t already in it. You can select non-member modified elements with the
–n option. To add all non-member modified elements to the default group:
The end goal of any change is to promote that change to the backing stream. All changes, whether kept or not, are considered to be
pending. Pending is short for “pending promotion”. The pending option is necessary because
–k does not select modified elements and
–m does not select kept elements. To list all elements that are pending promotion in the current workspace:
Elements that you have changed and have also been changed in the backing stream since you last updated your workspace are called
overlapping. Before you can promote these elements, you must
merge your changes with the new changes in the backing stream. To get a list of all overlapping elements:
Underlap status is similar to overlap status, in that an element has changed in your workspace and also in the backing stream. With underlap, the changes in your workspace version have already been promoted to the backing stream (from another workspace, or from a stream elsewhere in the depot’s stream hierarchy). In many cases, the most appropriate action is to use the
purge command to “undo” the changes in your workspace. In other cases, a merge-promote sequence is most appropriate.
Note: purge restores the version of an element that was in the backing stream at the time of your workspace’s most recent update. You might need to perform another
update to bring the version causing the underlap status into the workspace.
Files and directories that haven't been processed with the add command are called
external. These can be selected with the
–x option. This is useful for creating new elements — that is, placing files under version control:
To select all the elements in a depot, use the –a option. (If you use
–a, you cannot also list elements on the command line.) This command displays the status of all of the elements in a depot:
The –a option does not include external objects.
The commands in the preceding sections all follow the same pattern: find all the elements in your workspace that satisfy a certain condition, and perform an operation on the selected set of elements. Many of these commands require that AccuRev consider every file in your workspace, even the ones that you haven’t placed under version control (for example, editor backup files, files produced by software builds). If your workspace contains many thousands of files, such operations can be time-consuming.
–p elements that are pending promotion to the backing stream
–m elements that you’ve modified (and possibly kept, too)
–n element that you’ve modified but have not kept
–o elements with overlap status
–U elements with underlap status
–B status up the backing chain, including deep overlaps
–x files that you have not placed under version control (external)
–M elements under version control, but no file appears in your workspace (missing)
AccuRev provides optimizations that help to speed the performance of workspace and stream searches. See the
files and
stat reference pages for more information.
•
|
(UNIX/Linux) specify them using standard wildcards, which the shell will expand properly.
|
•
|
(Windows) specify them using one or more filename patterns (“wildcards”). You can also combine patterns and complete filenames in the same command.
|
The accurev program recognizes the following filename patterns:
Matches e,
f,
g,
h,
i,
j, or
k. Note: do not mix uppercase and lowercase.