gpt4 book ai didi

svn - 合并后如何防止在 Subversion 中丢失提交历史记录?

转载 作者:行者123 更新时间:2023-12-04 04:47:38 25 4
gpt4 key购买 nike

设置简单的 SVN 项目布局:

svnadmin create proj-repo
svn co file://$PWD/proj-repo proj
cd proj
mkdir branches trunk tags features
svn add *
svn ci -m 'Basic SVN project setup.'

启动项目:
cd trunk
svn add README
svn ci -m 'Add README'

实现功能:
svn cp . ^/features/linux-port
cd ../../
svn co file://$PWD/proj-repo/features/linux-port proj-linux-port
cd proj-linux-port
svn ci -m "Implement feature 1."
svn ci -m "Implement feature 2."
svn ci -m 'Add last feature.'

在主开发分支做工作:
svn switch ^/trunk
svn ci -m "Fix."

准备好新功能:
svn merge --reintegrate ^/features/linux-port
svn ci -m 'Integrate features.'

但是现在:
svn log .

------------------------------------------------------------------------
r9 | user | 2013-07-30 18:38:01 +0300 (Tue, 30 Jul 2013) | 1 line

Integrate features.
------------------------------------------------------------------------
r8 | user | 2013-07-30 18:36:53 +0300 (Tue, 30 Jul 2013) | 1 line

Fix.

和:
svn diff -r9

Index: README
===================================================================
--- README (revision 8)
+++ README (revision 9)
@@ -1,2 +1,5 @@
hello fix

+feature 1
+
+feature 2
+
+final feature

Property changes on: .
___________________________________________________________________
Added: svn:mergeinfo
Merged /features/linux-port:r2-8

因此,我丢失了来自 /features/linux-port:r2-8 的每个单独功能的后续提交。 .是否可以在不切换到 HG/Git/Bzr/Fossil 的情况下保存它们?

更新 我们通常会在解释编码决策的地方编写好的提交消息并放置指向 BTS 的链接。 SVN 删除了这些信息,我们很伤心。

所以我们需要使用旧学校 Changelog ?

最佳答案

哦,我只是仔细阅读:

svn help log

-g [--use-merge-history] : use/display additional information from merge

使用常用的 SVN 工具可以获得完整的历史记录。

要查看实际差异,请使用帽子路径语法:
svn diff -c 4 ^/

我还在官方文档中找到了适当的部分:

http://svnbook.red-bean.com/en/1.7/svn.branchmerge.advanced.html
The svn blame command also takes the --use-merge-history (-g) option.
If this option is neglected, somebody looking at a line-by-line annotation
of file may get the mistaken impression that you were responsible for the lines
that fixed a certain error

关于svn - 合并后如何防止在 Subversion 中丢失提交历史记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17952025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com