How do I search for specific kinds of merge hyperlinks in clearcase?

南楼画角 提交于 2021-02-08 03:37:27

问题


Background

I have recently created an erroneous merge hyperlink in clear case. This was the result of a script that automerged several files. Given that a script created the erroneous merge, I am trying to search for other instances of erroneous merge arrows. Below are the constraints I want to put in my search:

  1. All merge hyperlinks created by me.
  2. On a specific date

This question talks about finding a merge hyperlink in one file. However, I am looking for a set of merge hyperlinks that I created.

What I know

I know that you can describe hyperlinks as shown below:

Describe a hyperlink.

cmd-context describe hlink:Merge@516262@/vobs_proj 
hyperlink "Merge@516262@/vobs_proj"
 created 2006-07-14T16:43:35 by Bill Bo (bill.user@uranus)
 Merge@516262@/vobs_proj /vobs_proj/lib/cvt/cvt_cmd.c@@/main/v1.1_port/8 ->
 /vobs_proj/lib/cvt/cvt_cmd.c@@/main/71

But I am looking for how to query for the "created..." field from a set of merge hyperlinks.

Question

How do I query for merge hyperlinks that I created at a specific time?


回答1:


Consider cleartool find to try and link those hlink

cleartool find . -kind hlink -user <myLogin>

Then try and combine the find with an exec cleartool describe $CLEARCASE_PN, maybe adding queries (as described in the query_language)

If not query is working, at least you could then grep the output for:

  • your Login
  • excluding (grep -v) dates which are too old.

Brian Cowan adds in the comments:

I've found that you can use this to get the hlink names, but you have to use $CLEARCASE_PN.

Parsing it is non-trivial because the "hlink" formatting property apparently doesn't work.

You would have to:

  1. Filter the output by date (cleartool desc -fmt "%d %Xn\n" $CLEARCASE_PN)
  2. Describe each desired link and grep for "->"
    That'll get you the hyperlink source and destination.
  3. rmver -xhlink would let you remove the merge-created versions



回答2:


If this was recent enough, you should be able to use cleartool lshistory -minor I just created a merge hyperlink, and lshist -min -rec on the root of the VOB showed me this.

--09-12T15:57 Brianc make hyperlink "Merge" on version "Documents\libatriadb_ldb.txt@@\main\testbr\1" "Attached hyperlink "Merge@504@\foobarf"." --09-12T15:57 Brianc make hyperlink "Merge" on version "Documents\libatriadb_ldb.txt@@\main\CHECKEDOUT" "Attached hyperlink "Merge@504@\foobarf"."

A little work with the -fmt option and you may be able to get this formatted how you need it.



来源:https://stackoverflow.com/questions/57911088/how-do-i-search-for-specific-kinds-of-merge-hyperlinks-in-clearcase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!