Partial SVN Branch

I am new to SVN, so this may be a simple question.

We have a “trunk” with first level catalogs:

10 <-- documents
20 <-- source code, db scripts, ...
30 <-- documents
40 <-- referenced 3rd party library-es

I created a “developed” branch from a “trunk”. In the "development", we change the source code, and after testing it, we combine it in the "trunk".

The problem is that the "10" and "30" directories store * .doc files that are not needed for development, so it REQUIRES that the "develop" branch does not have these directories.

The solution should also be:

  • allow "svn update" in the root folder to "develop" a working copy (20 and 40).
  • this update should not recreate directories 10 and 30 and
  • Of course, a merge "develops" into a "trunk" should not remove 10 or 30 in a "trunk".

EDIT: , " " 20. dll-s build .., 1- , 40.

+3
8

, svn copy - , . , , , .

, "" , , , . 10, 20, 30 40 . :

trunk
    10
    20
    30
    40
branches
tags

, , , :

trunk
    10
    20
    30
    40
branches
    sandbox
        20
        40
tags

( , ), , 10, 20 . . , dev, :

10
20
30
40
dev
    20
    40

, dev 20 . , , .

, , . svnadmin ( , sysadmin). ( Linux, Windows, , , Windows, REPO):

svnadmin create temp.repo
REPO="file://`pwd`/temp.repo"
svn co $REPO temp

() . : URL- . URL- :

file:///home/kgregory/Workspace/temp.repo

, , , :

cd temp
svn mkdir trunk
svn mkdir branches
svn mkdir tags
svn commit -m "standard repo structure"

pushd trunk
svn mkdir 10
svn mkdir 20
svn mkdir 30
svn mkdir 40
svn commit -m "example sub-project structure"

echo "this doesn't change" > 10/dontchange.txt
svn add 10/dontchange.txt
echo "this does change" > 20/change.txt
svn add 20/change.txt
svn status
svn commit -m "example files"
popd

. find, :

temp, 531> find . | grep -v svn
.
./tags
./trunk
./trunk/10
./trunk/10/dontchange.txt
./trunk/30
./trunk/20
./trunk/20/change.txt
./trunk/40
./branches

- , :

svn mkdir branches/sandbox
pushd branches/sandbox
svn copy ${REPO}/trunk/20 .
svn copy ${REPO}/trunk/40 .
svn commit -m "make development branch"
popd

: , . trunk branches, svn copy . , trunk.

:

temp, 539> find . | grep -v svn
.
./tags
./trunk
./trunk/10
./trunk/10/dontchange.txt
./trunk/30
./trunk/20
./trunk/20/change.txt
./trunk/40
./branches
./branches/sandbox
./branches/sandbox/20
./branches/sandbox/20/change.txt
./branches/sandbox/40

. ( cd Workspace):

svn co ${REPO}/branches/sandbox sandbox
cd sandbox

:

vi 20/change.txt
svn commit -m "changed on branch"

, . , :

svn co ${REPO}/trunk trunk
cd trunk

. Subversion:

svn merge -r 4:5 ${REPO}/branches/sandbox
svn status

, 20/change.txt. 10 30 , .

+10

, "20" - svn-, .

repo
---> trunk
    ---> 10 
    ---> 20
    ---> 30
---> branches
    ---> sandboxes
        ---> develop <branch of 20>
---> tags

"", "20" , 20 . , "" , . "" ( "" )

+2

afaik , .

, 10 20, 40 1- . , , .

+2

. 20, . , , . .

+1

, .

svn cp http://example.com/svnrepo/trunk/source_code http://example.com/svnrepo/branches/development/source_code

cd ./source_code
svn sw http://example.com/svnrepo/branches/development/source_code

, . , :

svn sw http://example.com/svnrepo/trunk/source_code
cd ..
svn merge -r [start_rev]:HEAD http://example.com/svnrepo/branches/development/source_code ./source_code

, , :

svn diff | less

. .

0

- :

-repo: Assemblies
--SomeAssembly
---Current
---v1.0
---v1.1
-repo: Source
--trunk
---Code
---Assemblies (external from Assemblies repo)
--branches
---v1.0
----Code
----Assemblies (external from Assemblies repo)
--Documents

. , . "" . . , .

, , . , . , , , .

0

docs dir SVN .

:

  • docs svn:external
  • docs script docs dir
  • script ( svn merge) script
0

:

10 30. .

svn: externals develop 10 30? root ^/, , .

, 10, 20, 30 40 , 10 30 . .


repo ..-> trunk
....-> 10
....-> 20
....-> 30
....-> 40
..-> branches
....-> develop .... ..-> 10 (lives on the trunk, svn: external ^ / trunk / 10)
......-> 20 (lives on the branch, merges with the trunk)
......-> 30 (lives on the trunk , svn: external ^ / trunk / 30)
......-> 40 (lives on a branch, merges with the trunk)

0
source

Source: https://habr.com/ru/post/1723983/


All Articles