Wednesday, 15 May 2013

version control - Creating sub-projects of a big project in SVN -



version control - Creating sub-projects of a big project in SVN -

i have 2 big project x, y , several sub-projects under them. want create project repository construction this

svnroot/ | | project x -------sub-project ax (/brunch, /tag, /trunk) | |--- sub-project bx (/brunch, /tag, /trunk) | | | |--- sub-project nx (/brunch, /tag, /trunk) | project y ------sub-project ay (/brunch, /tag, /trunk) |--- sub-project (/brunch, /tag, /trunk) | |--- sub-project ny (/brunch, /tag, /trunk)

i want sub-projects under project related developed independently. sub-projects integrated create project x or y. how create project structure? looking construction such can work on of hierarchy (project , sub-project level).

this looks job svn:externals!

by setting svn:externals property on directory, can pull in directories anywhere else in svn (even different repositories) , show in working copy. can develop subdirectories independently, , pull them in wherever need them.

example:

svn_root/ │ projectx/ │ │ branches/ │ │ tags/ │ │ trunk/ │ │ │ projectdir1/ │ │ │ projectdir2/ │ │ │ subprojects/ │ │ │ project_file_1.txt │ │ │ project_file_2.txt │ projecty/ │ subprojects/ │ │ subprojecta/ │ │ │ branches/ │ │ │ tags/ │ │ │ trunk/ │ │ subprojectb/ │ │ │ branches/ │ │ │ tags/ │ │ │ trunk/ │ │ subprojectc/

inside projectx , projecty, "subprojects" empty. define property on directory named "svn:externals" pull in content top-level subprojects directories:

^/subprojects/subprojecta/trunk@123 ax ^/subprojects/subprojectb/trunk@456 bx ^/subprojects/subprojectc/trunk@789 cx

note "@123" portion. sets specific revision of subprojecta pull in. without specifier, won't able see version of subprojecta used build projectx @ version. also, using specifier allows you decide when pull in updates subprojecta when you're working on projectx. don't want break projectx day before release because working on subprojecta sake of projecty!

instead of specifying particular revision of subproject on trunk, can specify branch or tag.

for more information, consult svn book: http://svnbook.red-bean.com/en/1.7/svn.advanced.externals.html

when developing subproject, can either work top-level subprojects directory, or can temporarily set svn:externals pull in latest trunk removing revision specifier, , work exclusively projectx working copy. don't commit externals property without revision specifier!

svn version-control project project-management

No comments:

Post a Comment