rename
Assigns a new name to an existing object
Applicability
Product |
Command type |
---|---|
VersionVault |
cleartool subcommand |
VersionVault Remote Client |
rcleartool subcommand |
MultiSite |
multitool subcommand |
Platform |
---|
UNIX® |
Linux® |
Windows® |
Synopsis
- rename [ –c/omment comment | –cfi/le comment-file-pname
- | –cq/uery | –cqe/ach | –nc/omment ]
[ –acq/uire ] old-object-selector new-object-selector
Description
If you are renaming a pool, no data container in the pool is affected.
If you are renaming a replica, the name change is propagated to other replicas, through the standard synchronization mechanism. This command is valid only at the replica that masters the VOB-replica object being renamed.
If you are renaming a type object, all instances of the type object, throughout the VOB, are also renamed. If the type object is global, all local copies of the type object are renamed. For example, if you rename a branch type from bugfix to rel1.3_fixes, all existing bugfix branches are also renamed to rel1.3_fixes. (For more information about global type renaming, see the Help.)
- A VOB cannot contain a branch type and a label type with the same name.
- Do not use this command to rename an instance of a type, for example to rename a particular branch of a particular element. For that purpose, use chtype.
Restrictions
Identities
You must have one of the following identities:
- Replica creator (for renaming a replica)
- Object owner
- VOB owner
- root (UNIX® and Linux®)
- Member of the VersionVault administrators group (VersionVault on Windows®)
Locks
An error occurs if one or more of these objects are locked: VOB, object.
Mastership
(Replicated VOBs only) Your current replica must master the object.
Options and arguments
Event records and comments
- Default
- Creates one or more event records, with commenting controlled by your .versionvault_profile file (default: –nc). See the comments reference page. Comments can be edited with chevent.
- –c/omment comment | –cfi/le comment-file-pname |–cq/uery | –cqe/ach | –nc/omment
- Overrides the default with the option you specify. See the comments reference page.
Handling eclipsed objects
- Default
- If renaming the object in an administrative VOB would eclipse an existing object in a client VOB, this command fails.
- –acq/uire
- Converts eclipsing objects to local copies of the new global type. The definitions of the of the object to be renamed and the object that would be eclipsed as a result of the rename operation must match, else this command fails.
Specifying the old and new names
- Default
- None.
- old-object-selector, new-object-selector
- The name of an existing object and a new name for it. Specify object-selector in
one of the following forms:
old-object-selector
vob-selector
vob:pname-in-vob
pname-in-vob can be the pathname of any file system object within the VOB (if the VOB is mounted). It cannot be the pathname of the VOB storage directory or a VOB tag. (Use mktag to change the name of a VOB tag.)
attribute-type-selector
attype:type-name[@vob-selector]
branch-type-selector
brtype:type-name[@vob-selector]
element-type-selector
eltype:type-name[@vob-selector]
hyperlink-type-selector
hltype:type-name[@vob-selector]
label-type-selector
lbtype:type-name[@vob-selector]
trigger-type-selector
trtype:type-name[@vob-selector]
pool-selector
pool:pool-name[@vob-selector]
hlink-selector
hlink:hlink-id[@vob-selector]
oid-obj-selector
oid:object-oid[@vob-selector]
The following object selector is valid only if you use MultiSite:
replica-selector
replica:replica-name[@vob-selector]
The following object selectors apply to UCM:
activity-selector
activity:actvity-name[@vob-selector]
baseline-selector
baseline:baseline-name[@vob-selector]
component-selector
component:component-name[@vob-selector]
folder-selector
folder:folder-name[@vob-selector]
project-selector
project:project-name[@vob-selector]
stream-selector
stream:stream-name[@vob-selector]
For more information about object selectors, see the cleartool reference page.
Examples
The UNIX system and Linux examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.
The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the UNIX system and Linux shells or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.
- Rename one of the current VOB's pools
from c_pool to c_source_pool.
cmd-context rename -c "make pool name clearer" \
pool:c_pool pool:c_source_pool
Renamed pool from "c_pool" to "c_source_pool". - List existing pools in the current VOB.
Then, rename pool do1 to do_staged.
cmd-context lspool –short
c_source_pool
cdft
ddft
do1
my_ctpool
sdft
cmd-context rename pool:do1 pool:do_staged
Renamed pool from "do1" to "do_staged". - Rename a branch type from rel2_bugfix to r2_maint.
First, show the version tree for util.c with the lsvtree command.
Then rename the branch type, and show the version tree again.
cmd-context lsvtree –short util.c
util.c@@\main\1
util.c@@\main\rel2_bugfix
util.c@@\main\rel2_bugfix\1
util.c@@\main\3
cmd-context rename brtype:rel2_bugfix brtype:r2_maint
Renamed type from "rel2_bugfix" to "r2_maint".
cmd-context lsvtree –short util.c
util.c@@\main\1
util.c@@\main\r2_maint
util.c@@\main\r2_maint\1
util.c@@\main\3 - On a UNIX® or Linux® system, rename the element type
of msg.c and hello.c from text_file to source_file.
Use grep(1) to extract the element name/value from the
output of the describe command. (Note warning about renaming
a predefined type.)
cmd-context describe msg.c hello.c | grep 'element type'
element type: text_file
element type: text_file
cmd-context rename eltype:text_file eltype:source_file
cleartool: Warning: Renaming a predefined object!
Renamed type from "text_file" to "source_file".
cmd-context describe msg.c hello.c | grep 'element type'
element type: source_file
element type: source_file - Rename an attribute attached to a version
of element msg.c from TESTED to QAed. Use describe to
show the name/value association before and after the name change.
cmd-context describe –aattr TESTED msg.c
msg.c@@\main\3
Attributes:
TESTED = "TRUE"
cmd-context rename attype:TESTED attype:QAed
Renamed type from "TESTED" to "QAed".
cmd-context describe –aattr QAed msg.c
msg.c@@\main\3
Attributes:
QAed = "TRUE" - Rename replica paris to paris_louvre.
cmd-context rename replica:paris paris_louvre
Renamed replica "paris" to "paris_louvre".