Answers:
您要做的是创建Branches。听起来像是您的源代码树中的一个分支,通常是您发布源代码时的源代码副本。您将提交此分支以进行关键更新,并从该分支构建更新。
您现在要提交的将是trunk
,您将在其中编写版本4。如果对版本3进行了任何重大更改,并且您希望在版本4中进行更改,则需要从分支(v3)到主干(v4)进行合并,以将更改带到主干。
您还可以查看标签,它们类似于分支,但链接到一个版本,通常是一个版本的最后一个修订版(或第一个修订版)。
我找到了解决这种情况的绝佳指南:
If you want to be able to both develop a newer version (in trunk) and
fix bugs on an older version, what you want is a branch for the older
version. You can fix your bug in the older version's branch, then
make a new tag of that.
Example:
/repo/
project/
trunk/
branches/
tags/
You've developed your software in trunk and are now ready to call it
version 1.0. You make a branch and a tag:
svn cp $REPO/project/trunk $REPO/project/branches/1.x
svn cp $REPO/project/branches/1.x $REPO/project/tags/1.0
/repo/
project/
trunk/
branches/
1.x/
tags/
1.0/
Now you continue to develop in trunk, adding new features, and this
will eventually become version 2.0. But while you're doing this, you
find a bug in 1.0 and need to fix it quick. So you check out branches/
1.x, make the change, test it, and commit it. Then you tag that as 1.1:
svn cp $REPO/project/branches/1.x $REPO/project/tags/1.1
/repo/
project/
trunk/
branches/
1.x/
tags/
1.0/
1.1/
If the bug also exists in trunk, then you need to port your bugfix to
trunk. "svn merge" can help you there.
cd trunk-wc
svn merge -c$R $REPO/project/branches/1.x .
where $R is the revision in which you fixed the bug on the 1.x
branch. Now you test the fix in trunk and then commit it. Now the bug
is fixed in trunk too.