svn复制和编辑diff和patch中的捕获

时间:2011-02-04 18:39:46

标签: svn patch

如何捕获svn副本,然后在diff中编辑以在另一台机器中将其重新应用为补丁?

svn copy a.txt b.txt
vim b.txt  <== some edits
svn diff <== this doesn't capture the copy - 
  but treats it as edit only causing problem with patch -p0

1 个答案:

答案 0 :(得分:2)

svn diff --notice-ancestry

默认情况下,svn diff不会查看文件的祖先,因此当您只键入svn diff时,它会在同一目录中查找存储库中的文件名b.txt。使用--notice-ancestry选项让b.txt与存储库中的a.txt进行区分。请注意,要在另一台计算机上实际执行修补程序,首先需要执行相同的svn copy命令,因为b.txt将不存在。