In this article, Elodie Eberhardt explains how to use source control technology such as SVN with Convertigo.



 

Processes to commit and retrieve Convertigo projects from SVN

Sharing a project (commit a project for the first time)

  • In the Project Explorerright-click on the project, select Team ==> Share project
  • If not declared, add a repository location pointing on the SVN destination folder. For example, create a new repository location pointing to http://my-svn/projects:
    • Select “Create a new repository location” radio button and click on Next.
    • Type-in the URL of the SVN repository used as destination folder for your project,
      Type-in your authentication User and Password values, 
      Check the “Save password” checkbox, 
      and click on Next.
    • The repository location is created now, continue with the main procedure, point 4.
  • If the repository location is already declared, select the repository location, and click on Next
  • Check “Advanced mode” radio button.
      In the Advanced mode:

    • check “Use project name”,
    • check “Use single project layout”,
    • uncheck “Use Subversion recommended layout (trunk, branches and tags)” (by default we assume that projects do not need to be committed with branches, they can be added later if necessary).
    • and click on Next.
  • Update the commit comment and click on Finish.
  • The project is shared on SVN (creation of the folder in the repository) and the commit window opens.
  • Click on Cancel for not committing directly the project. Some work has to be done before committing.
    In the Project Explorer, some directories and files from the project should not be committed to SVN:
    • _data,
    • _private,
    • Traces (except when it is a legacy project including traces),
    • projectName.temp.xsd,
    • projectName.temp.wsdl,
    • and other folders or files not to be committed…
  • For each directory or file:
    • Right-click, select Team ==> Add to svn:ignore
    • For folders, choose “Resource by name (For example: ‘…’)” and validate by clicking OK.
    • For files, choose “Custom pattern (For example: ‘…’)”, update the pattern (for example *.temp.*) and validate by clickingOK.
    • All svn:ignore properties are now set.
  • Synchronize the project: right-click on the project’s folder ==> Synchronize with Repository
    In the Synchronize view, all files appear as new/updated locally (grey arrow pointing to the right). Moreover, a .project file appears: it is very important to keep and commit it with the project’s files.
  • Commit the project : right-click on the project ==> Commit
  • Set the commit comment explaining what your commit is about.
    Verify the folders and files to commit in the table on the bottom, and click on OK.
  • SVN commits folders, files, and svn:ignores properties set on project parent folder.
  • Switch back to Project Explorer view: the project appears committed and correctly synchronized with SVN.


Committing a project after updates

  • In Projects view, save your project by clicking on the Save All button.
  • Then, export your project .car file by right-click on the project ==> Export
  • Select the directory (default is in “projects” folder) where you want to save the car file and validate.
  • Switch to Project Explorer view.
  • Right-click on the project, select Refresh: Eclipse resources are correctly refreshed with disk files (very important, do it every time as these resources are badly refreshed automatically by Eclipse).
  • Right-click on the project, select Team ==> Synchronize with Repository.
    The Synchronize view displays the files that are different between SVN server and local resources.
  • Right-click on the project, select Commit.
  • Set the commit comment explaining what your commit is about.
    Verify the folders and files to commit in the table on the bottom, and click on OK.
  • SVN commits files.
  • Switch back to Project Explorer view: the project appears committed and correctly synchronized with SVN.


Check out a project from SVN repository

  • In SVN Repositories view, expand the repository to access the project you need.
  • If the project was committed directly, with no branches nor trunk folders, right-click on the project folder, select Find/Check Out As…
  • Check the “Check out as a project with name specified” radio button, the project name is correctly specified in the input field.
  • If the project was committed with branches and trunk folders, right-click on the branch folder you want to retrieve, and selectFind/Check Out As…
  • Check the “Check out as a project with name specified” radio button, and change the name of the branch with the correct project name.
    It is very important to change the name of the extracted project because the project name is the same as the folder containing the project files, and this folder should always have the same name as the Convertigo project, represented by its .xml file.
  • Click on Next.
  • Verify if the default workspace location is the right place to extract the project.
  • If not, uncheck the “Use default workspace location” checkbox and modify the value.
  • Click on Finish.
    The project files are retrieved in the destination folder and you can see them in the Project Explorer.
  • Finally, you have to import the .xml file of the project in Convertigo to import the project.


Copying SVNized folder into Eclipse

If you want to copy a SVNized folder (with SVN decoration) to another Eclipse / Convertigo project, you must NOT copy this folder using file explorer, nor ctrl+cctrl+v, nor copy/paste menu…

The copied folder and its subfolders contain .svn folders where SVN data is stored and that are read by SVN clients (tortoise, Eclipse, …).

If this kind of folder appears in a SVN project that is different from its original project, the SVN client will try to interpret its content and will probably broke the coherency of the local project:

  • the folder can appear as a link (red arrow), but it’s not one,
  • the parent folder can be locked and you can’t unlock it by cleaning the project ==> it is broken

 

You MUST use one of these items found into the Team menu of the folder:

  • Copy To…: [copy inside the workspace] will prompt a wizard with a tree of Eclipse workspace where you should:
    • select the destination parent folder,
    • and check “copy resources without SVN history”: that makes appearing the copied folder as local. (The other choice makes a SVN copy that preserves file history.)
  • Export…: [copy somewhere on our computer] will prompt a file picker dialog where you should select the destination parent folder. The copied folder will be .svn free.

Leave a comment