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

Re: [PATCH] improve speed of non-verbose svn list, take 2

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-10-27 10:10:56 CEST

On Wed, 26 Oct 2005, Garrett Rooney wrote:

> Ok, so thanks to the great feedback on the first iteration of this
> patch I've now got another version for you guys to take a look at.
>
I haven't check the DAV part.

> Index: subversion/libsvn_ra_svn/protocol
> ===================================================================
> --- subversion/libsvn_ra_svn/protocol (revision 17044)
> +++ subversion/libsvn_ra_svn/protocol (working copy)
> @@ -252,7 +252,8 @@
> whether an error occurred during the sending of the file.
>
> get-dir
> - params: ( path:string [ rev:number ] want-props:bool want-contents:bool )
> + params: ( path:string [ rev:number ] want-props:bool want-contents:bool
> + [ dirent-field:string ... ] )

The last part should read "? ( dirent-field:word ...)".

Even better would be to define:
  dirent-field: size | has-props | WHATEVER | word
and use that. ("word" would allow for future extensibility.)

> response: ( rev:number props:proplist ( entry:dirent ... ) )]
> dirent: ( name:string kind:node-kind size:number has-props:bool
> created-rev:number [ created-date:string ]
> Index: subversion/svnserve/serve.c
> ===================================================================
> --- subversion/svnserve/serve.c (revision 17044)
> +++ subversion/svnserve/serve.c (working copy)
> @@ -1102,30 +1138,48 @@
> file_path = svn_path_join(full_path, name, subpool);
> entry = apr_pcalloc(pool, sizeof(*entry));
>
> - /* kind */
> - entry->kind = fsent->kind;
> + if (dirent_fields & SVN_DIRENT_KIND)
> + {
> + /* kind */
> + entry->kind = fsent->kind;
> + }
>
> - /* size */
> - if (entry->kind == svn_node_dir)
> - entry->size = 0;
> - else
> - SVN_CMD_ERR(svn_fs_file_length(&entry->size, root, file_path,
> - subpool));
> + if (dirent_fields & SVN_DIRENT_SIZE)
> + {
> + /* size */
> + if (entry->kind == svn_node_dir)
> + entry->size = 0;
> + else
> + SVN_CMD_ERR(svn_fs_file_length(&entry->size, root, file_path,
> + subpool));
> + }
>
> - /* has_props */
> - SVN_CMD_ERR(svn_fs_node_proplist(&file_props, root, file_path,
> - subpool));
> - entry->has_props = (apr_hash_count(file_props) > 0) ? TRUE : FALSE;
> + if (dirent_fields & SVN_DIRENT_SIZE)

                                            ^ should be HAS_PROPS

> + {
> + /* has_props */
> + SVN_CMD_ERR(svn_fs_node_proplist(&file_props, root, file_path,
> + subpool));
> + entry->has_props = (apr_hash_count(file_props) > 0) ? TRUE
> + : FALSE;
> + }
>

Else, it looks good to me.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 27 10:11:57 2005

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