This article welcomes any non-commercial reprinting behavior. Requirements: The full text must be reprinted and the author should be added. The source is correct. Thank you!
The Standard Edition selects the following rule format:
Scope pattern version-Selector [Optional-clause]
A row can have multiple standard rules separated by semicolons.
All scopes are for configuration items, so they all start with element. You can set the-file,-directory, and-eltype parameters.
If the element does not include any parameters, the subsequent pattern verion-Selector [Optional-clause] will be valid for any configuration item.-file and-directory will only work for the file configuration item and directory configuration item respectively; -There is a space interval between eltype and the specified configuration item type. For example,-eltype text_file indicates that the subsequent matching rules only work for text_file type configuration items. If an eltype includes some sub-eltypes, valid only for this eltype. For example,-eltype file is not valid for text_file type configuration items.
Pattern is a Config map rule. Wildcards can be used as follows:
A )? Match any single character that meets the naming rules, for example:? C, you can match 1c , AAC and A. C, etc., but do not match AC, and a/c.
B) * match any characters from 0 to the maximum length of the naming rule. These characters do not have to be consistent? The difference is that * can match 0 characters, such as * SRC * And thesrc, src1, and SRC.
C )~ Corresponding root directory.
D) [ABC] corresponds to any character in [], for example, C * [GS]. Java, matching config. Java and constants. java.
E) [A-Z] corresponds to a character in [] that is located between-before-and-after-ASCII encoding, including-before and after each character, for example: T [A-E] st matches tast, TBST, TCST, tdst, and test.
F )... Match any multi-level directory with 0 to meet the rule requirements, such as src /... /Config. Java, which matches the following configuration items:
Src/COM/config. Java
Src/COM/test/config. Java
Src/config. Java
If the matching rule is src /..., This includes the src directory and all its subdirectories.
The above wildcards can be combined, for example, the matching character src /... /C [A-Z] [A-Z]. Java matches the following configuration items:
Src/COM/CAA. Java
Src/COM/test/cot. Java
Version-Selector describes the version selection rules for configuration items. There are three version selection rules:
A) branch name plus version number: for example,/main/0 indicates version 0 on the main branch. This is an empty version, /main/test/1 indicates the 1st versions under the test branch under the main branch.
B) add a label to the branch name, for example,/main/test/mylabel2. The version of the configuration item mylabel2 is found under all main/test branches. You can also find the version of the configuration item marked with the label on all branches. If multiple versions of the same configuration item on multiple branches are marked with the label, an error occurs. For example, there is a predefined label: Latest,/main/latest indicates the latest version of the main branch, but latest is not a version number but a predefined label, the latest version of each branch has this label. Note that the label cannot be applied... /Latest, which indicates that the last version selected on all branches will conflict. If the above version selection rules appear in your config_spec, A fatal view server error is reported.
C) Add query options to the branch name, for example,/main/test/{tested = Yes}. Search for the version with the last tested attribute "yes" under the main/test branch. Like label, the query option can also be used, but there is no conflict with the label.
Several special rules in version-selector:
A) checkedout: match the version of the current view that is checkout. If it is a file configuration item, it is a view private file with the same name as the configuration item.
B)-config: match the derived objects generated by clearmake or omake. You can specify different derived objects for different versions of configuration items.
C)-None: This matching rule is mainly for UNIX operating systems. It is set in windows. If cleartool LS is not applied, no configuration item exists. in Unix systems, it will generate an enoent (without such a file or directory) error. The application cleartool ls will prompt [No version selected].
D)-error: This matching rule is the same as the previous one for the uni operating system. When cleartool LS is applied, the system will prompt [error on reference].
Finally, it is optional: Optional-clause. The following options are available:
A)-time: This option-free application must have the latest tag in version-selector. If this tag is not available, no error is prompted, but it does not work.
-Add a date and time after time to search up from latest and find the latest version created after the specified date and time, if the configuration item does not exist at the specified date or time, the initial null version is not provided, but the latest version is matched.
The date and time formats are as follows:
Date. Time | date | time | now
The above factors are mutually exclusive. You can add UTC to the end so that the time is Greenwich Mean Time, which can avoid the impact of the time zone. If no date is specified, the default value is today. If no time is specified, the default value is 00:00:00. Note that the date is automatically converted to the standard date after setcs is executed. If it is set to today, the same view does not perform the endview operation. One week later, the matching rule is based on the version of the previous week instead of the latest version. Therefore, if the-time option is set and the date is set by today, it is best to execute endview and startview again, and then the date will be reset.
The following are the rules for date and time.
Date: =Day-of-week|Long-Date
Time: =H[H]:M[M] [:S[S] [UTC[[+|-]H[H] [:M[M]
Day-of-week: =Today|Yesterday|Sunday|... |Saturday|Sun|... |Sat Long-Date: =D[D]-Month[-[YY]YY]
Month: =January|... |December|Jan|... |Dec
Example :... /config. java/main/only_comp2_int/latest-time. It matches any config under the only_comp2_int branch of the main branch after on the current day of config_spec or startview. the first version of Java.
In time, now is a special format specified for the current time.
B)-nocheckout: The selected configuration item does not display the checkout version. The rule of the corresponding configuration item must be located on the element * checkedout. If the first line is element * checkedout, -The nocheckout setting is invalid. You can delete the lement * checkedout, or modify the element * checkedout without matching any configuration items. If the configuration item does have a checkout version, eclipse is displayed in the view, that is, the configuration item in the checkout status is displayed, but cannot be displayed.
C)-mkbranch: If the version of a configuration item that matches the rule selected in the previous version is checkout, the specified branch of the configuration item is automatically created. The format is as follows:
-MkbranchBranch-type-name
Note that the branch-type-name must be defined in vob. If it is not defined, an error occurs and the checkout operation cannot be performed. The version selection rule "-none" or "-error" does not work.