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

Re: The right library...to get info about a directory

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-11-12 20:26:47 CET

Files wrote:
> Julian Foad said:
>
>>>So how mad would everyone get if I added --full/--fullxml flags to ls?
>>
>>What do you propose these flags should do? It might be better to enable XML
>>output (activated by the "--xml" switch) and ensure that the XML output is
>>"full". Note that for "svn log", the XML output already has the full time
>>(not abbreviated).
>
> I want 'svn ls --full' to dump raw directory contents in their entirety.

By "raw", I assume you mean "presented in some complete, unambiguous, machine-readable format".

I still do not know what you mean by "in their entirety". What directory information is available that is not already printed by "svn list"? If you mean that, for each item in the list, all the information that can be obtained about that item should be included (such as the log, the properties, etc.) then I disagree. (And I am talking about a version of "list" that is designed for machine processing, such as an API or an XML output format; not the default text output of "svn list".)

I think that "list" should produce a list of the items in a directory (or perhaps only the specified items), giving for each entry only the information that is essential:

+ the item's name
+ the item's type (file or directory)

That is what "svn list" does without "--verbose".

With "--verbose", it adds the file size which is not primary data (it is a property of the file text), and the details of the last commit which is just a part of the file's history which can be obtained from "log". I do not see those pieces of information as being strictly necessary in a "list" command, though they are handy for a human user to look at. The file size cannot be obtained efficiently from any other command at present, and that may be sufficient justification for it being reported by "list" (in the proposed XML/API output).

If you want to find further details about one or more of the entries, such as details of the last commit, or previous commits, use "log" on that item. If you want the item's text, use "cat"; if you want its properties, use "propget", etc.

If there is some piece of information that is not available, then we can consider making it available somehow. You mentioned that there is some information that "svn info" can show for a local WC item, that would also make sense for a repository item, but I do not know exactly which piece of information that is. The checksum of the file's text?

A concrete, but tentative, proposal from me:

+ "svn list" (without "--verbose") should accept "--xml", and that should cause it to output, in XML format, for each directory entry:
  + the item's name
  + the item's type (file or directory)

+ I don't mind whether "svn list --verbose --xml" will be accepted, but if it is, it should output the same information as "svn list --verbose" but in XML format, with complete, unambiguous data fields.

I don't know how far that would go towards helping you, nor am I offering to implement it.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 12 20:25:50 2003

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