You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Robert Kleemann <ro...@oz.net> on 2004/07/03 19:36:24 UTC

efficient "svn log" usage?

Hi guys.  Quickly I have to give you major kudos on svn.  I'm finally
able to ditch all my cvs wrapper scripts that avoid all the
unintuitive command switches.  It's also great to have renaming and
moving built into the system.  While using cvs I had developed a built
in aversion to renaming and moving files (especially directories) and
it actually took some time using svn before that behavior went away.

Here's the problem:

For cvs I had the following wrapper scripts:

cvsdate file-arg
Runs "cvs log" on the specified file.  Parses the log for the most
recent change date and returns that date.

cvsnewest file-list
Runs cvsdate for each file in the file list and returns the most
recent of all those dates.

I used these programs to generate a "latest source date".  cvsnewest
would be passed a list of files that are significant to a particular
distribution target.  This is often incorporated into the distribution
target help information so the user can see what the latests version
of sources the target was built with.  Note: this is different than
the build timestamp wich is just whenever the build occured.  I've
since upgraded these scripts to svn.

svnnewest is often handed hundreds of files which means it can take a
long time to run and use lots of network bandwidth.

My question is: is this the best way to solve this problem?  If you
want to ask svn the question "What is the most recent modification
date in this large group of files?" is this the best way to do it?
Can I speed up this query without doing something unsafe?

Robert.

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

Re: efficient "svn log" usage?

Posted by kf...@collab.net.
Robert Kleemann <ro...@kleemann.org> writes:
> I don't understand this.  When I run the above command I don't get any
> dates at all.

I think someone meant 'svn info' ?

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

Re: efficient "svn log" usage?

Posted by Michael W Thelen <th...@cs.utah.edu>.
* Robert Kleemann <ro...@kleemann.org> [2004-07-06 12:21]:
> > You could use the "last-commit-date" from the status command:
> > svn st -v
> > on your working copy.
> 
> I don't understand this.  When I run the above command I don't get any
> dates at all.
> 
> e.g.
> 
> $ svn st -v ClientAnimator.java
>                60       18 robert       ClientAnimator.java
> $ svn st -v ClientAnimator.java Animator.java
>                60       18 robert       ClientAnimator.java
>                60       18 robert       Animator.java
> $ svn st -v -u ClientAnimator.java Animator.java
>                60       18 robert       ClientAnimator.java
> Status against revision:     67
>                60       18 robert       Animator.java
> Status against revision:     67

I think he may have been referring to the second number in the output,
which gives the last revision in which the item changed (not the date).

-- Mike

-- 
Michael W. Thelen
The reverse side also has a reverse side.
                -- Japanese proverb

Re: efficient "svn log" usage?

Posted by Robert Kleemann <ro...@oz.net>.
> Sorry about that. I got confused with the library API call 
> svn_client_status() which provides that information. But AFAIK the 
> svninfo command gives you the last commit date.

Thanks!  I think this is exactly what I was looking for.  svn info
seems much faster than svn log.  I guess it doesn't access the
repository so the info it gives is correct as of the last svn update.

Robert.

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

Re: efficient "svn log" usage?

Posted by SteveKing <st...@gmx.ch>.
Robert Kleemann wrote:
>>You could use the "last-commit-date" from the status command:
>>svn st -v
>>on your working copy.
> 
> 
> I don't understand this.  When I run the above command I don't get any
> dates at all.
> 
> e.g.
> 
> $ svn st -v ClientAnimator.java
>                60       18 robert       ClientAnimator.java
> $ svn st -v ClientAnimator.java Animator.java
>                60       18 robert       ClientAnimator.java
>                60       18 robert       Animator.java
> $ svn st -v -u ClientAnimator.java Animator.java
>                60       18 robert       ClientAnimator.java
> Status against revision:     67
>                60       18 robert       Animator.java
> Status against revision:     67

Sorry about that. I got confused with the library API call 
svn_client_status() which provides that information. But AFAIK the 
svninfo command gives you the last commit date.

Stefan

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

Re: SVN: Commit older file with date?

Posted by Ben Collins-Sussman <su...@collab.net>.
On Fri, 2004-07-09 at 19:47, FRuG FoREST wrote:

> Is there a way to store files with their original date/times into the
> SVN repository?

Here's a possible trick:

Organize your files into buckets, categorized by original dates.  Then
commit each "bucket" of files in chronological order.  This results in a
bunch of revisions in the repository.  Then you can tweak each
revision's 'svn:date' property, so it *appears* that each bucket of
files was committed on a certain date.  

In other words, because a revision's svn:date property is tweakable, you
can make the "commit times" of the files match the original times.



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

SVN: Commit older file with date?

Posted by FRuG FoREST <fr...@gmail.com>.
SVN: Commit older file with date?

Here's a stumper for me.

I've looked in the FAQ, the online book, and even searched google for
answers.  Can't seem to find an answer to this one.

SITUATION:
I have a collection of files, html, php, etc.. for an older web page
project. The files are dated  Apr'2004, all the way back to May'2000 .
 I would like to keep the original file dates on the files, so I know
the last time I modified them.  In the future, when it's been more
than 9 months last modified, I like to have the reminder to review the
file again. Also, when a group of files have been updated, they all
have similar update times, so I know what was going on when.

I just love Subversion, and would like to move this project to it as
soon as possible, to make it much easier to track changes, who, and when.

I would like to add them to my new SVN Repository called  "myproject".
  But when I import or add them to the project, it saves the 'commit
dates' with the files.

I did figure out that the svn config option "use-commit-times = yes
"  allows the 'checkout' to save the dates, instead of using the
current date/time.

But I can't seem to find an option to save the original dates on the
files during the import process, so when I export, the original dates
are there.

I could to it with properties, and write something to sneak it into a
label /property.  But that won't be easily seen when I do a 'ls -l'.

QUESTION:
Is there a way to store files with their original date/times into the
SVN repository?

Thanks, -FRuG

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

Re: efficient "svn log" usage?

Posted by Robert Kleemann <ro...@kleemann.org>.
> You could use the "last-commit-date" from the status command:
> svn st -v
> on your working copy.

I don't understand this.  When I run the above command I don't get any
dates at all.

e.g.

$ svn st -v ClientAnimator.java
               60       18 robert       ClientAnimator.java
$ svn st -v ClientAnimator.java Animator.java
               60       18 robert       ClientAnimator.java
               60       18 robert       Animator.java
$ svn st -v -u ClientAnimator.java Animator.java
               60       18 robert       ClientAnimator.java
Status against revision:     67
               60       18 robert       Animator.java
Status against revision:     67


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

Re: efficient "svn log" usage?

Posted by Stefan <st...@tigris.org>.
Robert Kleemann wrote:
[snip]
> Here's the problem:
> 
> For cvs I had the following wrapper scripts:
> 
> cvsdate file-arg
> Runs "cvs log" on the specified file.  Parses the log for the most
> recent change date and returns that date.

You could use the "last-commit-date" from the status command:
svn st -v
on your working copy.

> cvsnewest file-list
> Runs cvsdate for each file in the file list and returns the most
> recent of all those dates.

here too: just use the 'svn st -v' to get the last commit time.
Or, if your working copy is not at HEAD, you can use
svn st -v -u
to update the status data with the server.

Stefan

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

Re: efficient "svn log" usage?

Posted by Robert Kleemann <ro...@oz.net>.
I sent this with the wrong "from" address so I'm not sure if it got to
the list.  Sorry if it's a dupe.

At Sat, 03 Jul 2004 13:35:37 -0700,
Robert Kleemann wrote:
> 
> > If I understand correctly, due to the behaviour of svn log, the
> > following will give you what you want:
> > 
> > svn log [file list] | head -2 
> 
> Thanks for the idea.
> 
> svn log [huge file list]
> 
> ...appears to concatenate the log files of each of the files in the
> list.
> 
> e.g. same as
> $ for f in [huge file list] ; do svn log $f ; done
> 
> It doesn't seem to be any faster than running "svn log" on
> the indifidual files.  I'm just running the program.  I haven't
> checked the docs to see what it should do.
> 
> Robert.

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

Re: efficient "svn log" usage?

Posted by Robert Kleemann <ro...@kleemann.org>.
> If I understand correctly, due to the behaviour of svn log, the
> following will give you what you want:
> 
> svn log [file list] | head -2 

Thanks for the idea.

svn log [huge file list]

...appears to concatenate the log files of each of the files in the
list.

e.g. same as
$ for f in [huge file list] ; do svn log $f ; done

It doesn't seem to be any faster than running "svn log" on
the indifidual files.  I'm just running the program.  I haven't
checked the docs to see what it should do.

Robert.

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

Re: efficient "svn log" usage?

Posted by Stefanus Du Toit <sj...@cgl.uwaterloo.ca>.
On Sat, Jul 03, 2004 at 12:36:24PM -0700, Robert Kleemann wrote:
> cvsdate file-arg
> Runs "cvs log" on the specified file.  Parses the log for the most
> recent change date and returns that date.
> 
> cvsnewest file-list
> Runs cvsdate for each file in the file list and returns the most
> recent of all those dates.

If I understand correctly, due to the behaviour of svn log, the
following will give you what you want:

svn log [file list] | head -2 

Thus you don't have to fetch the log separately for each file and sort
it yourself, since this is equivalent to what svn log does (more or
less).

Whether this is the quickest way to find out the most recent date for a
set of files, I don't know. svn info comes to mind, as does svn ls
--verbose.

-- 
Stefanus Du Toit <sj...@cgl.uwaterloo.ca>
  Computer Graphics Lab
  School of Computer Science
  University of Waterloo

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