What is the difference between hco, hsync and hrefresh

Document ID : KB000055416
Last Modified Date : 14/02/2018
Show Technical Document Details

Harvest provides several different ways to keep the repository and the 'real world' synchronized. But which tool should you use and when?

A closer look at the various tools in the toolbox might help to clarify:

hco

The hco command is the command-line equivalent of a checkout via Workbench, HarWeb, the VCI plugin or the Eclipse plugin. It can be used to check out files that will eventually be checked back into the repository, but also to check out files for purposes of synchronizing the computer's hard drive with the updated contents of the repository.

The one thing hco can do that hsync and hrefresh cannot is create empty directory structures. Its main limitation is that it can only checkout one package at a time. If in your repository, your directory structure contains empty directories and you need this exact structure to be maintained on your hard drive, hco is the tool you need to use.

hsync and hrefresh

These commands make up the Reference Directory Synchronization Utility.

  • hsync discovers which files and directories on a remote computer need to be refreshed
  • hrefresh tells hsync when and where.

Together these tools provide the following benefits:

  • Minimizes disk space requirements for read-only source code directories because Harvest supports the active view approach. For more information, see How the Active View Approach Works (AllFusion Harvest Change Manager Administrator's Guide chapter 12).
  • Manages reference directories on multiple operating systems. For example, if you run a Harvest UNIX server and development is on a Windows system, you need to provide the developers a location to read the source code that is managed by Harvest for local work such as unit compiles.
  • Allows development teams in different geographical locations to have a synchronized copy of the shared source code managed through the Harvest reference directories. This synchronization is extremely useful for common libraries and reusable code.

The hsync command uses a single package or a list of multiple packages to update a file system directory (reference directory) so that it reflects the contents of a Harvest view path. hsync checks out the latest versions of items in the Harvest view and deletes files in the reference directory that no longer belong.

hrefresh works with hsync to synchronize a file system directory with the contents of a path in a Harvest view (working or snapshot). hrefresh is executed by server UDPs that may be post-linked to any Harvest process that updates the contents of data views, such as promote and demote processes. The post-link command provides hrefresh with the project, state, and package context information. hrefresh uses this information to determine which reference directories should be refreshed for that particular transaction. hrefresh then performs the necessary check-outs to synchronize the files on servers that are defined as reference computers.

Other Relevant Information

Details on syntax and usage, as well as examples for all three commands can be found in AllFusion Harvest Change Manager Reference Guide. Detailed information about the Reference Directory Synchronization Utility can be found in Chapter 12 of the AllFusion Harvest Change Manager Administrator's Guide.