AccuRev® Command-Line Reference : setproperty

setproperty
set property on stream or principal
Usage
accurev setproperty [ -s <stream> | -u <principal> ] [ <property-name>
<value> | -l <file-name> <property-name> ]
Description
The setproperty command assigns a property name/ value pair to either a stream or a principal (user or group). If the property does not exist, AccuRev creates it; that is, a new property does not require a separate create command. Properties are not TimeSafe; if you respecify or remove a property, you cannot roll back to the prior property name/value pair.
If you have implemented a server_admin_trig server-side trigger at your site and you want to modify it to use stream and principal properties, see Modifications to server_admin_trig on page 235.
Options
-s <stream>
Specifies the name of the stream on which to set the property.
-u <principal>
Specifies the name of the user or group on which to set the property.
<property-name>
Specifies the name of the property. Maximum of 255 characters. Property names are case-insensitive regardless of depot settings or platform. The names title and Title are equivalent, for example.
<value>
Specifies the property value. AccuRev places no limit on value length, but length limits may be established by the operating system shell for values input on the command line.
-l <file-name>
To specify a file as a value (an image, for example), use -l with the <file-name> option. You can use either a relative or absolute path to specify the file location. If you do not specify a path, AccuRev assumes the file is in the current directory. Note that when you use -l, you must reverse the order of the name/value pair to pair/value.
The -l option transfers the file content to the AccuRev Server. Similarly, if a file name is specified when reading a stream or principal property (using getproperty, for example), AccuRev places the content in that file; otherwise, AccuRev returns an asterisk (*) for that property. See getproperty on page 115 for more information.
Examples
On stream "prod_2010", set a property named "Status" with a value of "obsolete":
> accurev setproperty -s prod_2010 Status obsolete
On user "jsmith", set a property named "contractor" with a value of "AcmeTemps":
> accurev setproperty -u jsmith contractor AcmeTemps
Note that the order of the name/value pair changes to value/name when using the -l option to specify a file as a property value, as shown in the following two examples:
On user "jsmith", set a property named "profile" with a value of "jsmith.png":
> accurev setproperty -u jsmith -l jsmith.jpg profile
On user "jsmith", change the "profile" property to "jsmith_smiling.png":
> accurev setproperty -u jsmith -l jsmith_smiling.jpg profile
Modifications to server_admin_trig
If you have implemented the server-side trigger server_admin_trig at your site, you need to modify it if you want it to work with the setproperty command. See the "Trigger Parameters File" section in the "AccuRev Triggers" chapter of the AccuRev Administrator’s Guide for more information.
setproperty for a stream
<?xml version="1.0" encoding="utf-8"?>
<triggerInput>
<depot>test1</depot>
<hook>server_admin_trig</hook>
<command>setproperty</command>
<principal>testuser</principal>
<ip>10.10.10.177</ip>
<propertyKind>stream</propertyKind>
<streamName>stream1</streamName>
<propertyName>bingo</propertyName>
<propertyValue>bongo</propertyValue>
</triggerInput>
setproperty for a user
<?xml version="1.0" encoding="utf-8"?>
<triggerInput>
<hook>server_admin_trig</hook>
<command>setproperty</command>
<principal>testuser</principal>
<ip>10.10.10.177</ip>
<propertyKind>principal</propertyKind>
<principalName>user3</principalName>
<propertyName>foobar</propertyName>
<propertyValue>bongo</propertyValue>
</triggerInput>
See Also
getproperty, rmproperty, show

AccuRev, Inc.
Phone: 781-861-8700
Fax: 781-861-8704
support@accurev.com