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

Re: Using properties for grouping file subsets

From: Benjamin Pflugmann <benjamin-svn-usr_at_pflugmann.de>
Date: 2004-02-16 17:13:50 CET


On Fri 2004-02-13 at 19:35:29 -0800, you wrote
> I'm new to subversion, and am looking for an effective way to group
> together particular revisions of files in a project (specifically, to
> associate file x1, x2, ... , xn in revision Y with ID numbers from our
> bug tracker). Previously, our use of CVS led to the less-than-desirable
> inclusion of such info in the commit log messages - while it wasn't hard
> to get the data in, retrieving the set of files that matched this
> required grepping the CVS repository. Reading the subversion docs on
> properties made me think it could be a viable alternative, ala BFS
> attributes - create a single property for this info and search through
> it to get the lists of files. Again, getting the information in is easy
> enough, but how can I get a list of files out via proplist?

Most people solve this use-case the other way around: Use an own
check-in (and therefore revision) for each tracked bug. If you do it
this way, you can query a list of file modified in that revision like
this (done inside a WC of subversion itself):

> svn log -v -q -r5001
  r5001 | rooneg | 2003-02-21 03:58:29 +0100 (Fri, 21 Feb 2003)
  Changed paths:
     A /trunk/subversion/include/svn_cancel.h
     M /trunk/subversion/include/svn_client.h
     M /trunk/subversion/include/svn_delta.h
     M /trunk/subversion/include/svn_error_codes.h
     M /trunk/subversion/include/svn_wc.h
     M /trunk/subversion/libsvn_client/client.h
     M /trunk/subversion/libsvn_client/diff.c
     M /trunk/subversion/libsvn_client/repos_diff.c
     A /trunk/subversion/libsvn_delta/cancel.c
     M /trunk/subversion/libsvn_delta/libsvn_delta.dsp
     M /trunk/subversion/libsvn_wc/diff.c

In other words, the problem of CVS, that it is hard to find which
files where changed with a check-in doesn't really exist in

Whatever, back to your original questions...

> So:
> 1) Is there a way to get a list of files out of proplist that only
> matches a certain property (i.e. not each property per file).

Since proplist lists properties on a node (dir/file), I think it's not
easy to solve the problem without a full scan:

  svn proplist -R . | awk -F"'" '/^Properties/ {p=$2; next;} /svn:executable/ {print p}'

This lists all file in the current WC having svn:executable set. Maybe
there is a better way, but that was the first which came to my mind.

> 2) Are properties indexed to files internally, or might this get very
> slow for larger projects?

AFAIK, no index. It scans all .svn/entries files, I think. Anyhow, it
was "fast enough" in my tries.

> 3) If one of the above two considerations kill this idea, are there any
> alternatives for grouping subsets of the project's files? (tags, for
> instance?)

See above. If you don't have strong reasons to do otherwise, simply
group your check-ins by the bug IDs, i.e. if you fix two bug reports,
check them in separately.



To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Feb 16 18:25:03 2004

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.