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.

Advanced TopicsYou should seriously consider using explicit revision numbers in all of your externalsdefinitions. Doing so means that you get to decide when to pull down adifferent snapshot of external information, and exactly which snapshot to pull.Besides avoiding the surprise of getting changes to third-party repositories thatyou might not have any control over, using explicit revision numbers alsomeans that as you backdate your working copy to a previous revision, your externalsdefinitions will also revert to the way they looked in that previous revision,which in turn means that the external working copies will be updated tomatch the way they looked back when your repository was at that previous revision.For software projects, this could be the difference between a successfuland a failed build of an older snapshot of your complex codebase.For most repositories, these three ways of formatting the externals definitions have thesame ultimate effect. They all bring the same benefits. Unfortunately, they all bring thesame annoyances, too. Since the definitions shown use absolute URLs, moving or copyinga directory to which they are attached will not affect what gets checked out as an external(though the relative local target subdirectory will, of course, move <strong>with</strong> the renamed directory).This can be confusing—even frustrating—in certain situations. For example, say youhave a top-level directory named my-project, and you've created an externals definitionon one of its subdirectories (my-project/some-dir) that tracks the latest revision of anotherof its subdirectories (my-project/external-dir).$ svn checkout http://svn.example.com/projects .A my-projectA my-project/some-dirA my-project/external-dir…Fetching external item into 'my-project/some-dir/subdir'Checked out external at revision 11.Checked out revision 11.$ svn propget svn:externals my-project/some-dirsubdir http://svn.example.com/projects/my-project/external-dir$Now you use svn move to rename the my-project directory. At this point, your externalsdefinition will still refer to a path under the my-project directory, even though that directoryno longer exists.$ svn move -q my-project renamed-project$ svn commit -m "Rename my-project to renamed-project."Deleting my-projectAddingrenamed-projectCommitted revision 12.$ svn updateFetching external item into 'renamed-project/some-dir/subdir'svn: Target path does not exist$Also, absolute URLs can cause problems <strong>with</strong> repositories that are available via multipleURL schemes. For example, if your <strong>Subversion</strong> server is configured to allow everyone tocheck out the repository over http:// or https://, but only allow commits to come invia https://, you have an interesting problem on your hands. If your externals definitionsuse the http:// form of the repository URLs, you won't be able to commit anything fromthe working copies created by those externals. On the other hand, if they use the https://form of the URLs, anyone who might be checking out via http:// because his72

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

Saved successfully!

Ooh no, something went wrong!