StarTeam to SVN conversion SvnException: Unknown branch

dsilk
Posts: 1
Joined: Mon Aug 22, 2011 9:18 pm

StarTeam to SVN conversion SvnException: Unknown branch

Postby dsilk » Mon Aug 22, 2011 9:43 pm

I am running a conversion from StarTeam to Subversion and trying to get the tags/branches to port over, but I keep getting this error during the migration:

19:22:50,399 [main] INFO historyLogger:84 - EXCEPTION CAUGHT: org.polarion.svnimporter.svnprovider.SvnException: Unknown branch: VCC
at org.polarion.svnimporter.svnprovider.SvnModel.getBranch(SvnModel.java:209)
at org.polarion.svnimporter.svnprovider.SvnModel.addFileCopyToTag(SvnModel.java:336)
at org.polarion.svnimporter.stprovider.internal.STTransform.transformCommit(STTransform.java:139)
at org.polarion.svnimporter.stprovider.internal.STTransform.transform(STTransform.java:86)
at org.polarion.svnimporter.stprovider.STProvider.buildSvnModel(STProvider.java:128)
at org.polarion.svnimporter.main.Main.buildFullSvnModel(Main.java:147)
at org.polarion.svnimporter.main.Main.run(Main.java:82)
at org.polarion.svnimporter.main.Main.main(Main.java:49)

I checked out the latest svnimporter code from the SVN trunk and that is the version I am using. (1.1 M8) I noticed that the download version is 1.2, so I am wondering if the latest changes are not committed?

Also, it looks like in the code it is looking for a branch object, but I have not been able to figure out where/when that is supposed to be initialized. I see this error has come up with other SCM systems, does anyone know of a valid fix?

any response would be greatly appreciated!

Thanks,
Dave Silk, Verisign

NickEntin
Posts: 472
Joined: Tue Oct 24, 2006 10:27 am
Location: Polarion Software GmbH, Stuttgart
Contact:

Re: StarTeam to SVN conversion SvnException: Unknown branch

Postby NickEntin » Tue Aug 23, 2011 10:22 am

Hi David,

if you're looking for sources - there is another branch for some recent improvements.
My involved colleagues may point more exactly where it is, but I think you can easily find it in SVN.

Best regards,
Nick

kencorbin
Posts: 197
Joined: Fri Nov 16, 2007 10:30 pm
Location: Corvallis, OR

Re: StarTeam to SVN conversion SvnException: Unknown branch

Postby kencorbin » Wed Sep 21, 2011 9:20 pm

The correct source code for all importer versions other than VSS can be found in the increasingly missnamed Improved_MKS_Branch. Someday I should move that back to the main trunk.

The specific problem is that some file revision on a source branch was being added to some tag record *BEFORE* the branch was created. It would take a detailed analysis of the log file to figure out just how this happened to be.

It is known that the StarTeam import has problems with branches and tags. Dropping back to a trunk only migration will probably make the problem go away. If nothing else, you should probably try that as a diagnostic measure to confirm that the problem is with the branch and tag migration logic.

If you still have problems, it won't be quite the same problem, but it may well be something else, when doing a trunk only migration, this might be the dreaded out of sequence revision problem. We have encountered and fixed this with the MKS and PVCS migrations. No one has fingered it as a problem with Starteam migrations, but that doesn't mean it couldn't happen. Basically, the problem pops up any time revision in the source RCS system show up with revision dates that our out of sequence in some way. Say a 1.2 revision of a file has a change date earlier than than the 1.1 revision. The importer sorts changes by revision date and ends up trying to modify the 1.2 version before the 1.1 version was created.

There are ways this can happen that are perfectly legitimate, if rather obscure. We see it when your source repository users insist on using some unusual maintenance procedures supported by the repository.

The good news, if this turns out to be your problem, is that it is easily fixed. The logic to check for and correct revisions sequencing errors has been moved to a common location where any of the migration providers can use it. We didn't add it to migration providers that hadn't reported problems because we had no one to test them and were reluctant to add logic with an even slight chance of breaking something we had no ability to test. We could easily add it to Starteam provider if you determine that you need it.

Good luck,
-Ken

plambrechtsen
Posts: 4
Joined: Wed Feb 01, 2012 11:53 pm

Re: StarTeam to SVN conversion SvnException: Unknown branch

Postby plambrechtsen » Thu Feb 02, 2012 12:01 am

I've just had the same problem with Starteam converting to SVN.

Looking through the Improved_MKS_Support it seems that the branch doesn't get created.

If I checked line 118 of Improved_MKS_Support\org.polarion.svnimporter.stprovider\src\org\polarion\svnimporter\stprovider\internal\STTransform.java there is a check for labels and isTrunk:

if (!isOnlyTrunk() && !isIgnoreLabels()) {

So if I add in to exclude Labels as well:

# can be set to completely skip lables
st.ignorelables=yes

Then it works a treat :)

The dump from the log looks like:

12:20:12,522 [main] INFO STProvider:84 - StarTeam model has been created.
12:20:12,522 [main] INFO Model:84 - Summary:
12:20:12,522 [main] INFO Model:84 - Files: 15
12:20:12,522 [main] INFO Model:84 - Revisions: 21
12:20:12,522 [main] INFO Model:84 - Commits: 15
12:20:12,553 [main] DEBUG SvnModel:80 - create new revision 1
12:20:12,553 [main] DEBUG SvnModel:80 - add action: [add dir] trunk
12:20:12,553 [main] DEBUG SvnModel:80 - add action: [add dir] branches
12:20:12,553 [main] DEBUG SvnModel:80 - add action: [add dir] tags
12:20:12,553 [main] DEBUG SvnModel:80 - create new revision 2
12:20:12,553 [main] DEBUG SvnModel:80 - add action: [add dir] trunk/Code
12:20:12,553 [main] DEBUG SvnModel:80 - add action: [add dir] trunk/Code/DIR1
12:20:12,553 [main] DEBUG SvnModel:80 - add action: [add dir] trunk/Code/DIR1/DIR2
12:20:12,553 [main] DEBUG SvnModel:80 - add action: [add dir] trunk/Code/DIR1/DIR2/Drivers
12:20:12,569 [main] DEBUG SvnModel:80 - add action: [add file] trunk/Code/DIR1/DIR2/Drivers/UserCode.xml
12:20:12,569 [main] DEBUG SvnModel:80 - create new revision 3
12:20:12,569 [main] DEBUG SvnModel:80 - create tag REL1_PRD2
12:20:12,569 [main] DEBUG SvnModel:80 - add action: [add dir] tags/REL1_PRD2
12:20:12,569 [main] DEBUG SvnModel:80 - add action: [add dir] tags/REL1_PRD2/Code
12:20:12,569 [main] DEBUG SvnModel:80 - add action: [add dir] tags/REL1_PRD2/Code/DIR1
12:20:12,569 [main] DEBUG SvnModel:80 - add action: [add dir] tags/REL1_PRD2/Code/DIR1/DIR2
12:20:12,569 [main] DEBUG SvnModel:80 - add action: [add dir] tags/REL1_PRD2/Code/DIR1/DIR2/Drivers
12:20:12,569 [main] ERROR Main:96 - EXCEPTION CAUGHT: org.polarion.svnimporter.svnprovider.SvnException: Unknown branch: Code
at org.polarion.svnimporter.svnprovider.SvnModel.getBranch(SvnModel.java:209)
at org.polarion.svnimporter.svnprovider.SvnModel.addFileCopyToTag(SvnModel.java:337)
at org.polarion.svnimporter.stprovider.internal.STTransform.transformCommit(STTransform.java:139)
at org.polarion.svnimporter.stprovider.internal.STTransform.transform(STTransform.java:86)
at org.polarion.svnimporter.stprovider.STProvider.buildSvnModel(STProvider.java:127)
at org.polarion.svnimporter.main.Main.buildFullSvnModel(Main.java:158)
at org.polarion.svnimporter.main.Main.run(Main.java:88)
at org.polarion.svnimporter.main.Main.main(Main.java:51)

12:20:12,569 [main] DEBUG STProvider:80 - cleanup
12:20:12,600 [main] DEBUG SvnAdmin:80 - cleanup

I think the issue is the branch isn't being created when trying to add the file.

svnModel.addFileCopyToTag(revision.getAbsolutePath(), tagName, revision.getBranch().getName(), revision.getAbsolutePath(), oldRevno);


Return to “Polarion SVN Importer (Repository Converter)”

Who is online

Users browsing this forum: No registered users and 5 guests