4. Techniques for Sharing Workspaces

4. Techniques for Sharing
Workspaces
This note describes two techniques for accessing the same workspace from multiple machines.
Accessing a Windows Workspace From Multiple Windows Clients
Multiple AccuRev users, on Windows client machines, can share a workspace that is physically located on a Windows machine. (Or maybe there’s just one user, who wants to access a workspace from multiple Windows client machines.)
1.
Designate a directory that is above the top-level directory of the workspace tree as a Windows “shared directory”. For example, if the workspace tree for workspace widget_maint_derek on machine derekpc is located at C:\widget\workspaces\maintdrp, you could set the shared directory as follows:
net share widgwork=C:\widget\workspaces
Note: The workspace tree’s top-level directory itself (maintdrp in the example above) cannot be designated as the shared directory.
2.
Determine how AccuRev records the workspace tree location, using the command accurev show wspaces. (The pathname will always use forward slashes, even if it’s a Windows pathname.)
widget_maint_derek /widgwork/maintdrp derekpc ...
... skip to Step 3.
widget_maint_derek C:/widget/workspaces/maintdrp derekpc ...
... you must use the chws command to change the recorded location to a pathname that incorporates the share name. This involves mapping a network drive to the shared directory:
> net use K: \\derekpc\widgwork
The command completed successfully.

> K:

> cd \maintdrp

> accurev chws -w widget_maint_derek -l . (“dash-ell dot”)
Changed location.
Changed machine name.

> accurev show wspaces
...
widget_maint_derek /widgwork/maintdrp derekpc ...
3.
> net use P: \\derekpc\widgwork
The command completed successfully.

> P:

> cd \maintdrp

> accurev info
...
Workspace/ref: widget_maint_derek
Basis: widget_maint
Top: P:/maintdrp
Users on different machines can map the shared directory to different drive letters, and access the workspace as, for example, Y:\maintdrp or R:\maintdrp.
Universal Access to a Workspace Located on a Share
A workspace whose workspace tree is network-accessible through a share, can be accessed from any client machine — running UNIX/Linux or Windows. The share can be configured through Samba/SMB or some other network file system. It must make the actual storage location available through a machine name and a simple “share name”: a name that looks like a single pathname component.
The ‘share_map.txt’ File
The technique in Accessing a Windows Workspace From Multiple Windows Clients on page 15 relies only on Windows operating system facilities. But the “universal workspace access” technique requires the maintaining of a pathname-mapping file for use by the AccuRev Server. If a “share” (that is, shared directory) has an entry in the pathname-mapping file, any workspace located on that share can be used on all AccuRev client machines capable of accessing the machine where the share resides.
The pathname-mapping file is a text file, share_map.txt, which must be located in the AccuRev site_slice directory on the AccuRev Server machine. It maps share names to absolute pathnames. Each line of share_map.txt consists of three TAB-separated fields, describing one share. For example:
jupiter accwks /public05/accurev_workspaces
This entry says, “a share named accwks is physically located on machine jupiter, at absolute pathname /public05/accurev_workspaces”. More generally:
The first field (jupiter) names a machine where one or more workspace trees are (or will be) located.
The second field (accwks) specifies the share name.
The third field (/public05/accurev_workspaces) indicates the absolute pathname of the share on the machine. On a Windows machine, this includes the drive letter — for example, C:/Public Directories/AccuRev Workspaces.
Notes:
All pathnames in share_map.txt must use forward-slash characters ( / ), even Windows pathnames.
The field separator in the share_map.txt file must be single TAB character — don’t use SPACEs. If a specification (e.g. a share name) includes a SPACE character, do not enclose the specification in quotes.
Workspace Location Entries
The accurev show wspaces (or the GUI’s View > Workspaces) command displays the locations of existing workspaces in the repository. The pathnames always use forward slashes, even if they are Windows pathnames.
AccuRev can record the location as an absolute pathname on its machine:
C:/wks/light24/mnt_john (Windows)
/bigdisk/home/john/widget_devel (UNIX/Linux)
Alternatively, it can record a location that incorporates a share name:
/accwks/wks_john (Windows or UNIX/Linux)
Universal workspace access requires that a workspace’s location be recorded as an absolute pathname in the workspaces table. (Note that the sharing technique described in Accessing a Windows Workspace From Multiple Windows Clients on page 15 has the opposite requirement: workspace locations must incorporate the share name.) In addition, the “Host” name listed in this table for a workspace must exactly match the first field in some share_map.txt entry. Beware of domain name discrepancies — for example, jupiter vs. jupiter.mycorp.com.
Fixing Workspace Location Entries
If a workspace located on a share has the “wrong kind” of entry in the workspaces table, fix it to enable universal client access:
1.
Make sure that share_map.txt has a valid entry for the share.
2.
3.
Use the chws command to change the location recorded in the workspaces table to an absolute pathname:
> accurev chws -w <workspace-name> -l . (“dash-ell dot”)
You must fix each workspace location entry in this way individually.
Fixing Machine Name Entries
If there’s a discrepancy between a machine’s name in a share_map.txt entry (say, jupiter) and its name in the workspaces table (say, jupiter.mycorp.com), change the workspace table entry:
accurev chws -w <workspace-name> -m jupiter
Example: Samba Share
Here’s an example of how it can all work in a Samba environment, elaborating on the scenario above:
1.
The organization decides that a directory, /public05/accurev_workspaces, on UNIX host jupiter will be a location where users can create workspaces that can be shared across platforms.
2.
The system administrator on jupiter turns that directory into a Samba share, named accwks. Here’s the relevant excerpt from the Samba smb.conf file on host jupiter:
[accwks]
comment = All users
path = /public05/accurev_workspaces
browseable = yes
guest ok = yes
writeable = yes
3.
The AccuRev administrator makes this entry in the share_map.txt file, in the AccuRev Server’s site_slice directory.
jupiter accwks /public05/accurev_workspaces
4.
User john, working on a Windows machine, wants to creates a workspace on the share. First, he makes the share accessible as a network drive:
net use T: \\jupiter\accwks
5.
Then john creates his workspace on this network drive:
accurev mkws -w shrwks_john -b dvt_stream -l T:\wks_john
A show wspaces command indicates that the AccuRev Server uses an absolute pathname to record the new workspace’s location on jupiter:
shrwks_john /public05/accurev_workspaces/wks_john jupiter ...
6.
john can now use this workspace from any client machine that can access the machine where the share resides.

Borland