accurev xml -l my_datafile
... where my_datafile contains an XML document in this format:
... individual field-value specifications ...
As always, replace XXXXX with the name of the depot that the issues are stored in. For the individual field-value specifications, adapt the output of a query that retrieves a single issue record. The complete contents of my_datafile might be:
fid="4">Names are sometimes trunca</shortDescription>
Some DOs and DON’Ts:
You must specify the value of a User field with a user-ID (5), not a username (derek).
You must specify the value of a Timestamp field with a number-of-seconds integer, not a string. You can use the timelocal() function in the Perl module Time::Local to generate these integers:
$sec = 35; # range = 0 .. 59
$min = 22; # range = 0 .. 59
$hr = 14; # range = 0 .. 23
$dte = 8; # range = 1 .. 31
$mth = 5; # range = 0 .. 11 (January is the zero’th month!)
$yr = 2004; # play it safe: use a 4-digit number
$numseconds = timelocal($sec, $min, $hr, $dte, $mth, $yr);
print $numseconds, "\n";
Don’t include specifications for the issueNum and transNum fields. AccuWork assigns these values automatically.
The field initialization and validation code defined in the schema will not be executed when the issue record is created. It’s up to you to specify the appropriate values for the appropriate fields.
The validations will be invoked when the issue record is subsequently opened in the AccuRev GUI. In particular, you can create an issue record with a List field whose value is not in the field’s list of possible values. But when the AccuRev GUI opens the issue record, it replaces the bogus value with a blank value (i.e., unspecified).
Be sure that the top-level and second-level XML elements are named
<issue>. The names for the individual-field elements are irrelevant — only the fid attributes count. The following specifications are equivalent:
When you submit the <newIssue> data structure to the AccuWork CLI, it creates the record and reports the new record’s contents. This report includes the automatically assigned issueNum and transNum values:
>>> accurev xml -l my_datafile
fid="4">Refuses to fram</shortDescription>