3

I'm writing a script to automate some merge operations and I'd like to do it using this command:

cleartool findmerge file_name -fver /main/branch_name/LATEST -merge -log NUL -c "Automatic merge"

The thing is, sometimes I get this message and I have to press enter to continue the process:

Needs Merge "file_path" [to _branch_ from _another_branch_ base _yet_another_branch_]

Any way to avoid this?

epzee
  • 568
  • 8
  • 22

1 Answers1

4

The problem with findmerge, as this technote describes, is that it can report back inconsistent "Needs Merge" depending on the location of merge hyperlinks.

And that isn't likely to be fixed anytime soon:

This requires significant architectural change and will not be addressed in the next 18 months.
Please work with Rational Customer Support to learn UCM best practices to get around this is the limitation.

I haven't found an easy solution:

I usually findmerge on directory first (-type d), which don't have that extra message issue.
Then if all the directories are merges, I go on on files, with -merge -abort (to stop at the first conflict): since your merge shouldn't have any conflict in the first place, that mode (-merge -abort) is less likely to report the "Needs merge" message.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • ok, so I'll need to do it with another command. What about merge? Do you know if it requires user interaction? thank you! – epzee Apr 13 '11 at 20:26
  • 1
    @epzee: `merge` can work... provided you know what file or directory to merge. This isn't a recursive command (that why `findmerge -merge` exists in the first place actually!) – VonC Apr 13 '11 at 20:36
  • Yes, the script's input is a list of files ready to merge. Do you think the merge command will do ok? Do you recommend any argument for this particular case? Also, any special consideration I should take? Thanks a lot Von, this is really really helpful! – epzee Apr 14 '11 at 02:35
  • 1
    @epzee: the special consideration to take into account is to make sure directories are merged first, which means the list of files is accurate. Then merge each file one by one. If that list were to contain directories, always merge directories first. – VonC Apr 14 '11 at 03:52
  • Just letting you know that, at least on Windows 7 with ClearCase 8, the -abort option to cleartool findmerge does nothing at all. :-( Regardless of whether -abort is specified, if there's a non-trivial merge, cleartool will still open the graphic merge tool. I had to resort to calling findmerge 3 times. First perform directory merges, then find but do not perform all other merges, then analyze the output, and then call it a third time only if all merges contained the sub string *(automatic)*. And lately I found out that even the *(automatic)* part is not reliable ... (continued in next post) – antred Dec 21 '15 at 14:59
  • @antred Really strange... did you open a PMR to IBM support to report this issue? – VonC Dec 21 '15 at 15:00
  • (continuation of previous comment) ... as in some cases cleartool, even though it did make the *(automatic)* printout, proceeded to open the graphic merge tool, only to then find that the graphic merge tool could resolve the merge all by itself but still required user input to click to Ok button to close the tool, which of course will trip up a scripted approach that has to run without user intervention. Ah ClearCase, I swear it'll make me lose my mind eventually. – antred Dec 21 '15 at 15:05
  • @vonC I did not. The way I see it, ClearCase has so many open issues, some of which have been known since 2004 or even longer, that it's pretty clear that IBM won't expend much effort on fixing this kind of stuff anyway. Given how few users of ClearCase remain, I'm not sure if you can blame them ... then again, they sure take enough money out of their customers' pockets to warrant a little more effort. – antred Mar 10 '16 at 16:19