Search code examples
mergeclearcase

How to I check if a file is not merged in Clearcase?


Background

How do you check for a merge in Clearcase? talked about method to figure out if a clearcase file is merged with the lsvtree method. However, if one wants to check for its opposite, you can only do this directly through graphical means. if you enter ct lsvtree -nmerge in command line, the following error is returned:

cleartool: Error: Some options are not applicable to non-graphical mode.
Usage: lsvtree -graphical [-all] [-nmerge] [-nco]
               [-options pass-through-opts] pname ...
       lsvtree [-nrecurse] [-short] [-all] [-merge] [-nco] [-obsolete]
               [-branch branch-pname] pname ...

The error implies my assertion above.

Question

What is the quickest non-graphical way to see if a clearcase file does not have a merge hyperlink?


Solution

  • The cleartool describe command should include, as shown in "Find merge arrows pointing to a version in ClearCase" a:

    Hyperlinks:
      Merge <- filename@@/main/other_branch/2
    

    That is the approach you started to implement in your other question.

    For a single file:

    cleartool describe aFile | | grep -e "Merge <-"`
    

    I mentioned in 2013 another approach in "Find merge arrows pointing to a version in ClearCase"

    cleartool descr -ahlink aFile
    # or
    cleartool descr -fmt "%[hlink:filter]p" aFile