4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
21 .\" Copyright 2008 Sun Microsystems, Inc. All rights reserved.
22 .\" Use is subject to license terms.
24 .TH WHICH_SCM 1ONBLD "Sep 18, 2009"
26 which_scm \- Report Source Code Management system
32 detects the Source Code Management (SCM) system in use, and prints a
33 single line of text containing a one-word name for the SCM, followed
34 by a space, and then the top-level directory path for the workspace.
36 The typical usage within a ksh script is:
38 which_scm | read SCM_TYPE CODEMGR_WS || exit 1
41 If CODEMGR_WS is set in the environment, then \fBwhich_scm\fR
42 checks only that directory, assuming that it is the top of the tree.
44 If CODEMGR_WS is not set, then \fBwhich_scm\fR searches upwards to
45 find the containing workspace path, and reports that path.
48 can detect the following types of SCM systems (these are the keywords
49 used in the output format):
60 If the type of SCM in use is not known, then the string "unknown" is
61 printed, and the path returned is $CODEMGR_WS (if set) or the current
62 working directory. The command may exit with an error if the SCM
63 could be detected, but is unusable.
65 .SH ENVIRONMENT VARIABLES
66 The following environment variable is used by \fBwhich_scm\fR:
69 \fBCODEMGR_WS\fR path to current workspace.