Book a Demo

Author Topic: Rename packages, folders, etc in version control  (Read 5056 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1378
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Rename packages, folders, etc in version control
« on: June 24, 2008, 07:05:02 pm »
Hi

I use a project which is configured to work with SVN version control
I have now partitioned it so I have more than a dozen of separate XML files, stored within subfolders which structure is similar to my models and packages in the EA project.

I need to rename one of the packages which contains subpackages/diagrams/elements which are themselves partitioned into separate files.
I could simply rename this package (e.g. \Models\Analysis\ to \Models\Specification) but I'd like to rename the folder and file accordingly as well (in windows explorer: \Models\Analysis\Analysis.xml to \Models\Specification\Specification.xml)

This does not seem to be feasible by only using EA so I tried updating it in TortoiseSVN but it appears to mess things up in EA

Has anyone successfully done it before?

Thanks
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Rename packages, folders, etc in version contr
« Reply #1 on: June 24, 2008, 08:24:01 pm »
When you change the name of file under SVN (which actually means deleting it from the repository and adding it with a new name), and this file is configured in EA to be the working copy of a controlled package, EA will not find the renamed file afterwards.

You have to change the tags within the xmi file which tell EA from where to load the nested controlled packages:

Code: [Select]
<UML:Package name="...
---<UML:ModelElement.taggedValue>
------<UML:TaggedValue tag="xmlpath" value="oldRelativePath

Alternatively you can rename your xmi files, throw away your eap file, and rebuild your model with a series of get package calls.

I've done it before in both ways, but it's a nightmare. Be sure to back up everything.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1378
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: Rename packages, folders, etc in version contr
« Reply #2 on: June 24, 2008, 08:53:19 pm »
Thanks for the info.
I had actually tried a similar approach to the one you described and it messed up my EA so I had to "revert" to a previous version.

I'll give it another try now I have confirmation that there isn't a safe approach doing it.

cheers
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Rename packages, folders, etc in version contr
« Reply #3 on: June 24, 2008, 09:35:25 pm »
Quote
now I have confirmation that there isn't a safe approach doing it

Well, I'm not the EA pope. Maybe there are better ways, only I've never heard of one.

Dave.B

  • EA User
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Re: Rename packages, folders, etc in version contr
« Reply #4 on: June 24, 2008, 10:36:02 pm »
I think the real answer is to not use the package model name as the XMI file name. EA can and will use the packages internal GUID/UUID as the XMI file name and this is robust to changes to the packages model name. The only downside being that the XMI file names do not tell you which package they are - you have to read the XML to figure that out. But how often do you need to do that anyway?

I have started a thread about the different methods EA provides for creating and versioning packages and the different results that occur as a result. See http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1213893701.

Regards
Dave B.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Rename packages, folders, etc in version contr
« Reply #5 on: June 24, 2008, 11:59:23 pm »
Using the guids as xmi file names certainly takes care of the renaming problem. But then, when you are using private models which each developer can compose of packages from the version control repository, what do you see in the GetPackage dialog? GUIDs, with no idea which packages they represent.

But it's probably allright for shared models.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8086
  • Karma: +118/-20
    • View Profile
Re: Rename packages, folders, etc in version contr
« Reply #6 on: June 25, 2008, 08:29:31 am »
The GUID based filenames were created for the support of model branches.  This allows you to export a package and all packages below to version control.  Then when importing back into a new model you select Import Branch (or something like that) and only get the list of branch roots.