0

使用“svn merge --reintegrate”成功地将分支合并回主干,关于在主干上删除的分支文件也被删除。这是我所期待和想要的。好的。

但是,它没有将文件添加到分支上添加的主干。虽然“svn merge --reintegrate”将添加的文件复制到主干工作目录,但它们没有添加到 svn,当然也没有提交。我没想到会这样。坏的。

如何安全地将分支合并到主干更改,包括文件删除和文件添加?

这是我所做的

my-bug-fix 分支是从主干上的最后一个正式版本创建的。这是一个单一的开发者项目,但我仍然设法弄乱了合并并破坏了构建。

在合并之前,我将分支和主干都检出到“暂存”文件夹中,以便于区分。我希望差异能够向我保证合并是我在提交之前所期望的。不幸的是,diff 不知道添加的文件尚未添加到 svn。

mkdir merge-staging
cd merge-staging
svn co https://myserver.com:8443/svn/myproject/branches/my-bug-fix/ branch
svn co https://myserver.com:8443/svn/myproject/trunk/ trunk
cd trunk
svn merge --reintegrate https://myserver.com:8443/svn/myproject/branches/my-bug-fix/
echo Perform diff between branch and trunk to verify the trunk now matches branch.
diff -r  --exclude=".svn" branch/ trunk/

svn --version
svn, version 1.6.15 (r1038135)
   compiled Nov 25 2010, 00:08:34

[esutton@esutton-vm-rhel merge]$ svn status trunk
X       trunk/common/externals
?       trunk/common/scripts/strip-dbg-sym.sh

提前感谢任何方向,-Ed

4

1 回答 1

1
  1. 如果merge --reintegrate,为什么在它之前看不到合并到 my-bug-fix 分支的主干?
  2. 为什么我看不到真正的命令输出?
  3. 为什么我看不到你的svn --version
  4. 为什么我看不到'svn log -v -q' for your repo for rev-in-question?
  5. svn status而不是 diff 将可用

回到问题:

我无法确认或重现所描述的效果

>svn log -v file:///Z:/Repo
------------------------------------------------------------------------
r9 | Badger | 2013-04-23 07:32:26 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
   M /trunk
   M /trunk/fleA.txt
   D /trunk/fleB.txt
   A /trunk/fleC.txt (from /branches/corrections/fleC.txt:8)

Reintegrated branch to trunk
------------------------------------------------------------------------
r8 | Badger | 2013-04-23 07:30:04 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
   M /branches/corrections
   M /branches/corrections/fleA.txt

Merged trunk to branches/corrections
------------------------------------------------------------------------
r7 | Badger | 2013-04-23 07:25:40 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
   D /branches/corrections/fleB.txt

Deleted fleB.txt
------------------------------------------------------------------------
r6 | Badger | 2013-04-23 07:24:57 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
   A /branches/corrections/fleC.txt

Added fleC.txt
------------------------------------------------------------------------
r5 | Badger | 2013-04-23 07:23:37 +0600 (Вт, 23 апр 2013) | 2 lines
Changed paths:
   M /branches/corrections/fleA.txt

Added string to fleA.txt

------------------------------------------------------------------------
r4 | Badger | 2013-04-23 07:22:12 +0600 (Вт, 23 апр 2013) | 2 lines
Changed paths:
   M /trunk/fleA.txt

Edited fleA.txt

------------------------------------------------------------------------
r3 | Badger | 2013-04-23 07:20:25 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
   A /branches/corrections (from /trunk:2)

Branch for changes
------------------------------------------------------------------------
r2 | Badger | 2013-04-23 07:17:25 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
   A /trunk/fleA.txt
   A /trunk/fleB.txt

Starting point
------------------------------------------------------------------------
r1 | Badger | 2013-04-23 07:15:06 +0600 (Вт, 23 апр 2013) | 1 line
Changed paths:
   A /branches
   A /tags
   A /trunk

Imported folder structure
------------------------------------------------------------------------

>svn ls -v file:///Z:/Repo/trunk
      9 Badger                апр 23 07:32 ./
      9 Badger             52 апр 23 07:32 fleA.txt
      9 Badger             40 апр 23 07:32 fleC.txt
于 2013-04-23T01:46:20.203 回答