ccm work_area /find find_str /replace new_str
If you also specify /reg or /regexp, both find_str and new_str are interpreted as regular expressions.
ccm work_area /dbpath old_path
The old_path option cannot be interpreted as a regular expression. The /dbpath option updates the work area ID files for the found projects with the path name of the current database. This option must be used only when a database is moved. Using of this option on a UNIX link-based work area causes the work area to be synchronized in order to update the links to the new database location. If you also specify the /nosync option, the synchronization is deferred. However, you must perform the synchronization manually before the work areas can be used.
You can add the /new option to /find and /replace to indicate the presence of a new database. This means that the original work areas specified by /find are not visible to this session and must be ignored. This option is useful after a database has been unpacked to a new path name and you want to ignore the original database work areas, or if the original database is not present. If you do not add the /new option, the command operates only on projects with visible work areas.
You can add the /show option to /find or to /dbpath to show which projects are updated. If you use /show with /find and /replace, the replacement path names are displayed. This can be useful if you are using /find and /replace with regular expressions (/regexp).
> ccm work_area /find "-" /replace "~"
You can use this command after changing a database delimiter from "-" to a "~". You must execute the command from enough sessions to change all work areas. If all your work areas are visible from one session, one session is sufficient. However, if you have both Windows and UNIX work areas, you must execute this command from both Windows and UNIX clients.
> ccm work_area /find "-" /replace "~" /scope prep
You can use this command after changing a database delimiter from "-" to a "~". You must execute the command as build_mgr from enough sessions to change all build management work areas. If all prep work areas are visible from one session, one session is sufficient. However, if you have both Windows and UNIX build management work areas, you must execute this command from both Windows and UNIX clients.
$ ccm work_area -dbpath /vol/acrel5/ccmdb/ccm_platform
Use this command to update a database that has been moved but can use its old work area paths. You must execute the command from enough sessions to change all work areas. If all your work areas are visible from one session, one session is sufficient. However, if you have both Windows and UNIX work areas, you must execute this command from both Windows and UNIX clients.
> ccm work_area /find platform /replace services /new
Use this command to update a database that was unpacked or copied to a new name. The /new option creates work areas because the old work areas are in use by the old database. If you want to reuse the old work areas (such as for a database that has been moved), you first must update the work area ID files using the /dbpath option so that the old work areas are visible for this database.
Use the /reg or /regexp option to cause the work_area command to interpret the find_str and new_str arguments as regular expressions.
> ccm wa /find "joe45\\\\" /replace "" /reg /p
Checking work area paths for replacement...
1 project(s) will be checked.
Setting path for work area of ‘hsai~1’ to ‘c:\ccm_wa\hsai~1’...
1 project work area path(s) were updated:
‘hsai~1’: ‘c:\ccm_wa\hsai~1’
When you remove a directory from a path, include an associated backslash. Specifying the leading backslash is simpler, but the following example uses the trailing backslash:
joe45\.
The Rational Synergy command processor sees the leading quotation for joe45. Then, if it encounters a backslash while looking for the trailing quotation, it interprets the backslash as a signal to include the following quotation as part of the argument instead of as the closing quotation mark. Therefore, you must "escape" the backslash by prepending another backslash. Also, the expression that results from the Rational Synergy command processing (joe45\) is misinterpreted by the regular expression processor as a backslash without a corresponding replacement construct character, unless the trailing backslash is, itself, escaped with two additional backslash characters.
If you specify multiple directories enclosed in quotation marks, you must use only four quotations for the trailing directory backslash, immediately preceding the closing quotation mark. The directory backslash in the middle of the argument can be escaped once so that the regular expression processor does not interpret the backslash as the beginning of a replacement construct.
> ccm wa /find "ccm_wa\\joe45\\\\" /replace "" /reg /p hsaw~1
Checking work area paths for replacement...
1 project(s) will be checked.
Setting path for work area of ‘hsaw~1’ to ‘c:\users\joe\hsaw~1’...
1 project work area path(s) were updated:
‘hsaw~1’: ‘c:\users\joe\hsaw~1’
> ccm wa /find "\+joe45\\\\" /replace "" /reg /p hsaw~1
Checking work area paths for replacement...
1 project(s) will be checked.
Setting path for work area of ‘hsaw~1’ to ‘c:\ccm_wa\hsaw~1’...
1 project work area path(s) were updated:
‘hsaw~1’: ‘c:\ccm_wa\hsaw~1’
> ccm wa /find "\\\+joe45" /replace "" /reg /p hsaw~1
Checking work area paths for replacement...
1 project(s) will be checked. Setting path for work area of ‘hsaw~1’ to
‘c:\ccm_wa\hsaw~1’...
1 project work area path(s) were updated:
‘hsaw~1’: ‘c:\ccm_wa\hsaw~1’
In general, unless there are special characters or spaces in find_str or new_str, no quotations are needed (in a non-UNIX environment). The following examples show regular expressions without quotation marks.
> ccm wa /find users\\joe\\ccm_wa\\ /replace temp\\ccm\\ /reg /p junk~1
Checking work area paths for replacement...
1 roject(s) will be checked.
Seting path for work area of ‘junk~1’ to
‘c\temp\ccm\joe45\junk~1’...
1 roject work area path(s) were updated:
‘jnk~1’: ‘c:\temp\ccm\joe45\junk~1’
In this case, the only characters that must be escaped are the backslashes with which the regular expression processor normally initiates replacement constructs.
One common reason not to escape the replacement construct is that UNIX file systems are case-sensitive.
The need to do this might arise if the Rational Synergy administrator changed the criteria for naming directories.
pc-1: /users/joe/ccm_wa/owner/pc-1
pi-1: /users/joe/ccm_wa/static/pi-1
pw-1: /users/joe/ccm_wa/owner/pw-
The arguments are enclosed in quotation marks to prevent the UNIX shell from processing "*" and other special characters, and the backslashes are escaped as well, although that is optional in this case. Parentheses identify the first and second expressions for later substitution. The selection set (@) operator refers to the results of the query.
$ ccm wa -find "/users/joe/ccm_wa/([^/]+)/(.*)" -replace \
"/users/joe/ccm_wa/\\u\\1/\\2" -reg @
Checking work area paths for replacement...
3 project(s) will be checked.
Setting path for work area of ‘pc-1’ to ‘/users/joe/ccm_wa/Owner/pc-1’
. . .
Setting path for work area of ‘pi-1’ to ‘/users/joe/ccm_wa/Static/pi-1’
. . .
Setting path for work area of ‘pw-1’ to ‘/users/joe/ccm_wa/Owner/pw-1’
. . .
3 project work area path(s) were updated:
‘pc-1’: ‘/users/joe/ccm_wa/Owner/pc-1’
‘pi-1’: ‘/users/joe/ccm_wa/Static/pi-1’
‘pw-1’: ‘/users/joe/ccm_wa/Owner/pw-1’
The need to do this might arise if the Rational Synergy administrator changed the criteria for naming directories.
pc-1: c:\joe\ccm_wa\Owner\pc-1
pi-1: c:\joe\ccm_wa\Static/pi-1
pw-1: c:\joe\ccm_wa\Owner/pw-1
The arguments are enclosed in quotations to prevent the shell from processing ’*’ and other special characters, and the backslashes are escaped as well, although that is optional in this case. Parentheses identify the first and second expressions for later substitution. The selection set (@) operator refers to the results of the query.
> ccm wa /find "\\joe\ccm_wa\\([^\\]+)\\(.*)" /replace
"\\joe\ccm_wa\\\1\\\1\\\2" /reg @
Checking work area paths for replacement...
3 project(s) will be checked.
Setting path for work area of ‘pc-1’ to ‘C:\joe\ccm_wa\owner\pc-1’
. . .
Setting path for work area of ‘pi-1’ to ‘C:\joe\ccm_wa\static\pi-1’
. . .
Setting path for work area of ‘pw-1’ to ‘C:\joe\ccm_wa\owner\pw-1’
. . .
3 project work area path(s) were updated:
‘pc-1’: ‘C:\joe\ccm_wa\owner\pc-1’
‘pi-1’: ‘C:\joe\ccm_wa\static\pi-1’
‘pw-1’: ‘C:\joe\ccm_wa\owner\pw-1’