... where my_datafile contains an XML document in this format:
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:
<newIssue issueDB="UserReportedBugs"> <issue>
<type
fid="7">defect</type>
<submittedBy
fid="10">5</submittedBy>
<foundInRelease
fid="20">rel2.0</foundInRelease>
<productType
fid="6">Widget</productType>
<shortDescription
fid="4">Names are sometimes trunca</shortDescription>
<dateSubmitted
fid="11">1083606275</dateSubmitted> </issue>
</newIssue>
use Time::Local;$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";
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
<none selected>.
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
<issue>
<issueNum
fid="1">11</issueNum>
<transNum
fid="2">154</transNum>
<type
fid="7">defect</type>
<submittedBy
fid="10">24</submittedBy>
<foundInRelease
fid="20">rel2.0</foundInRelease>
<productType
fid="6">Frammis</productType>
<shortDescription
fid="4">Refuses to fram</shortDescription>
<dateSubmitted
fid="11">1062787292</dateSubmitted>
</issue>