Developers on Mac OS X have a powerful and well-integrated tool to maintain efficient version control of your projects, thanks to the support for Subversion built into Xcode 2. If you don't know about Subversion already, you should. It's an open-source version control system that was developed to extend the functionality provided by CVS, and is particularly well supported in Mac OS X. Using this cutting-edge version control system can help you code more efficiently and effectively, allowing you to focus on what the Mac developer community is famous for: great applications. Installing Subversion fully on Mac OS X Server v10.4 requires installation of Apache 2.0 and other steps specific to Mac OS X. The installation process detailed here will help ensure that you as a Mac developer have easy access to this valuable tool. Using Version ControlVersion control systems keep track of project versions and store them in an organized, accessible, and space-efficient environment. In most systems, developers check out code from a central repository and subsequently import or commit changes back into the system. If multiple developers make simultaneous changes to code, the version control system merges the versions to ensure that all changes are retained without conflict. The system then requires developers to address detected conflicts manually. What's New in SubversionWhile the current standard in open-source version control on UNIX systems is CVS, Subversion is a relatively new open-source version control system offering many features CVS has yet to implement. It also operates with the same basic command structure as CVS, ensuring a smooth transition for users making a switch. In version 1.0, Subversion included most current CVS functionality with added support for versioned directories, renames, and metadata. Version 1.1 added support for versioned symbolic links and a new repository format called FSFS. FSFS offers an alternative to Berkeley Database (BDB) implementations, providing more traditional file system access to your repositories, which are stored in ordinary flat files. FSFS has several advantages over BDB, including cross-platform access to repositories, increased stability, increased security, and simpler backup procedures. FSFS has become the file system of choice for Subversion and is the default selection in version 1.2. Version 1.2 also adds support for reserved checkouts (used to lock files that cannot be merged) and full Web-based Distributed Authoring and Versioning (WebDAV) auto-versioning, allowing Subversion to automatically enact commits in the background without user interaction. Installing Apache 2.0In this article, we discuss Apache 2.0 on the server side, which requires compilation and configuration. By default, Mac OS X Server v10.4 comes prepackaged with Apache 1.3 setup. To host a networked Subversion repository, you need to use Apache 2.0. You may notice Mac OS X Server v10.4 comes with Apache 2.0 pre-installed but unconfigured in Note: At the time of this writing, the latest stable version of Apache 2.0 is version 2.0.54. To compile packages, you must have Before you compile Apache 2.0, you must set up patches and environment variables for a proper installation. Compiling Apache 2.0 allows you to choose whether to install modules, such as support for BDB. Note: If you choose to use BDB for your file system, you must install BDB and exclude the To install Apache 2.0 on Mac OS X Server v10.4, complete the following steps:
With these commands, you configure Apache 2.0 to compile on your system, then compile and install the distribution. Note: If you did not install Installing Subversion After you have installed and properly set up Apache 2.0, the Subversion installation process is straightforward. We provide instructions here, highlighted by a To install Subversion, complete the following steps:
Subversion executables are installed into cd ~ echo 'export PATH="$PATH:/usr/local/bin"' >> .profile Configuring Apache 2.0 for SubversionYou must configure Apache 2.0 so that it will not conflict with the active pre-installation of Apache 1.3. Set up Apache 2.0 on port 8080, and set it to run on startup, so that it will be active each time you start Mac OS X Server v10.4. To configure Apache 2.0 for Subversion, complete the following steps:
Installing WebSVNAt WebSVN they offer an easy-to-use Web-based interface to your Subversion repositories. (At the time of this writing, the latest stable version of WebSVN was version 1.61 [WebSVN_161.tar.gz].) Important: You must have PHP installed and configured as an Apache module for WebSVN to operate. See the ADC document PHP on Mac OS X for details. To install WebSVN, complete the following steps:
Xcode and SubversionSupport for Subversion is built into Xcode (version 1.5 and later). However, you must create your Subversion repository and import your project into Subversion on the command line before managing it in Xcode. For detailed instructions on the use of Subversion, see the online book Version Control with Subversion which is endorsed by Subversion's developers. You need a few basic Subversion commands to get you started as well as commands for using Xcode to interface with your Subversion repository. First, create a new repository in a location of your choosing (we're using svnadmin create /Users/tuser/Code/SVN Next, create the following temporary directories to import into Subversion: cd/tmp/tmpsvn mkdir HelloWorld mkdir HelloWorld/trunk mkdir HelloWorld/branches mkdir HelloWorld/tags Place your new or existing Xcode project in the cp -r /Users/tuser/Code/Xcode/HelloWorld /tmp/tmpsvn/HelloWorld/trunk/. svn import /tmp/tmpsvn/Helloworld file:///Users/tuser/Code/SVN \ --message 'Initial HelloWorld Import' Finally, go into the directory you want to use for your Subversion checkout (this will be your working copy of your project), and check out the project. You can subsequently remove temporary directories created in cd /Users/tuser/Code/Projects/ svn checkout file:///Users/tuser/Code/SVN HelloWorld rm -rf /tmp/tmpsvn You now have two locations for your Xcode project. The Now it's time to tell Xcode that you're using Subversion for software control management (SCM). Open your project in Xcode from the newly set-up Figure 1: The Main Xcode Screen In the project information window shown in Figure 2, select Figure 2: Information for the HelloWorld Project Click Figure 3: Define the Subversion Tool Path Close the project information window and explore the Figure 4: Execute SCM Commands from the Menu Figure 5 shows an example of running the Figure 5: Comparing Versions of main.c ConclusionYou are now ready to develop code on Mac OS X Server v10.4 using Subversion for version control from the command line, your Web browser, and Xcode. Three powerful options for accessing Subversion's leading-edge version control constructs give Mac OS X developers the power and flexibility to efficiently develop, edit, and maintain complex projects with multiple contributors. For More Information
Updated: 2005-12-08 |
getting control with subversion and xcode
最新推荐文章于 2025-08-08 14:07:33 发布