Introduction
Subversion is a powerful, open source version control system designed as a replacement for the popular Concurrent Versions System (CVS). It offers many enhancements to CVS, such as versioned directories and metadata, and is architected for simpler, more flexible network access. Oracle offers an extension to the JDeveloper IDE, which automates much of the manual work involved with interacting with Subversion. For a rigorous introduction to Subversion, consult "Version Control with Subversion" at http://svnbook.red-bean.com/.
This guide takes you through the necessary steps to install Subversion and configure JDeveloper for use with it. You will then be taken through some common scenarios encountered when working with Subversion in JDeveloper.
Installing the JDeveloper Subversion VCS extension
The JDeveloper Subversion VCS extension is based on JDeveloper production version 10.1.3.0.4. You will need either the J2EE or Studio Edition; the Java edition will be supported in a future version. If you have not already done so, download and install JDeveloper 10.1.3 (J2EE or Studio) fromhttp://otn.oracle.com/products/jdev.
The JDeveloper Subversion VCS extension is available via the official Oracle update center. You install updates using the Check for Updates feature available from the Help menu:
Using the Check for Updates wizard, search the Official Oracle Extensions and Updates center:
Locate and select the Subversion VCS Extension entry. Selecting this will automatically select the VCS Framework Extension update too.
Proceed to the download stage:
After downloading the updates, you will see a summary page with information similar to the following:
On completion of this wizard, you may be asked whether you want to automatically restart JDeveloper:
Choose "Yes".
When JDeveloper has restarted, open the Versioning menu, choose Select Version System and then Subversion.
If configuration was successful, you will see a status message below the structure pane:
Assuming success, view the preferences for Subversion to check that the JavaSVN client library has been installed as expected: Open the Preferences dialog ( Tools > Preferences) and in the left pane select Versioning | Subversion.
With the extension correctly installed, you will see something like:
Connecting to a Subversion repository
If you have previously been using Subversion as your versioning system, you will already have a repository that you can connect to through JDeveloper. In the Subversion Navigator ( View > Subversion Navigator), right-click the Subversion node and select New Repository Connection. In the Create Subversion Connection dialog, enter the repository location, using an appropriate access method protocol ( http://, https://, svn://, svn+ssh://). You can also use the file:/// protocol, but to do so you will need to install additional software, as explained in Appendix B.
TIP: If you want to follow the examples given in this Developer's Guide, you will need to install a local Subversion repository named c:/svn-repos and connect to it using the svn:// protocol. The JDeveloper Subversion VCS extension will allow you to install a local repository if you also have separate Subversion client software installed. See Creating a local Subversion repository.
If you want to save the details of your Subversion repository connections so that you can use them later or on another machine, you can export them to a text file. You can then recreate the connections by importing the details from the file. To export, right-click the Subversion node in the Subversion Navigator and choose Export Connections. Complete the Export Subversion Connections dialog, then click OK. To reimport connection details from a file, right-click the Subversion node and chooseImport Connections. Through the Import Subversion Connections dialog, browse to the file that contains the connection details that you wish to import, then click OK.
Importing JDeveloper projects into Subversion
svn://localhost/
c:\jdev1013\jdev\mywork\test
Checking out files
Adding and committing files
TIP: In a live development environment, to avoid unnecessary conflicts and the subsequent work in resolving them, you should update your files before committing them.
Updating files
- If a file can be updated without causing a conflict, the navigator icon will change to an orange circle and the file content will be updated with content from the repository version.
- If, when a file is updated, there is a conflict, the navigator icon will change to an exclamation point and the file content will be changed to show both the original content and the content from the repository. The conflicting content will be separated by conflict markers (see Resolving Conflicts).
Editing files
TIP: To be certain that you are seeing the most up-to-date status of files in JDeveloper, click the Refresh button on the Application Navigator toolbar.
Where more than one developer is going to be working on the same file, there has to be a system to prevent one developer's work unintentionally overwriting another's. The preferred solution to this with Subversion is the copy-modify-merge model. In this model, each developer working on a file takes a copy of it, modifies it, then merges it with the other developers' copies. This may sound as if it would cause frequent conflicts in the content, but in practice this is rarely the case. When conflicts do occur, there is an efficient process for resolving them (see Resolving Conflicts).
An alternative to the above is the lock-modify-unlock model, in which a developer locks a file, modifies it, adds it back to the repository, then unlocks it. Locking a file does not prevent another developer from working on a copy of the file: it prevents the content of that copy from being returned to the repository until the lock is removed. So there is still potential for wasted effort in this model.
The lock-modify-unlock model is more suitable for working with files in binary formats, where it is impossible to merge conflicting changes. It ensures that developers take it in strict turns to submit changes to a file.
In this release of JDeveloper, support for locking is limited to retaining locks on files that you are about to commit. You must previously have locked the files using the Subversion lock command. In a future release, locking and unlocking will be fully supported.
Retaining a lock will mean that other developers will still not be able to commit changes they made to their copies of the files.
To lock a file using the Subversion lock command, enter the following at a command prompt:
svn lock [file name] -m "[message]"
To unlock a file, use:
svn unlock [file name]
For more info please refer
http://www.oracle.com/technetwork/developer-tools/jdev/subversion-085144.html
No comments:
Post a Comment