WEBREV(1ONBLD) | illumos Build Tools | WEBREV(1ONBLD) |
webrev [ common-options ] file-list-file | -
webrev [ common-options ] -w wx-file
$ webrev
In which case webrev attempts to figure out the list of files for review. If that fails, or if more control over the set of files is needed, a file list may be specified. webrev also attempts to deduce a basis for comparison (interchangeably called the parent, but see SCM INTERACTIONS below). A basis for comparison is needed in order to determine the differences introduced by the code changes under review.
By default, webrev creates a webrev directory in the workspace directory that contains the generated HTML files, and a patch representing the changes. It also places a copy of the file list in that directory, and of both the old and new raw files in the $webrev_root/raw_files directory. To output the webrev somewhere other than the default location, use the -o <outdir> option, or set the WDIR environment variable. For example:
$ webrev -o ~/public_html/myreview/
In the index file, each file is listed on a line with a link to the relevant review materials. Comments for each change will be included automatically. Cross references to bug (or other information) tracking databases in the comments will become hyperlinks in the associated web interface, according to the rules in CROSS REFERENCING below.
As a review aid, content may be added to the index file in two ways. First, the author may manually edit the file (for example by including text that explains the changes in front of the links for each file). Note that if webrev is run again, manual edits will be lost. Second, if a file named webrev-info is present at the root of the workspace, it will be automatically included in the index file. To include a different file, see the -i option.
For each file in the file list, webrev compares the file with the version in the basis for comparison (i.e. the parent workspace) and generates a variety of HTML renderings of the differences between the two files; which of these renderings to use is largely a matter of personal preference. Additional, webrev emits a patch, the old and new versions of the file, and a "raw" copy of the file which is suitable for download. For files which express differences, source is formatted according to the following color coding:
unchanged : black removed : brown changed : blue new : bold blue
In all cases, if the user has activated the workspace with the ws(1ONBLD) or bldenv(1ONBLD) commands, webrev will use the CODEMGR_PARENT and CODEMGR_WS environment variables to identify parent and child workspaces respectively. To manually specify the basis for comparison, use the -p option or specify the CODEMGR_PARENT variable in either the file list or the environment.
The parent specified when using git is, in all cases, a git 'tree-ish' and never an actual git repository, remote or otherwise. Anything specifiable to git as a tree-ish should, similarly, be specifiable as a parent for webrev. This includes branches, explicit revisions, reflog entries, etc. See git-rev-parse(1)
The file list will be created from the output of the "svn status" command.
usr/src/uts/common/fs/nfs/nfs_subr.c usr/src/uts/common/fs/nfs/nfs_export.c usr/src/cmd/fs.d/nfs/mountd/mountd.c
Include the paths of any files added, deleted, or modified. You can keep this list of files in the webrev directory that webrev creates in the workspace directory (CODEMGR_WS).
If CODEMGR_WS is not set, it may be specified as an environment variable within the file list, e.g.
CODEMGR_WS=/home/brent/myws usr/src/uts/common/fs/nfs/nfs_subr.c usr/src/uts/common/fs/nfs/nfs_export.c usr/src/cmd/fs.d/nfs/mountd/mountd.c
To compare the workspace against one other than the parent (see also the -p option), include a CODEMGR_PARENT line in the file list, like:
CODEMGR_WS=/home/brent/myws CODEMGR_PARENT=/ws/onnv-gate usr/src/uts/common/fs/nfs/nfs_subr.c usr/src/uts/common/fs/nfs/nfs_export.c usr/src/cmd/fs.d/nfs/mountd/mountd.c
Finally, run webrev with the name of the file containing the file list as an argument, e.g.
$ webrev file.list
If "-" is supplied as the name of the file, then stdin will be used.
usr/src/uts/common/fs/nfs/nfs_subr.c 1206578 Fix spelling error in comment usr/src/uts/common/fs/nfs/nfs_export.c 4039272 cstyle fixes usr/src/cmd/fs.d/nfs/mountd/mountd.c 1927634 mountd daemon doesn't handle expletives
$ webrev -o ~/public_html/myreview-rd2/ \ -p ~/public_html/myreview/
CDIFFCMD and UDIFFCMD are used when generating Cdiffs and Udiffs respectively; their default values are "diff -b -C 5" and "diff -b -U 5". To generate diffs with more (or less) than 5 lines of context or with more (or less) strict whitespace handling, set one or both of these variables in the user environment accordingly.
WDIR sets the output directory. It is functionally equivalent to the -o option.
WDIFF specifies the command used to generate Wdiffs. Wdiff generates a full unified context listing with line numbers where unchanged sections of code may be expanded and collapsed. It also provides a "split" feature that shows the same file in two HTML frames one above the other. The default path for this script is /ws/onnv-gate/public/bin/wdiff but WDIFF may be set to customize this to use a more convenient location.
WEBREV_TRASH_DIR specifies alternative location of trash directory for remote webrev deletion using the -D option. The directory is relative to the top level directory of the default sftp/rsync directory tree. The default value of this directory is ".trash".
$ webrev -U
This will generate the webrev to local directory named 'webrev' and upload it to remote host with remote directory name equal to local workspace/repository name. To change both local and remote directory name, -U can be combined with -o option. The following command will store the webrev to local directory named "foo.onnv" and upload it to the remote host with the same directory name:
$ webrev -U -o $CODEMGR_WS/foo.onnv
If there is a need for manual change of the webrev before uploading, -U can be combined with -n option so that first command will just generate the webrev and the second command will upload it without generating it again:
$ webrev $ webrev -n -U
For custom remote targets, -t option allows to specify all components:
$ webrev -U -t \ ssh://user@cr.opensolaris.org:foo/bar/bugfix.onnv
If the remote path is specified as absolute, webrev will assume all the directories are already created. If the path is relative, webrev will try to create all needed directories. This only works with SCP/SFTP transport.
By default, rsync transport will use SSH for transferring the data to remote site. To specify custom username, use entry in SSH client configuration file, for example:
Host cr.opensolaris.org Hostname cr.opensolaris.org User vkotal
$ webrev -Do webrev-foo.onnv
Otherwise webrev will attempt to remove remote directory with the same name as basename of the local repository.
For the nested directory case it is necessary to specify the full target:
$ webrev -D -t \ ssh://user@cr.opensolaris.org:foo/bar/bugfix.onnv
This will remove just the bugfix.onnv directory.
Have fun!
Brent Callaghan 11/28/96
August 2, 2019 |