title: cleartool findmerge and label
body: <p>I am attempting to write a script for Base ClearCase that will find all the files on a given branch and label, and perform a trivial merge of those files to another branch, and then label the newly merged files with a different label.</p>
  
  <p>For example, given files on branch <code>\main\Proj\Proj_INT1</code> and labeled <code>Ver4</code>, I want to merge the files to the <code>\main\Proj</code> branch and label them with <code>Ver4X</code> (iff they are in need of merging).</p>
  
  <p>I know that I can use <code>-fver "\main\Proj\Proj_INT1\Ver4"</code> to find the versions of files I want to merge, but I am not sure how to combine the merge with applying the label.</p>
  
  <p>From the documentation, it does not look possible to do a <code>cleartool findmerge ... -merge -exec "cleartool mklabel ..."</code>, so I am currently attempting to a <code>cleartool findmerge ... -log &lt;out_file.log&gt; -print</code>, and then parse the resulting log to get all the file versions.  However, given that the <code>findmerge</code> command stops at directories, I would need to repeat this operation multiple times until all directories and files are merged (a bit of a headache to try to script and parse cleartool output).</p>
  
  <p><strong>Is there an idiomatic or simple way to perform a merge and then label the files?</strong>  Perhaps I can perform the merge and have cleartool generate a log which shows what the versions for merged files (so I can then label)?</p>
  
  <p>Additionally, if I perform a <code>cleartool findmerge ... -merge</code> operation, <strong>how does it handle non-trivial merges?</strong>  I am not expecting any non-trivial merges, but I would like to skip with an error or stop the merge entirely if a non-trivial merge is encountered.</p>