Skip to main content
1-Visitor
September 9, 2015
Question

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

  • September 9, 2015
  • 2 replies
  • 3950 views

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 ?

    2 replies

    1-Visitor
    September 12, 2015

    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.

    16-Pearl
    September 17, 2015

    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

    hmagnanao1-VisitorAuthor
    1-Visitor
    September 22, 2015

    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

    16-Pearl
    September 23, 2015

    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