cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Is there a CLI command that checks whether a member is merged to a given branch ?

hmagnanao
1-Newbie

Is there a CLI command that checks whether a member is merged to a given branch ?

would like to write a powershell script. If I give it a target branch, it should tell me if any members are not merged to that branch.  Is this possible ?

8 REPLIES 8

I keep thinking that it should be possible to create a query for this.  The query would cover the following data (but don't know how to get to the data yet).

It would look for all change packages in a project without a propagated by value and a member rev timestamp > X where X is the last timestamp for when a merge was performed.

KaelLizak
14-Alexandrite
(To:hmagnanao)

Hello Hector,

Just to make sure I understand this:

Given a branch B, you want a command that tells you if any members are not merged to B compared to a target branch of B?

So in a situation where you have something like this:

Mainline M: 1.1 .. 1.10

Branch B: 1.3.1.1 .. 1.3.1.8

Branch C: 1.4.1.1 .. 1.4.1.9

Branch 😧 1.3.1.5.1.1 .. 1.3.1.5.1.7

If you run your script targeting B, does it tell you which members on D (a sub-branch of B) don't exist in B, or which members on the mainline M are not on B, or both?

What about for a different branch C?

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

Hi Kael,

I want to give the script two parameters.  From release and To Release.  So if my from release is A, and my to release is B, if I run the script, it should give all members that were not merged into B. Also it should tell me if they were not merged correctly to B.

Thanks,

Hector

KaelLizak
14-Alexandrite
(To:hmagnanao)

Hi Hector,

So any members of A which are not members of B get listed, but not members of B which are not members of A.  What happens if a member was merged, but subsequently dropped on B?  Is there an expectation that the script goes and looks at the historical state of the project?  What happens if two members have the same name, but are actually not the same?

What do you mean be "a member of A was not merged correctly to B"?  Obviously you don't just mean "not merged at all", because that's caught by your first condition.  If you're asking if you could ensure that every member of A has a revision which matches a revision of the member of the same name in B, with a large and active project your script could take quite a while, be intensive on the server, and potentially the bulk data cache.

I'll have to investigate more, but after looking at the CLI documentation quickly, I think the command you want to do the actual comparison is si diff.  From the command line, the si diff command diffs all members on a project.  You'll want to specify -r twice to specify which revisions to compare in a project.  See the documentation on si diff for more information.

The command to see the members in a project is si viewproject with --projectRevision either --devpath to specify the relevant devpath/checkpoint.  You'll need to do that once for each devpath to do your comparison of members, and you might need to do that recursively (-R) if you're also concerned about subprojects.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

Hi Kael,

Our script will handle adding members in A which are not in B.  I'm asking about existing members in A and B.  If a member in A is not merged to B, then yes it should be listed which means it was merged or propagated.  And no there is no backward merges involved.  As far as having two members with the same name but are not actually the same, we can ignore those cases. Those will be investigated manually.

What I mean "when A is not merged correctly to B"  is when it looks like it got merged but there were no differences. I don't know if that's possible.  But cases like that will have to be diff'd manually through the client to see what happened.  But I'm asking if there is a command line to weed those types of incorrect merges and list them out.

Thanks,

KaelLizak
14-Alexandrite
(To:hmagnanao)

Hello Hector,

There is no out-of-the-box command that will do this.  Implementing most of what you are asking for should be possible with scripting or the use of the API.

Regards,
Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

Hi Kael,

Are you saying there is no way to check whether each member in a change package is merged to specific branch ?  I can check each change package whether it is propagated to the next branch but I need a way to check whether each member in a given change package is merged to a specific branch.  For example,  I have a change package that has 3 members.  If 2 out of the 3 members are merged, then that change package has been propagated and my script would tell me that change package is merged but in fact, it is not all all merged. Because there is a 3 member in that change package that is not merge.  So I'm asking if there is a command line ( I am scripting this and I don't want to use the API), that will show that member was not in fact merged.

If there is no way to check this,  then I would like to suggest this as an enhancement to the tool.  This is a valuable and necessary enhancement to be able to audit merges.

Thanks,

KaelLizak
14-Alexandrite
(To:hmagnanao)

Hello Hector Magnanao‌,

What I'm saying is what you really want is either RFC 101307 and especially RFC 376268.  Please open cases with PTC Integrity Lifecycle Management Support‌ for these two enhancements.

Regard,

Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
Top Tags