How to use a subversion repository as a template f

2019-08-16 23:30发布

问题:

I created a customised version of Wordpress for us to use as a template for our web projects, stored in an svn repository.

It has various properties set (ignores, wordpress + plugins as externals) to ease workflow and updates.

My question is, how to use this as a base for others projects / repositories?

  • If you export, it loses all the properties.

  • If you checkout, it is a working copy of the template repository and cannot be imported / committed to a new repository (?)

Should branches be used in this case? It doesn't seem right, as the projects will never be merged back into the template (though I guess some parts might be).

回答1:

It is ok to have then as branches. You can keep track of overall updates in the main version, and apply to the branches when appropriate.

Ps. if you still want to use it as a template, there is an already answered question about it: Is there a way to use a repository as a "template" to start a new repository?



回答2:

Import your customized version and SVN copy to a new locations. This works if you plan to develop in the same repo. Otherwise export and import to another repo.



回答3:

I would add a bat to your template that sets the required properties with "svn propset" and afterwards deletes itself.

A user would export the template, add the files to a new repository and the run the propset bat.

EDIT:

I meant a batch file. You can look what properties you currently have with svn proplist and svn propget. In your setprop.bat you would then call svn propset, e.g.:

svn propset svn:ignore *.bak dir1
svn propset svn:ignore *.etc dir2
svn propset svn:externals "extdir svn://domain/trunk" .