Node:pr-edit, Next:diff-prs, Previous:at-pr, Up:Internal utils
pr-edit does the background work for
error-checking and refiling newly edited Problem Reports, handling file
and database locks and deletion of PRs. It can be called interactively,
though it has no usable editing interface.
The usage for
pr-edit [ -l username | --lock=username ] [ -u | --unlockdb ] [ -L | --lockdb ] [ -U | --unlockdb ] [ -c | --check ] [ -C | --check-initial ] [ -s | --submit ] [ -a field | --append field=field ] [ -r field | --replace=field ] [ --delete-pr ] [ -R reason | --reason=reason ] [ -p process-id | --process=process-id ] [ -d databasename | --database=databasename ] [ -f filename | --filename=filename ] [ -V | --version ] [ -h | --help ] [ -v username | --user=username ] [ -w passwd | --passwd=passwd ] [ -H host | --host=host ] [ -P port | --port=port ] [ -D | --debug ] [ PR number ]
A lock is placed on a Problem Report while the PR is being edited.
The lock is simply a file in the
locks subdirectory of the
gnats-adm directory of the database, with the name
gnats-id.lock, which contains the name of the
user who created the lock. user then "owns" the
lock, and must remove it before the PR can be locked again, even by the
same user1. If a PR is already
locked when you attempt to edit it,
pr-edit prints an error
message giving the name of the user who is currently editing the
If you do not specify PR number,
pr-edit reads from
standard input. You must specify PR number for the functions
which affect PR locks,
-doption. No PRs may be edited, created or deleted while the database is locked. This option is generally used when editing the index file.
--checkoptions are used to verify that a proposed PR's field contents are valid. The PR is read in (either from stdin or a file specified with
--filename), and its fields are compared against the rules specified by the database configuration of the selected database. Warnings are given for enumerated fields whose contents do not contain one of the required values or fields that do not match required regexps.
--check-initialis used to verify initial PRs, rather than proposed edits of existing PRs.
The following options require a PR number to be given.
-poption is also given, that process-id is associated with the lock.
--replaceare used to append or replace content of a specific field within a PR. The new field content is read in from stdin (or from the file specified with the
--filenameoption), and either appended or replaced to the specified field. The field contents are verified for correctness before the PR is rewritten. If the edit is successful, a zero exit status is returned. If the edit failed, a non-zero exit status is returned, and the reasons for the failure are printed to stdout.
PR numberis specified with no other options, a replacement PR is read in (either from stdin or the file specified with
--filename). If the PR contents are valid and correct, the existing PR is replaced with the new PR contents. If the edit is successful, a zero exit status is re turned. If the edit failed, a non-zero exit status is returned, and the reasons for the failure are printed to stdout.
default). This option overrides the database specified in the GNATSDB environment variable.
--filenameis not specified, the PR or field content is read in from stdin.
pr-edit can edit PRs across a network, talking to a
remote gnatsd. The following options relate to network access:
This approach may seem heavy-handed, but it ensures that changes are not overwritten.