11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Branching and MergingA newdirectoryA newdirectory/newfileU .…Another way of thinking about this pattern is that your weekly sync of trunk to branch isanalogous to running svn update in a working copy, while the final merge step is analogousto running svn commit from a working copy. After all, what else is a working copy buta very shallow private branch? It's a branch that's capable of storing only one change at atime.Vendor BranchesAs is especially the case when developing software, the data that you maintain under versioncontrol is often closely related to, or perhaps dependent upon, someone else's data.Generally, the needs of your project will dictate that you stay as up to date as possible <strong>with</strong>the data provided by that external entity <strong>with</strong>out sacrificing the stability of your own project.This scenario plays itself out all the time—anywhere that the information generated by onegroup of people has a direct effect on that which is generated by another group.For example, software developers might be working on an application that makes use of athird-party library. <strong>Subversion</strong> has just such a relationship <strong>with</strong> the Apache PortableRuntime (APR) library (see the section called “The Apache Portable Runtime Library”). The<strong>Subversion</strong> source code depends on the APR library for all its portability needs. In earlierstages of <strong>Subversion</strong>'s development, the project closely tracked APR's changing API, alwayssticking to the “bleeding edge” of the library's code churn. Now that both APR and<strong>Subversion</strong> have matured, <strong>Subversion</strong> attempts to synchronize <strong>with</strong> APR's library API onlyat well-tested, stable release points.Now, if your project depends on someone else's information, you could attempt to synchronizethat information <strong>with</strong> your own in several ways. Most painfully, you could issue oralor written instructions to all the contributors of your project, telling them to make surethey have the specific versions of that third-party information that your project needs. If thethird-party information is maintained in a <strong>Subversion</strong> repository, you could also use <strong>Subversion</strong>'sexternals definitions to effectively “pin down” specific versions of that informationto some location in your own working copy directory (see the section called “ExternalsDefinitions”).But sometimes you want to maintain custom modifications to third-party code in your ownversion control system. Returning to the software development example, programmersmight need to make modifications to that third-party library for their own purposes. Thesemodifications might include new functionality or bug fixes, maintained internally only untilthey become part of an official release of the third-party library. Or the changes might neverbe relayed back to the library maintainers, existing solely as custom tweaks to make thelibrary further suit the needs of the software developers.Now you face an interesting situation. Your project could house its custom modifications tothe third-party data in some disjointed fashion, such as using patch files or full-fledged alternativeversions of files and directories. But these quickly become maintenance headaches,requiring some mechanism by which to apply your custom changes to the thirdpartycode and necessitating regeneration of those changes <strong>with</strong> each successive versionof the third-party code that you track.The solution to this problem is to use vendor branches. A vendor branch is a directory treein your own version control system that contains information provided by a third-party entity,or vendor. Each version of the vendor's data that you decide to absorb into your projectis called a vendor drop.Vendor branches provide two benefits. First, by storing the currently supported vendor dropin your own version control system, you ensure that the members of your project never116

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!