How to check in without first checking out
search cancel

How to check in without first checking out

book

Article ID: 10179

calendar_today

Updated On:

Products

CA Harvest Software Change Manager - OpenMake Meister

Issue/Introduction

You may have situations where users want to simply edit their local files and upload them to the SCM repository without first checking them out. A special type of Harvest SCM Check In process can be configured to do this.



Environment

Release: 12.5 and up
Component: CA Harvest Software Change Manager

Resolution

A special type of Harvest SCM Check-In process can be configured to accomplish this.

Here’s how it would work: First, update the file(s) you want to check in using Windows Explorer and your preferred editor.



After you have saved and closed the file, open the SCM Workbench and log in to your SCM broker. Navigate to the project and state to be used for check-in. Expand the folders under the data view for the state to locate the folder to be used for check-in. Right-click on the folder name and select the new Check-In process name (in this example, the name of the new Check-In process is “SyncFromLocal”).

On the Check-In window, select the Mode, Package, From folder name, To folder name, and click the green Plus (+) icon next to the list box below:



Use the Find File dialog to search for and select the file(s) to be checked in, then click “OK”:



When all the details for your Check In process are set, click OK to complete the check-in:



The Output Log will show that the check in was successful or report any errors encountered, and the file that was checked in will have a new version number

Your check-in is now complete.

Caution: You should always look in Workbench to confirm that the file you checked in was saved to the correct folder. One of the advantages of checking out the file before making updates is that Harvest will automatically know where to place the new version when checking in. If you use this method for checking in and selecting the wrong folder, you will get version 0 of the file in a different folder location rather than an updated version where you are expecting to find it. If you find that this has happened, simply delete the version 0 of your file that was checked into the wrong location and try your check in again.

This new type of Check In process works by using the following steps:

  1. Perform a Check Out in “Reserve Only” mode for the selected viewpath to recursively put “R” tags on all items in the viewpath. This is done as a pre-link UDP.
  2. Check-in the selected files in “Update and Keep” mode from the local computer (or any mapped network drive) to the selected view path using the selected package. We use “Update and Keep” mode to preserve each file’s read/write attribute setting on the local computer. (“Update and Release” would set all the selected files on the local computer to “Read Only” mode)
  3. Perform a Check-In in “Release Only” mode to remove the “R” tags from all files in the selected viewpath. This is done as a post-link UDP.


Here is how to configure the new Check In process

In the SCM Administrator Tool, navigate to the project and state, right-click on “Processes,” and select “New” -> “CheckIn Process.”

On the “Check In” tab, select your preferred options

On the “Default” tab make sure to select the “Update and keep” mode

On the “Access” tab, select the user group(s) who will have permission to execute this process

On the “Pre-Linked” tab, define your Pre-Linked UDP. Click the “New” button:

Select “UDP” as the process type and click “OK”

On the UDP Properties window, provide a name for your new UDP process and the following line in the “Program” field:

hco -b [broker] -en "[project]" -st "[state]" -p ["package"] -ro -vp "[viewpath]" -s "*" -usr [user] -pw [password]

Make sure “Type” is set to “Server” and uncheck the “Allow Additional Parameters” checkbox. When all settings are complete, click “OK.”

On the “Post-Linked” tab, define your Post-Linked UDP. Click the “New” button:

Select “UDP” as the process type and click “OK”

On the UDP Properties page provide a name for your new UDP process and the following line in the “Program” field:

hci -b "[broker]" -en "[project]" -st "[state]" -p ["package"] -vp "[viewpath]" -ro -usr [user] -pw [password]

Make sure “Type” is set to “Server” and uncheck the “Allow Additional Parameters” checkbox. When all settings are complete, click “OK.”

When all settings for your new Check-In process are complete, click “OK.”

And now your project and state have a process that can be used to check in files without first checking them out.

Notes:

  • You can read more about defining a Check-In process in the Administrator Guide, Define a Check-In Process.
  • You can read more about using the Workbench Check-In process in the Workbench User Guide, Use Check-in and Check-Out In CA Harvest SCM
  • You can read more about the “hci” and “hco” command line utilities in the Command Line Reference Guide
  • The Pre-Link and Post-Link UDPs use system variables to pass details to the command, such as broker name, project, state, package, etc. You can read more about how to use the Harvest System Variables in the Administrator Guide, Use the System Variables.
  • The example hci and hco commands use the [user] and [password] system variables to pass the login credentials of the user currently logged into Workbench to the command. By default, Harvest is configured not to allow the use of the [password] system variable. To change the default setting so that the [password] system variable can be used, you will need to execute a SQL script. In your %CA_SCM_HOME%\Database folder ($CA_SCM_HOME/Database on Linux and Unix) there are 2 scripts. “EnableSysVarPw.sql” is configured to execute on an Oracle database and “EnableSysVarPw_sqlserver.sql” is configured to execute on a SQL Server database.

The command to execute this script for Oracle is

[windows] : sqlplus userid/password@service @"%CA_SCM_HOME%\Database\EnableSysVarPw.sql"

[unix/linux] : sqlplus userid/password@service @"$CA_SCM_HOME/Database/EnableSysVarPw.sql"

where :
userid = SCM database schema owner userid
password = SCM database schema owner password
service = tns service name from tnsnames.ora file

The command to execute this script for SQL Server is

sqlcmd -S server -d database -U userid -P password -i "%CA_SCM_HOME%\Database\EnableSysVarPw_sqlserver.sql"

where:
server = SQL Server’s server name
database = SCM database name in SQL Server
userid = SCM database owner userid
password = SCM database owner password

After making this change, you will need to restart your Harvest SCM Broker.

  • After you have defined this new Check In process in the Administrator Tool it can also be used from the command line “hci” utility (the -pn option), from Windows Shell Extensions, and from Harweb. The Workbench Workarea and the Eclipse and Visual Studio plugins have other methods for updating and checking in a file without first checking it out, so this should not be needed in those environments. The previously mentioned caution applies here as well. After using this process, the user should look at the output log or look in Workbench to confirm that the file was saved to the correct folder.

Additional Information

This article is offered as one possible way of accomplishing the requested task.  Broadcom Support cannot offer enhancements or support for this suggested procedure aside from answering questions as to how it works.  Please use this idea as a starting point from which to build your own process.