Use Eclipse's SVN plugin to create a skeleton/branch/tag for your project

Source: Internet
Author: User
Tags svn


After reading Mark Phippard's blog and Subversion and versioning, I learned that the branch/tag is one of the great features of SVN. But I spent a little time creating my own directory structure using the recommended trunk, branches, and tags folders. This article steps through the creation of a Subclipse project and then establishes a branch. This article assumes that you have installed the Subclipse and created an SVN repository. If you haven't, refer to the integrated SVN plugin to Eclipse entire process.
1. Add your Eclipse project to a "trunk" folder in the SVN repository
    • Start with an Eclipse project called "MyProject";
    • In the Navigator window, right-click your project and select Team, Share project ...
    • Select "SVN" and click "Next";
    • Select your SVN repository (this article assumes that the warehouse used in "Svn://localhost") and then click "Next";
    • In the Enter Folder Name dialog box, select the Use specified Folder name option and enter Myproject/trunk. The "URL:" box will have a display similar to "Svn://localhost/myproject/trunk". Click "Next";
    • Click "Finish". A new dialog box will open. Select all the files you want to submit, enter a comment, and then click "OK". My Eclipse's "Console" has the following output:
 Filesystem has no item
svn: URL ‘svn://localhost/myproject/trunk‘ non-existent in that revision

    Bad URL passed to RA layer
svn: URL ‘svn://localhost/myproject‘ non-existent in revision ‘234‘

mkdir -m "Initial import." svn://localhost/myproject
mkdir -m "Initial import." svn://localhost/myproject/trunk
checkout -N -r HEAD svn://localhost/myproject/trunk
    Checked out revision 236.
add -N C:\path\to\myproject\.settings
    A         C:/path/to/myproject/.settings
add -N C:\path\to\myproject\.settings\org.eclipse.cdt.core.prefs
    A         C:/path/to/myproject/.settings/org.eclipse.cdt.core.prefs
add -N C:\path\to\myproject\.cdtbuild
    A         C:/path/to/myproject/.cdtbuild
add -N C:\path\to\myproject\.settings\org.eclipse.cdt.managedbuilder.core.prefs
    A
C:/path/to/myproject/.settings/org.eclipse.cdt.managedbuilder.core.prefs
add -N C:\path\to\myproject\.cdtproject
    A         C:/path/to/myproject/.cdtproject
add -N C:\path\to\myproject\.project
    A         C:/path/to/myproject/.project
commit -m "Initial import." C:/path/to/myproject/.cdtbuild C:/path/to/myproject/.cdtproject C:/path/to/myproject/.project C:/path/to/myproject/.settings C:/path/to/myproject/.settings/org.eclipse.cdt.core.prefs C:/path/to/myproject/.settings/org.eclipse.cdt.managedbuilder.core.prefs
    Adding         path/to/myproject/.cdtbuild
    Adding         path/to/myproject/.cdtproject
    Adding         path/to/myproject/.project
    Adding         path/to/myproject/.settings
    Adding         path/to/myproject/.settings/org.eclipse.cdt.core.prefs
    Adding         path/to/myproject/.settings/org.eclipse.cdt.managedbuilder.core.prefs
    Transmitting file data ...
    Committed revision 237.

2. Create "branches" and "tags" folders in the SVN repository
    • Switch to "SVN Repository exploring" view mode (Eclipse, click the "Window" menu, select "Open Perspective", "other ..." in the Open " Open Perspective dialog box, select "SVN Repository exploring" and click "OK");
    • In the SVN Repository window, expand the SVN tree and right-click on "MyProject" and select "New", "New Remote Folder";
    • In the Create a new Remote Folder dialog box, expand the SVN tree and select MyProject. "Folder Name:" Enter "branches". Click "Next";
    • Now open the "MyProject" directory to see "branches" and "trunk" subdirectories;
    • My Eclipse console has the following output:
Mkdir-m "Created branches folder." Svn://localhost/myproject/branches

    • Repeat these steps to create a "tags" directory;
3. Create a Branch
    • Switch back to the original view mode;
    • Submit any changes you want in the branch;
    • Right-click your project in the "Navigator" window and select "Team", "Update";
    • Right-click your project and select "Team", "Branch/tag ...";
    • In the "Copy (branch/tag)" dialog box that pops up, the "to URL:" text box enters "Svn://localhost/myproject/branches/mybranch" ("From WC at URL:" should be displayed as "svn:/ /localhost/myproject/trunk ");
    • Leave the "HEAD revision in the Repository" option selected, enter a comment, and click "OK";
    • My Eclipse console output is as follows:
Copy-rhead Svn://localhost/myproject/trunk Svn://localhost/myproject/branches/mybranch

4. Switch your working copy to the branch
    • You can now freely switch your working copy between the trunk and the branch;
    • Right-click on your project and select "Team", "Switch to another branch/tag ...";
    • "To URL:" text box input "Svn://localhost/myproject/branches/mybranch", click "OK";
    • My console output is as follows:
Switch Svn://localhost/myproject/branches/mybranch c:/path/to/myproject-rhead at revision 239.

5. Now you can use the features discussed in "Subclipse Branch and Tag support Enhanced", this article opens the Branch step reference from "How to use Subclipse branch".


Original link: http://www.saltycrane.com/blog/2007/03/how-to-setup-subclipse-project-to/.





The author of this article is written by the translator in 07, which will Eclipse only 3.3 (now 4.4), and Subclipse to 1.3.1 (now 2.0). So many of the original steps are not suitable for the latest version of the SVN plugin. So the translator on the basis of the original author, combined with the latest version of the Eclipse/subclipse, made some improvements to the original, in case of their own reference, but also hope that can be convenient to more peers. The version of Eclipse of the translator is 4.4.1 (also known as LUNA-SR1) and the Subclipse version is 2.0.1, which is the latest version as of this date. The following are the steps recorded by the Translator in action.
1. Add your Eclipse project to a "trunk" folder in the SVN repository
    • Start with an Eclipse project called "Swifton";
    • In the Navigator window, right-click your project and select Team, Share project ...
    • Select "SVN" and click "Next";
    • Select your SVN repository (this article assumes that the warehouse used in "Svn://localhost") and then click "Next";
    • The "Specify the project (s) Location" step was entered;
    • Select "Advanced Mode:" and "Name on Repository" SELECT "Use project name" (You can also give it an individual name if you are not afraid to confuse the project more.) The translator likes the WYSIWYG pattern, retains the project name, and the "Project Repository layout" box selects "Use Single Project Layout" (You can also select "Take Repository location Layout", a There are several items under the trunk. The translator currently has only this project, so select a project next trunk mode, later add the project, the same directory under the project and then build trunk, tick "use Subversion recommended layout (' trunk ', ' Branches ' and ' tags '):

    • Click "Finish". A new dialog box will open. Select all the files you want to submit, enter a comment, and click "OK";
    • Switch to "SVN Repository exploring" view mode (Eclipse, click the "Window" menu, select "Open Perspective", "other ..." in the Open " Open Perspective dialog box, select "SVN Repository exploring" and click "OK");
    • You can see the Swifton Project SVN warehouse backbone, branches, tags have been built;
    • This is the result of TortoiseSVN's view:

From this point of view, the original 3 steps to complete the thing, now a step can, is worthy of Subclipse the latest version.
2. Create a branch
    • Switch back to the original view mode;
    • Submit any changes you want in the branch;
    • Right-click your project in the "Navigator" window and select "Team", "Update";
    • Right-click your project and select "Team", "Branch ..."
    • Popup "Create Branch" dialog box
    • "Branch:" Enter "swifton1217" (the branch name is random.) The translator adds a date after the project name to represent a branch built in the Kusakabe, and tick "Start working in the branch" (optional). The translator prepares to develop under this branch, so select):

    • Enter a comment and click "OK". Wait for the SVN repository to create a branch end;
    • Eclipse's Navigator window shows that you are now developing under the swifton1217 branch replica:




    • Switching to "SVN Repository exploring" view mode, you can see a copy of the item already in the swifton1217 branch:








Use Eclipse's SVN plugin to create a skeleton/branch/tag for your project


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.