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

Re: Equivalent to svn status ...

From: David Weintraub <qazwart_at_gmail.com>
Date: Thu, 31 Jul 2008 11:14:15 -0400

> I have several scenarios where I need to generate a text file
> which contains a list of the files which have been added, deleted or
> modified in a directory. [...] [I] save it [the list of changes] to a file and store it in
> the repository and tag the revision.

I'm not too sure why you need to do this. I need a similar diff
between two versions, but I have a PHP web page that generates it upon
request. You give it two release labels (drop down lists), and it runs
and parses the "svn log" command. The output is almost instantaneous.

Getting a list of release tags is easy with the "svn ls" command. The
big problem I have is getting the actual subversion repository
revision number that was used in producing this tag which takes some
fancy programming footwork and some parsing. However, even that is
pretty fast.

You might consider something similar for producing release notes. That
will save you a bunch of issues with generating these lists and saving
them in your Subversion repository. Plus, you give people the ability
to do diffs between any two releases.

> However, I have several scenarios where I need to generate the same sort of
> list, but in stead of comparing a working directory to the repository, I
> need to compare two working directories. One of these is a staging area and
> is not a working Subversion directory.

There's a MKS command called either dircmp or cmpdir which will do
what you want: Compare two directories. Unfortunately, both
directories must be on the same machine.

Here's a better idea. Make a "staging area" branch. When software is
ready for the staging area, copy it to the staging area branch. Then
you can do a "svn diff" on to get the difference between the staging
area branch, and the current working copy even if the local copy
doesn't have direct access to the staging area.

This also has several advantages: For example, if a particular release
in the staging area is not any good, you can roll back to the previous
release since it is in the Subversion repository. Plus, to update the
staging area, all you would need to do is a "svn revert/svn update".

If you decide to be really fancy, you could even put the "svn
revert/svn update" in a crontab on the staging area machine. Thus,
updating the staging area branch would automatically update the
staging area. As an added bonus, this prevents people from directly
tweaking the staging area because once the crontab runs "svn
revert/svn update" again, they'll lose their changes. People learn
very quickly that they can't "tweak" the staging area without first
putting their changes into Subversion.

--
David Weintraub
qazwart_at_gmail.com
On Thu, Jul 31, 2008 at 9:20 AM, Parrish, Ken <KParrish_at_gomez.com> wrote:
> I am building a configuration management system using Subversion, Nant and
> other tools.  I have several scenarios where I need to generate a text file
> which contains a list of the files which have been added, deleted or
> modified in a directory.  For directories that are under SCC, I use the
> Subversion command 'svn status' immediately prior to a 'commit'.  This
> produces exactly the list that I need.  Save it to a file and store it in
> the repository and tag the revision.
>
>
>
> However, I have several scenarios where I need to generate the same sort of
> list, but in stead of comparing a working directory to the repository, I
> need to compare two working directories.  One of these is a staging area and
> is not a working Subversion directory.
>
>
>
> I have the MKS Korn shell installed on these servers and have experimented
> with the various 'diff' commands.  However, none seem to be able to generate
> a simple list of the files and directories that are different, as is the
> case for 'svn status'.
>
>
>
> Can anyone recommend a command line directory differencing tool that will
> generate a simple list of the files that have been added, deleted and
> modified for two directories?
>
>
>
> Thanks,
>
>
>
> Ken Parrish
>
> Gomez, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-07-31 17:14:40 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.