mkview

Creates and registers a view

APPLICABILITY

ClearCase (cleartool subcommand), ClearCase UCM (cleartool subcommand), Attache (command)

SYNOPSIS

NOTE: You cannot use snapshot views with VOB families running below feature level 1. For information on feature levels, refer to the chflevel reference page.

DESCRIPTION

The mkview command creates a new view as follows:

Text Modes

use differentOperating systems use different character sequences to terminate lines of text files. (The standard line terminator on Windows systems is <CR><LF>.) Each ClearCase view has a text mode, which determines whether line terminators are adjusted before a text file is presented to the view (at checkout time, for example).

In the default text mode, UNIX text mode, line terminators are presented to the view exactly as stored. That is, the view does not translate line terminators when reading from, or writing to, the VOB. An alternative mode, MS-DOS text mode, exists primarily to support shared source code in mixed Windows and UNIX environments. In this model, text files are stored with single <NL> line terminators. An MS-DOS text mode view converts each <NL> to the <CR><LF> sequence expected by many Windows programs. Similarly, the view converts <CR><LF> sequences back to single <NL> characters when writing a text file back to the VOB.

We recommend that you do not use MS-DOS text mode views, unless you are encountering consistent problems with text file line terminators in a mixed Windows/UNIX network environment.

In Attache, when you use mkws to create a workspace, you can create an associated view at the same time. The mkws command does not take the -tmode option, but the Attache client has a preference you can set to specify the text mode for any views created on the behalf of a workspace. The considerations for Attache are the same as for any ClearCase Windows NT user: if you use a tool that requires <CR> characters, use MS-DOS text mode, otherwise, use UNIX text mode.

If you do not specify -tmode, mkview uses the value of the site-wide default for text mode. If a site-wide default is not set, mkview creates a UNIX mode view. After a view is created, its text mode cannot be changed.

NOTE: Before a VOB can be accessed from an MS-DOS text mode view, the msdostext_mode utility must be run against the VOB.

For more information, see Administering ClearCase. See also the Text Files, Cleartext, and a View's Text Mode section in the mkeltype reference page.

Views and Streams

Views are attached to streams in the UCM model. Only views can modify a UCM stream. Views cannot be moved between streams or detached from a stream without removing the view.

Creating a Snapshot View on a Removable Storage Device

You can create a snapshot view on a removable storage device to be used when you are disconnected from the network, for example, if you want to use the view to work from home or work while travelling.

To create a view on a removable storage device, you must use the -vws view-storage-pname option to create a view in which the view storage directory location satisfies these criteria:

NOTE: You can create a snapshot view on a removable storage device initially, or create it in permanent storage and move it to a removable storage device later.

Setting the Cache Size

Although both kinds of views use caches, cache size is more significant for a dynamic view than it is for a snapshot view. The dynamic view's cache size determines the number of VOB lookups that can be stored. You can set the size of the cache with the -cachesize option. This creates the following line in the .view file for the view:

-cache size

When a view_server process is started, it uses this value. For more information on the view_server cache and changing its size, see the view_server, setcache, and chview reference pages.

Using Express Builds in Dynamic Views

You can configure a dynamic view to use the express builds feature by creating the view with the -nshareable_dos option. When you invoke clearmake or omake in this kind of view, clearmake or omake builds nonshareable derived objects (DOs). Information about these DOs is not written into the VOB, so the build is faster; however, nonshareable DOs cannot be winked in by other views.

If you do not specify -sha·reable_dos or -nsh·areable_dos, mkview uses the site-wide default set in the ClearCase registry (with the setsite command). If there is no site-wide default, mkview configures the view so that builds in the view create shareable DOs.

To change the DO property for an existing view, use the chview command.

For more information on shareable and nonshareable DOs, see Derived Objects and Configuration Records in Building Software with ClearCase.

Activating a View

Creating a view-tag also executes the startview command, which activates the view on the current host (unless the tag's target network region does not include the local host.) It also places an entry in the host's dynamic-views root directory (by default, M:\). (For example, specifying -tag gamma creates the entry gamma.)

DYNAMIC VIEWS. After a dynamic view is activated, you can assign it to a drive letter with the net use command or by clicking Tools`Map Network Drive in Windows Explorer; it can also be accessed with view-extended naming. (For details, see the startview, view, and pathnames_ccase reference pages.)

SNAPSHOT VIEWS. Snapshot views cannot be explicitly activated and cannot be accessed with view-extended naming. However, a snapshot view becomes active when you change to the view directory and issue a ClearCase command.

Reconfiguring a View

A view's associated view_server process reads a configuration file when it starts up. You can revise this file-for example, to make the view read-only. See the view_server reference page for details.

Backing Up a View

For information about performing view backups, see Administering ClearCase.

If you create a snapshot view in which the view-storage directory is located outside the snapshot view, you must back up recursively both the view storage directory and the snapshot view's root directory.

Deleting a View

The view created by this command is the root of a standard directory tree; but a view must be deleted only with the rmview command, never with del. See the rmview reference page for details.

PERMISSIONS AND LOCKS

Permissions Checking: No special permissions required. Locks: No locks apply.

OPTIONS AND ARGUMENTS

SPECIFYING THE VIEW-TAG.  Default: None.

-tag view-tag

Specifies a name for the view, in the form of a simple file name. This name appears in the local host's file system as a subdirectory of the root directory (by default, M:\). For example, the view experiment appears as M:\experiment.
This view-tag applies only to the local host's network region. If your network has multiple regions, use the mktag command to create an additional view-tag for each additional region.
-tco·mment tag-comment

Adds a comment to the view-tag's entry in the view_tag registry file. Use lsview -long to display the tag comment.

SPECIFYING THE KIND OF VIEW.  Default: Dynamic view.

-sna·pshot

Specifies a snapshot view. See view for a discussion of views and the differences between a snapshot view and a dynamic view.

SPECIFYING THE TEXT MODE.  Default: If a site-wide default is not set, a unix mode view is created; the view does not filter or transform text file line terminators in any way. (In a homogeneous Windows network environment, <CR><LF> line terminators are written to the VOB and returned by the view.)

-tmo·de unix

Same as default.
-tmo·de msdos

Creates an msdos text mode view. The view converts <NL> line terminators to <CR><LF> when reading from a VOB, and it converts <CR><LF> line terminators back to single <NL> characters when writing text files back to a VOB.
NOTE: A view created with -tmode msdos should be used only with VOBs that are running in MS-DOS-enabled mode. The msdostext_mode utility controls a VOB's text mode; see the vob reference page.

SPECIFYING A NETWORK REGION.  Default: Creates the view-tag in the local host's network region, as listed by the hostinfo -long command. See the registry_ccase reference page for a discussion of network regions.

-reg·ion network-region

Creates the view-tag in the specified network region. An error occurs if the region does not already exist.
CAUTION: The view-tag created with mkview must be for the network region to which the view server host belongs. Thus, use this option only when you are logged in to a remote host that is in another region. Moreover, a view-tag for the view's home region must always exist.

CREATING A SNAPSHOT VIEW ON A REMOVABLE STORAGE DEVICEDefault: The view-storage directory is directly under the root directory of the snapshot view.

-vws view-storage-pname

Specifies the location for the view storage directory; this must be a UNC name. If you create a view on a removable storage device, the view storage directory must be in a location that does not move and that remains connected to the network. The argument view-storage-pname must specify a location on a host where ClearCase has been installed; the view database files must physically reside on a ClearCase host, to enable access by the view_server process.

SETTING THE CACHE SIZE. Default: When a view_server process is started, the cache size is set to the value of the site-wide default (set with setcache -view -site); if this default is not set, the cache size is set to 500 KB for a 32-bit platform and 1 MB for a 64-bit platform.

-cac·hesize size

Specifies a size for the view_server cache. size is an integer number of bytes, optionally followed by the letter k to specify kilobytes or m to specify megabytes; for example, 800k or 3m.

SPECIFYING THE KIND OF DOS TO CREATE IN A DYNAMIC VIEW. Default: mkview uses the site-wide default. If a site-wide default is not set, mkview configures the view to create shareable DOs.

-sha·reable_dos

Specifies that DOs created in the dynamic view can be winked in by other views.
-nsh·areable_dos

Specifies that DOs created in the dynamic view cannot be winked in by other views.

SETTING AN INITIAL DEFAULT FOR MODIFICATION TIMESTAMPS FOR A SNAPSHOT VIEW. Default: The initial default for the time stamps of files copied into the view as part of the load or update operation is the current time, that is, the time at which the file is copied into the view. Using the update command, or the GUI update tool, users can change the default time-stamp mode: the most recently used time scheme is retained as part of the view's state and is used as the default behavior for the next update.

-pti·me

Changes the initial default for file time stamps copied into the snapshot view to the time at which the version was created (as recorded in the VOB).

ATTACHING A VIEW TO A STREAM.   Default: None. You must specify a stream selector to create a view for use with a UCM project.

-str·eam stream-selector

Specifies a UCM stream to attach the view attached to.
stream-selector is of the form: [stream:]stream-name[@vob-selector] and vob is the stream's UCM project VOB.

SPECIFYING THE VIEW'S LOCATION.  Default: None. You must specify a location for the view. The host on which the view physically resides is termed the view host. Using the view-storage-dir-pname argument for a dynamic view, or the snapshot-view-pname argument for a snapshot view, mkview heuristically derives the host name, local access path, and global access path information for the view; it stores this information in the network's view registry.

An unusual network topology and/or a nonstandard network interface may defeat the heuristic, preventing access by some or all users. In such cases, set the view's registry information explicitly with the -host, -hpath, and -gpath options.

view-storage-dir-pname (dynamic view) or snapshot-view-pname (snapshot view)

The location at which a new view storage directory is to be created. For a dynamic view, the view-storage-dir-pname argument must be a UNC name. For a snapshot view, the snapshot-view-pname argument must be a UNC name unless you use the -vws view-storage-dir option (See Creating a Snapshot View on a Removable Storage Device). (An error occurs if something already exists at this pathname.) You can create a view storage directory at any location in the file system where Windows security/permissions allow you to create a subdirectory, with these restrictions:

  • You cannot create a view storage directory within a VOB, within another view, or within the root of the view's root directory.
  • The view storage directory must be located on a host where ClearCase has been installed; the view database files must physically reside on a ClearCase host, to enable access by the view_server process.
  • The directory must not be within a Windows special share, such as the share that is designated by driveletter$ and that allows administrators to access the drive over the network.
-hos·t hostname
-hpa·th local-pname
-gpa·th global-pname

These options must appear as a set. Use them only when required to explicitly set a view's registry information. You can use these options when creating a new view, or to update the view registry information for an existing view.
NOTE: When you use one or more of the -host/-hpath/-gpath options in combination with -vws, the values you specify for -host/-hpath/-gpath must correspond to the view-storage directory you specify with -vws. Otherwise, -host/-hpath/-gpath must correspond to the snapshot directory pathname.
You must specify the location of the view storage directory in two ways:

  • Host-local pathname - The name of a host (-host), along with a standard full pathname (-hpath) to the desired storage location that is valid on that host.
  • Global pathname - A standard full pathname (-gpath) to the desired storage location. This pathname must be valid on all hosts on which the view will be accessed, including the host where the view storage directory resides. For example:

\\neon\view_store\view5.vws

EXAMPLES

Examples including wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.

In cleartool single-command mode, cmd-context represents the command interpreter prompt. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt. In Attache, cmd-context represents the workspace prompt.

cmd-context mkview -tag main_r2 \\pluto\c_share\vw_store\winproj\main_r2.vws
Created view.
Host: pluto
Local path: c:\vw_store\winproj\main_r2.vws
Global path: \\pluto\c_share\vw_store\winproj\main_r2.vws
It has the following rights:
User : anne : rwx
Group: dev : rwx
Other: : r-x
cmd-context mkview -tag smg_bigvw -cachesize 1m \\neon\vws\smg_bigvw.vws
Created view.
Host-local path: neon:C:\USERS\vws\smg_bigvw.vws
Global path:      \\neon\vws\smg_bigvw.vws
mkview -stream java_int@/vobs/core_projects -tag java_int
/usr1/views/java_int.vws
Created view.
Host-local path: propane:/usr1/views/java_int.vws
Global path: /net/propane/usr1/views/java_int.vws
It has the following rights:
User : bill : rwx
Group: user : rwx
Other: : r-x
Attached view to stream "java_int".
cmd-context mkview -tag smg_3.2 -snapshot \\pluto\c_share\vw_store\winproj\smg_3.2
Created view.
Host-local path: c:\vw_store\winproj\smg_3.2\view.stg
Global path: \\pluto\c_share\vw_store\winproj\smg_3.2\view.stg
Created snapshot view directory "\\pluto\c_share\vw_store\winproj\smg_3.2".
cmd-context mkview -tag smg_jaz -snapshot
-vws \\pluto\c_share\vw_store\winproj\smg_jaz
E:\views\smg_jaz
Created view.
Host-local path: c:\vw_store\winproj\smg_jaz
Global path: \\pluto\c_share\vw_store\winproj\smg_jaz
Created snapshot view directory "e:\views\smg_jaz".

SEE ALSO

chflevel, chview, endview, lsview, mkstream, mktag, registry_ccase, rmtag, rmview, setcache, setview, startview, unregister, update, view, view_server



Feedback on the documentation in this site? We welcome any comments!
Copyright © 1999 by Rational Software Corporation. All rights reserved.