[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: From a cvs user... about revisions

From: Ryan Schmidt <subversion-2009b_at_ryandesign.com>
Date: Sun, 11 Oct 2009 21:20:24 -0500

On Oct 11, 2009, at 10:56, Harry Putnam wrote:

> Pat Farrell writes:
>
>> But the log for each file has the revision history for that file, its
>> just that the number will not go up by one for each change to the
>> file.
>>
>> Use the 'svn log <file>" command to show the history of the <file>
>> and you will see the specific revision numbers, just use that in
>> the SVN
>> command
>
>> Here is a live snippet of one log of one of my files
>>
>> ------------------------------------------------------------------------
>> r4195 | pfarrell | 2009-10-07 00:30:03 -0400 (Wed, 07 Oct 2009) | 1
>> line
>>
>> create Pat private branch
>> ------------------------------------------------------------------------
>> r4024 | pfarrell | 2009-10-01 02:02:04 -0400 (Thu, 01 Oct 2009) | 2
>> lines
>>
>> use safeForwardToView()
>>
>> ------------------------------------------------------------------------
>> r3990 | pfarrell | 2009-09-29 14:29:16 -0400 (Tue, 29 Sep 2009) | 3
>> lines
>>
>> add subdirectory 'closed/' to urls that we expect to access when
>> logged in.
>>
>
>> so if you want revision -r 3990, that's the one to use
>
> Thanks ... good info. It appears that you may have actually made log
> entries during commit...

It's a pretty essential thing to do, IMHO. You should get into the
habit of doing so as well.

> if you hadn't would it still be easy to find a
> change?

Well, that depends on how you would identify the change. If you know
it's three changes ago in this file, then you can use "svn log
FILENAME --limit 3" to see the last three log messages and their
revision numbers (e.g. above: r4195, r4024, r3990); pick the last
revision number and examine the diff (e.g. "svn diff FILENAME -c 3990").

You can also add path information to the log with "svn log -v
FILENAME"; that can help you decide if the change is the one you're
looking for.

I often like to use "svn blame FILENAME" to see, for each line of the
file, which revision last changed it, because often I'm trying to
identify why a particular line is in a file. Sometimes the last change
isn't relevant -- let's say "svn blame FILENAME" shows me my line of
interest was last modified in r3310 but "svn diff FILENAME -c 3310"
shows that this was only an inconsequential change in the file's
whitespace. Then I just look at the blame for the previous revision.
"svn blame FILENAME -r 3309" and keep digging back until I find the
reason this line was added.

> I ask because during my cvs usage... I often commit without typing a
> log comment. It can work because I'm the only user... and will often
> be committing something I think is insignificant. But sometimes I'll
> want to look up one of those `insignificant' changes, and will know it
> was within a few commits ago or etc, so can call the revision
> straightaway.
>
> I might say cvs status path/file,,, to see current rev number.. then
>
> cvs diff -r N.N path/file to examine differences or
>
> cvs co -p -r N.N path/file > ~/file
>
> To get the actual revised file on STDOUT and redirect for a thorough
> examination.

If you know the change was within the last 5 changes of this file, you
can do

svn log FILENAME --limit 5

If you didn't write or don't care about log messages, you can remove
that part from the output with

svn log -q FILENAME --limit 5

For each printed revision REV in which the file was changed, you can
examine the differences with

svn diff -c REV path/file

To get the file the way it looked in that reversion for further
examination, you can

svn cat -r REV path/file > ~/file

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-10-12 04:21:16 CEST

This is an archived mail posted to the Subversion Users mailing list.