开发者

Reviewing changes in an svn branch

We typically developed new features on a separate svn branch. After finishing the features, another person reviews that branch' changes.

I use emacs with psvn. The svn-status is very convenient. It marks changed between local (not committed) changes. It is easy to ediff and see all differences from this svn-status mode buffer.

Typically I do these step for easing my review of other colleagues work:

svn co [svn-branch-url]         # get his branch locally  
cd [check-out-branch]  
svn log -vvv -stop-on-copy      # this gives me all revision involved  
svn diff -r[old]:[latest] >diff.patch # note latest is not HEAD  
svn switch [svn-url]@[ol开发者_如何学运维d]      # go to the creating of the branch  
patch -p0 diff.patch                 # apply his feature  

Now emacs allows me with svn-status to see all the changes. I add some review comments in the source and perform these steps:

svn switch [svn-url]@[latest]  

I now get conflicts. (Again it easy with emacs to review these with ediff). But it is just my review comments.

svn resolved [files-in-conflict]  
svn commit -m "review comments"

now my colleague can read the comments.

Is there some more practical way of doing this? How do you this?


Install Redmine (with the code review plugin) or Reviewboard, it'll show you a big list of all the commit messages and you can do a review of the branch's changes between any 2 revisions. You can also annotate any issues you find and have them automatically be created as tickets for the dev to fix!


I see some limitations of your approach:
* You need to pass patch files between people by email;
* You don't leave any trace of the comments given and the discussion made;
* You have a long procedure for the review, which mean people would try to avoid it when they can.

I've been able to use two methods which don't have this limitation:
* Use malevich or ReviewBoard which create web-sites with the diff in them and allow the reviewers to give the comments there.
* Write a small script (say python code using pysvn) to automate the process, so that developers would just need to write "cr branch-name developer-name" and get the changes open in emacs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜