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

RE: CIA can't count

From: Dale Worley <dworley_at_pingtel.com>
Date: 2005-03-11 16:05:59 CET

This is related to an issue that I've been having some trouble with. I've
been looking for a programmatic way to get the list of all
version-controlled files in a WC. Someone suggested "svn ls -R", which I
had not thought of. But I discovered some difficulties when trying it out:

- Files and directories aren't distinguished. (This isn't too much of a
problem, as I can test the name within in the WC to differentiate.)

- File names are listed more or less relative to the argument to "svn ls"
and not relative to the current directory when "svn ls" is executed.
Actually, it's a bit more complicated than that:

"svn ls -R ." - lists files and directories relative to CWD.

"svn ls -R dir1" - lists files and directories relative to "dir1". That is,
"dir1/file1" is output as "file1".

"svn ls -R dir2/file2" - lists "dir2/file2".

None of these are unreasonable, especially compared to "svn ls -N", which
just lists the entries in a directory. But they make it difficult to use
"svn ls -R" to turn a user-provided list of WC files/directories into a list
of all the version-controlled elements underneath the list of user-provided
names. (Which is what most svn commands do, and I'd like to replicate in my
scripts.)

Though I hate to suggest it, this problem would be solved simply enough if
"svn ls -R" used a different output convention than "svn ls -N", namely, to
always prefix any output names with the argument which generated it, so it
is valid relative to the CWD when svn was invoked.

Thus, in a WC structure:

dir1/file1
dir1/file1a
dir2/file2
file3

"svn ls -R ." would list: dir1, dir1/file1, dir1/file1a, dir2, dir2/file2,
file3

"svn ls -R dir1" would list: dir1, dir1/file1

"svn ls -R dir1/file1" would: list dir1/file1

But, the same as now:

"svn ls -N ." would list: dir1, dir2, file3

"svn ls -N dir1" would list: file1, file1a

"svn ls -N dir1/file1" would list: file1

Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 11 16:07:24 2005

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

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