不要与 SVN 差异合并 [英] Don't diff merges with SVN

查看:17
本文介绍了不要与 SVN 差异合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取我在功能分支上所做的所有更改的差异.

目前我使用

svn log --stop-on-copy |awk '/^r.+NAME/{print $1}' |xargs -l svn diff -c >代码.diff

不幸的是,这包括主干合并到我的分支并使差异变得混乱的修订.有没有办法让 svn log 跳过合并或让 diff 忽略它们?

解决方案

只要您将主干中的所有修订合并到您的分支中,您就可以区分主干(上次合并的修订)和分支(头)的两棵树

一些需要澄清的 ascii 艺术:

 r6 r9 r11--------+-------------+------O-->分支/(1)/(2) (3)/(4)后备箱 -----+-------+--------O----+---------O------>r4 r6 r7 r9 r12

(1) 你开始你的分支

(2) 你将你的主干与所有来自主干的提交同步

(3) 这是主干上的提交

(4) 您还必须合并 (3) 的提交(因此主干中不会丢失未合并到分支中的修订)

然后您可以将 branch:r11trunk:r9

进行区分

请注意,不能与 trunk:HEAD 进行区分,否则会显示中继 r12 的更改.

这正是重新整合合并的工作原理.

I would like to get a diff of all the changes I did on a feature branch.

Currently I use

svn log --stop-on-copy | awk '/^r.+NAME/{print $1}' | xargs -l svn diff -c > code.diff

Unfortunately this includes the revisions where trunk got merged into my branch and clutters the diff. Is there a way to get svn log to skipp merges or to get diff to ignore them?

解决方案

As long as you merged all revisions from trunk into your branch you can diff the both trees of trunk (revision of last merge) and branch (head)

Some ascii art to clearify:

                      r6            r9     r11
              --------+-------------+------O-->  branch
             / (1)   / (2)    (3)  /(4)
 trunk -----+-------+--------O----+----------O------>
           r4      r6       r7   r9          r12

(1) you start your branch

(2) you sync your trunk with all commits from trunk

(3) this is a commit on trunk

(4) you must merge the commit of (3) as well (so no missing revisions in trunk which are not merged into branch)

You can then diff branch:r11 with trunk:r9

Note that you cannot diff with trunk:HEAD as then the changes of trunk r12 will be displayed.

This is exactly how reintegrate merge works as well.

这篇关于不要与 SVN 差异合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆