You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Todd Stafford <st...@se-core.net> on 2006/06/21 18:51:48 UTC

creating a patch from multiple revisions

I am currently trying to design a script that will create a patch file 
that contains the diff on changes made based on multiple revisions. 
These revisions are not consecutive.   I have not seen any documentation 
saying how to perform this action using the repository.  The use case is 
that some developer created new functionality and those revisions are 
for that work.  The work needs to be reviewed.  But we do not want other 
work showing up in the diff.  This would also be nice to promote work 
from the trunk to the stable branch.  My current implementation is:

say I want to get a patch of rev 3, 4, 7, 9, and 14.

svn checkout -r 2 repo/trunk (at lowest possible level)
svn merge -r 2:3
svn merge -r 3:4
svn merge -r 6:7
svn merge -r 8:9
svn merge -r 13:14
svn diff > patchfile

So now the patchfile contains the changes made for the specific new 
functionality.

the checkout is going to be the most time consuming part, our trunk is 
over a gig, and based on the files that were changed, we may need to 
diff at the highest level.   Obviously something server side would be 
best, to eliminate the need to perform the checkout.

Does anyone have any tricks to perform this action, and not be possibly 
bogged down with a lengthy checkout?

-Todd

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: creating a patch from multiple revisions

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 21, 2006, at 20:51, Todd Stafford wrote:

> say I want to get a patch of rev 3, 4, 7, 9, and 14.
>
> svn checkout -r 2 repo/trunk (at lowest possible level)
> svn merge -r 2:3
> svn merge -r 3:4
> svn merge -r 6:7
> svn merge -r 8:9
> svn merge -r 13:14
> svn diff > patchfile
>
> So now the patchfile contains the changes made for the specific new  
> functionality.

Note that the patchfile will not contain changes such as directory  
additions or deletions, and I'm not sure how property changes would  
be handled. Not sure how it would handle file deletions either. In  
other words, it's probably great if you've only ever changed existing  
files. As soon as you do more than that, "svn diff" doesn't show the  
whole picture.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: creating a patch from multiple revisions

Posted by Moshe Gurvich <mo...@varien.com>.
Try this:

echo "">patchfile; for R in 2:3 3:4 6:7 8:9; do svn diff repo/trunk -r
$R>>patchfile; done

-----Original Message-----
From: Todd Stafford [mailto:staffordt@se-core.net] 
Sent: Wednesday, June 21, 2006 11:52 AM
To: users@subversion.tigris.org
Subject: creating a patch from multiple revisions

I am currently trying to design a script that will create a patch file that
contains the diff on changes made based on multiple revisions. 
These revisions are not consecutive.   I have not seen any documentation 
saying how to perform this action using the repository.  The use case is
that some developer created new functionality and those revisions are for
that work.  The work needs to be reviewed.  But we do not want other work
showing up in the diff.  This would also be nice to promote work from the
trunk to the stable branch.  My current implementation is:

say I want to get a patch of rev 3, 4, 7, 9, and 14.

svn checkout -r 2 repo/trunk (at lowest possible level) svn merge -r 2:3 svn
merge -r 3:4 svn merge -r 6:7 svn merge -r 8:9 svn merge -r 13:14 svn diff >
patchfile

So now the patchfile contains the changes made for the specific new
functionality.

the checkout is going to be the most time consuming part, our trunk is over
a gig, and based on the files that were changed, we may need to 
diff at the highest level.   Obviously something server side would be 
best, to eliminate the need to perform the checkout.

Does anyone have any tricks to perform this action, and not be possibly
bogged down with a lengthy checkout?

-Todd

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org