Manuals

Kako vključim skupni podprojekt

Sometimes you will want to include another project within your working copy, perhaps some library code. There are at least 4 ways of dealing with this.

Uporabite lastnost svn:externals

Set the svn:externals property for a folder in your project. This property consists of one or more lines; each line has the name of a sub-folder which you want to use as the checkout folder for common code, and the repository URL that you want to be checked out there. For full details refer to “External Items”.

Objavite novo mapo. Pri posodobitvi bo Subversion potegnil kopijo projekta iz skladišča v vašo delovno kopijo. Če je to potrebno, se podmape ustvarijo samodejno. Ob vsaki posodobitvi delovne kopije boste posodobili tudi vse zunanje projekte.

If the external project is in the same repository, any changes you make there will be included in the commit list when you commit your main project.

If the external project is in a different repository, any changes you make to the external project will be shown or indicated when you commit the main project, but you have to commit those external changes separately.

Od vseh treh opisanih možnosti je ta edina, ki ne potrebuje namestitve na strani odjemalca. Ko so zunanje datoteke določene v lastnostih map, bodo ob posodobitvi vsi odjemalci popolnili mape.

Uporabite vgnezdeno delovno kopijo

Create a new folder within your project to contain the common code, but do not add it to Subversion.

Na novi mapi izvedite TortoiseSVNPrevzem skupne kode. Sedaj imate ločeno delovno kopijo vgnezdeno v svoji glavni delovni kopiji.

Ti dve delovni kopiji sta neodvisni. Ko objavite spremembe na korenski delovni kopiji, se spremembe na vgnezdeni delovni kopij prezrejo. Podobno je v primeru posodobitve: ko posodobite korensko delovno kopijo, je vgnezdena prezrta.

Uporabite relativno lokacijo

If you use the same common core code in several projects, and you do not want to keep multiple working copies of it for every project that uses it, you can just check it out to a separate location which is related to all the other projects which use it. For example:

C:\Projects\Proj1
C:\Projects\Proj2
C:\Projects\Proj3
C:\Projects\Common
        

and refer to the common code using a relative path, e.g. ..\..\Common\DSPcore.

If your projects are scattered in unrelated locations you can use a variant of this, which is to put the common code in one location and use drive letter substitution to map that location to something you can hard code in your projects, e.g. Checkout the common code to D:\Documents\Framework or C:\Documents and Settings\{login}\My Documents\framework then use

SUBST X: "D:\Documents\framework"
        

to create the drive mapping used in your source code. Your code can then use absolute locations.

#include "X:\superio\superio.h"
        

Ta metoda deluje le v okoljih, kjer vsi uporabniki uporabljajo računalnike PC. Preslikave pogonov boste morali dokumentirati, da bodo ostali člani teama vedeli, od kje prihajajo te skrivnostne datoteke. Metoda naj se uporablja v zaprtem krogu razvijalcev, za splošno uporabo pa ni priporočljiva.

Add the project to the repository

The maybe easiest way is to simply add the project in a subfolder to your own project working copy. However this has the disadvantage that you have to update and upgrade this external project manually.

To help with the upgrade, TortoiseSVN provides a command in the explorer right-drag context menu. Simply right-drag the folder where you unzipped the new version of the external library to the folder in your working copy, and then select Context MenuSVN Vendorbranch here. This will then copy the new files over to the target folder while automatically adding new files and removing files that aren't in the new version anymore.

TortoiseSVN homepage