You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Harry Putnam <re...@newsguy.com> on 2009/01/14 05:47:19 UTC

Retrieving all revisions with changes present

As someone about to switch from cvs to svn, I want to know how to do
something like what I will describe, using svn.

Imagine I've kept tabs on scriptX through many changes and over a fairly
long time.  Long enough that I'm in serious doubt when and how certain
changes were made.

Imagine further that I recall using some code in this script way back
when, but I've forgotten the exact syntax and structure of this piece
of code.  All I can remember for sure is that when this change was
done I employed some unusual term somewhere... Maybe in a comment.

So I know I used the word `fructification' for some reason and it was
during an addition that was committed but mnths later stripped out.

Now mnths maybe yrs later still, I run into a problem that the old piece of
code might really suit.

I have no idea what mnth, maybe not even the year it was committed.

With cvs I was able to write a script that literally unwound every
revision starting with what ever revision number I aimed it at, and
put the entire change on stdout, one revision at a time but
essentially a massive out pouring of text.

My homeboy I script would filter through that with awk, which I could
make retain each revision number until it rolled over, and If I got a
hit on `fructificaiton', awk would spit out the matching version and
the line containing my hit.

Of course from there, I could make cvs spit the entire script for that
revision to study.

With the big difference in subversion of creating a revision for each
change to the entire repository, a file may remain unchanged for any
number of revisions.  

So my approach above would lead to massive unnecessary grepping where
the script didn't actually change.

I'm guessing there is some way other than revision numbers to be able to
home in on only those revisions where changes to scriptX were made.
And therefore the possibility of doing something very similar in
subversion using shell tools if need be, but some better way than just
unwinding 19,000 revisions looking for a keyword, when 18,950 are the same.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1023599

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: Retrieving all revisions with changes present

Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of Harry Putnam
> Sent: Wednesday, January 14, 2009 12:47 AM
> To: users@subversion.tigris.org
> Subject: Retrieving all revisions with changes present
> 
> As someone about to switch from cvs to svn, I want to know how to do
> something like what I will describe, using svn.
> 
> 
> With cvs I was able to write a script that literally unwound every
> revision starting with what ever revision number I aimed it at, and
> put the entire change on stdout, one revision at a time but
> essentially a massive out pouring of text.
> 
> My homeboy I script would filter through that with awk, which I could
> make retain each revision number until it rolled over, and If I got a
> hit on `fructificaiton', awk would spit out the matching version and
> the line containing my hit.
> 
> Of course from there, I could make cvs spit the entire script for that
> revision to study.
> 
> With the big difference in subversion of creating a revision for each
> change to the entire repository, a file may remain unchanged for any
> number of revisions.


Incorrect assumption.  If you do 'svn log' on a file, it will only list
the revisions in which a change occurred.

You can write your script pretty much the same way you did it with CVS.
Use 'svn log -q foo.java' to get the revisions to dump.  Use 'svn export
-r' or 'svn cat -r' to dump files by revision.  Grep the exported file
or text stream.

Alternatively, you could run 'svn diff' for each revision and grep for
the word that way.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1024271

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


RE: Retrieving all revisions with changes present

Posted by "Bagnall, Martin" <Ma...@hmhpub.com>.
http://nedbatchelder.com/code/utilities/blameall_py.html


-----Original Message-----
From: news [mailto:news@ger.gmane.org] On Behalf Of Harry Putnam
Sent: 14 January 2009 05:47
To: users@subversion.tigris.org
Subject: Retrieving all revisions with changes present

As someone about to switch from cvs to svn, I want to know how to do
something like what I will describe, using svn.

Imagine I've kept tabs on scriptX through many changes and over a fairly
long time.  Long enough that I'm in serious doubt when and how certain
changes were made.

Imagine further that I recall using some code in this script way back
when, but I've forgotten the exact syntax and structure of this piece
of code.  All I can remember for sure is that when this change was
done I employed some unusual term somewhere... Maybe in a comment.

So I know I used the word `fructification' for some reason and it was
during an addition that was committed but mnths later stripped out.

Now mnths maybe yrs later still, I run into a problem that the old piece
of
code might really suit.

I have no idea what mnth, maybe not even the year it was committed.

With cvs I was able to write a script that literally unwound every
revision starting with what ever revision number I aimed it at, and
put the entire change on stdout, one revision at a time but
essentially a massive out pouring of text.

My homeboy I script would filter through that with awk, which I could
make retain each revision number until it rolled over, and If I got a
hit on `fructificaiton', awk would spit out the matching version and
the line containing my hit.

Of course from there, I could make cvs spit the entire script for that
revision to study.

With the big difference in subversion of creating a revision for each
change to the entire repository, a file may remain unchanged for any
number of revisions.  

So my approach above would lead to massive unnecessary grepping where
the script didn't actually change.

I'm guessing there is some way other than revision numbers to be able to
home in on only those revisions where changes to scriptX were made.
And therefore the possibility of doing something very similar in
subversion using shell tools if need be, but some better way than just
unwinding 19,000 revisions looking for a keyword, when 18,950 are the
same.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageI
d=1023599

To unsubscribe from this discussion, e-mail:
[users-unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1024335

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: Retrieving all revisions with changes present

Posted by Paul Koning <Pa...@dell.com>.
>>>>> "Harry" == Harry Putnam <re...@newsguy.com> writes:

 Harry> As someone about to switch from cvs to svn, I want to know how
 Harry> to do something like what I will describe, using svn.

 Harry> ...With cvs I was able to write a script that literally unwound
 Harry> every revision starting with what ever revision number I aimed
 Harry> it at, and put the entire change on stdout, one revision at a
 Harry> time but essentially a massive out pouring of text.

 Harry> ...With the big difference in subversion of creating a revision
 Harry> for each change to the entire repository, a file may remain
 Harry> unchanged for any number of revisions.

 Harry> So my approach above would lead to massive unnecessary
 Harry> grepping where the script didn't actually change.

 Harry> I'm guessing there is some way other than revision numbers to
 Harry> be able to home in on only those revisions where changes to
 Harry> scriptX were made. 

Exactly.  If you ask Subversion for the log of a particular file (or
directory) it will list only the revisions for which that file (or
that subtree, if a directory) was touched.  So you might see something
like:

# svn log foo/bar/baz/scriptX
---
r92501  | fred | ...
Change it to do xyz
---
r4242   | mel |
Rewrote the init code not to use a jump instruction
---
r18 | bill |
Initial version

	paul

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1024441

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].