Don't diff merges with SVN

蹲街弑〆低调 提交于 2019-12-31 02:55:12

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/7386747/dont-diff-merges-with-svn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!