View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
David Boyce > ClearCase-SyncTree-0.60 > ClearCase::SyncTree



Annotate this POD


New  3
Open  0
View/Report Bugs
Module Version: 0.60   Source  


ClearCase::SyncTree - Synchronize a tree of files with a tree of elements


    # Create a 'synctree' object.
    my $sync = ClearCase::SyncTree->new;
    # Tell it where the files are coming from ...
    # Tell it where they're going to ...
    # Supply the list of files to work on (relative or absolute paths).
    $sync->srclist(keys %files);
    # Compare src and dest lists and figure out what to do.
    # Create new elements in the target area.
    # Update existing files which differ between src and dest.
    # Remove any files from dest that aren't in src.
    # Check in the changes.

See the enclosed synctree script for full example usage.


This module provides an infrastructure for programs which want to synchronize a set of files, typically a subtree, with a similar destination subtree in VOB space. The enclosed synctree script is an example of such a program.

The source area may be in a VOB or may be a regular filesystem; the destination area must be in a VOB. Methods are supplied for adding, subtracting, and modifying destination files so as to make that area look identical to the source.

Symbolic links are supported, even on Windows (of course in this case the source filesystem must support them, which is only likely in the event of an MVFS->MVFS transfer). Note that the text of the link is transported verbatim from source area to dest area; thus relative symlinks may no longer resolve in the destination.


Use ClearCase::SyncTree->new to construct a SyncTree object, which can then be filled in and used via the instance methods below.


Following is a brief description of each supported method. Examples are given for all methods that take parameters; if no example is given usage may be assumed to look like:


Support for the BranchOff feature.

BranchOff is a feature you can set up via an attribute in your config spec. The rationale and the design are documented in:

Instead of branching off the selected version, the strategy is to branch off the root of the version tree, copy-merging there from the former.

This allows to avoid both merging back to /main or to a delivery branch, and cascadig branches indefinitely. The logical version tree is restituted by navigating the merge arrows, to find all the direct or indirect contributors.

See also ClearCase::Wrapper::MGi on CPAN.

Support for incremental label families

ClearCase::Wrapper::MGi supports managing families of incremental fixed label types, as lists, linked with hyperlinks. The top of a list is accessible as the equivalent fixed label type of a floating label type, which has a stable name. This allows to move the floating labels, and keep track of their successive positions with sparse fixed labels.

ClearCase::SyncTree follows this strategy if the label type provided has an EqInc hyperlink.

Using an incremental type with the label method, label_mods is implicit (and ignored).

Support for Cygwin

VOB paths show under Cygwin with forward slashes as separators. UNC paths start with //, and drives are presented with a /cygdrive/ prefix. Cygwin also offers a mount tool, allowing the user to mount her views under /view, to match the UNIX convention.

The support for Cygwin normalizes the paths on the UNC syntax.


Following items are from Uwe Nagler of Lucent, unverified:


Based on code originally written by Paul D. Smith <>. Paul's version was based on the Bourne shell script 'citree' delivered as sample code with ClearCase.

Rewritten for Unix/Win32 portability by David Boyce in 8/1999, then reorganized into a module in 1/2000. This module no longer bears the slightest resemblance to any version of citree.

Support for 2 features compatible with ClearCase::Wrapper::MGi (branching off the root of the version tree--usually, /main/0, and applying incremental labels), as well as for cygwin, added by Marc Girod.


Copyright 1997,1998 Paul D. Smith and Bay Networks, Inc.

Copyright 1999-2010 David Boyce (dsbperl AT

This script is distributed under the terms of the GNU General Public License. You can get a copy via or its many mirrors. This script comes with NO WARRANTY whatsoever, not even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


SyncTree is currently ALPHA code and thus I reserve the right to change the API incompatibly. At some point I'll bump the version suitably and remove this warning, which will constitute an (almost) ironclad promise to leave the interface alone.


This module is known to work on Solaris 2.6-10 and Windows NT 4.0SP3-5 to Vista SP2, and with perl 5.004_04 to 5.10. As these platforms cover a fairly wide range there should be no major portability issues, but please send bug reports or patches to the address above.


perl(1), synctree(1), ClearCase::Argv(3), Getopt::Long(3), IPC::ChildSafe(3)

syntax highlighting: