Jump to content


Search for the revision the branch is based on

java branch

  • Please log in to reply
1 reply to this topic

#1 rola

rola

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 21 September 2020 - 02:06 PM

So far I still found out everything myself, but I can't get any further with my current problem.

When I create a new branch via "Branch Files ..." I specify a branch mapping and via "Filter" a changelist or label or a date on which the branch should be created.

But now I want to be able to use the (Java) SDK to find out on which basis (Changelistnumber / Label name / Date) the Branch was created.

The only thing I found is the information with IBranchSpec, but it only contains the name, creator, description and viewmapping of the branch but not the information I need.
Is there a way to get this information using the Java Api?

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 23 September 2020 - 08:11 PM

The exact revision specifier used to branch the files isn't stored in the changelist; each individual file tracks the revision it was branched from, so you can sort of reverse-engineer a changelist out of all those records by doing something like "p4 changes -m2 -i @=CHANGE" where CHANGE is the changelist that branched all the files.  The Java API should have some sort of "get changelists" function that mimics that command, although I'm not sure if the exact syntax for it.





Also tagged with one or more of these keywords: java, branch

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users