COMP 310
Fall 2011

Copying a Source-Controlled Project

Home  Info  Owlspace  Java Resources  Eclipse Resources

(Back to Using Subversion Source Control)

One must be very careful in copying a source-controlled project because if the Subversion references that are imbedded in the project (the hidden ".svn" folders) are not properly cleared and/or updated, serious problems can arise.

Recommended Method:

Step 0:  Open the "SVN Repository Exploring" perspective in Eclipse

 

Step 0:  Select the desired repository folder and branch it

Right-click the desired repository folder and seleect "Branch/Tag".

Step 2:  Choose the new repository location

Type in the location of the new repository branch in the "Copy to URL" box, e.g. change "HW01" to "HW02". If there are any folders in the path that haven't yet been created, check the "Create any intermediate folders that are missing" box to create them.

Step 3:  Copy the HEAD version.

Choose the HEAD version unless you explicitly want to branch a previous version.

Step 4:  Always include a branch comment.

A good comment will help you remember why the branch was created.

Click "Finish' to complete the branch creation.

Step 5:  Check out the new branch.

Check out the new branch into a new project in the workspace.

Be sure to change the name of the project.

Tip: The above process tends to not change teh project name that Eclipse stores in its ".project" configuration file (a hidden file located at the root of the project folder). One can tell this is happening when the original project name above does not match the apparent project name. This error is basically benign but can be annoying. Unfortunately, the only way to change the name in the .project file is to refactor the project's name. Those who wish to do this will not choose the actual desired project name above but will choose a temporary name and then refactor the project to the desired name.

To refactor a project name:

  1. From the Java perspective, right-click the root of the project in the Package Explorer pane.
  2. Select "Refactor" and then select "Rename....".
  3. Type in the new name (keep the default "Update References" checked) and click "Ok".

Alternate Method:

Here is one method, which is not without its problems (it replaces the old copy locally), but is workable:

Step 1:   Branch the project

Right-click the project and select Team then Branch/Tag

Team Branch Project

Step 2: Choose Copy Destination

Type in the new location for the copy, e.g. the new homework folder, as the new Repository Location.

Choose Copy Destination

 

Step 3:  Copy from Head

Be sure to select "HEAD revision in the repository"  (unless there is some reason you don't want the latest version).

Copy from Head

 

 

Step 4:  Branch and Switch

Check the "Switch working copy to new branch/tag" option to start working on the new copy.

Brand and Switch

 

Step 5: Rename the Project

Be sure to rename the project to a name that matches the new location, e.g. the new homework name.   Rename the project by right-clicking the project and selecting Refactor.

Rename the Project

 

 

 

 

 

 


© 2011 by Stephen Wong and Scott Rixner