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

RE: FW: getting file or directory property/metadata

From: Ren Wang <renwang101_at_gmail.com>
Date: Sun, 29 Nov 2015 02:58:35 -0500

Thank you for the response. I just did a test, svn_fs_node_created_rev()
works great!

-----Original Message-----
From: Daniel Shahaf [mailto:d.s_at_daniel.shahaf.name]
Sent: Saturday, November 28, 2015 12:41 PM
To: Ren Wang <renwang101_at_gmail.com>; dev_at_subversion.apache.org
Cc: users_at_subversion.apache.org
Subject: Re: FW: getting file or directory property/metadata

[moving to dev@; please drop users@ from replies]

Daniel Shahaf wrote on Sat, Nov 28, 2015 at 17:26:52 +0000:
> To be fair, though, the same trick with 'svn info' would have lead you
> to svn_fs_node_created_rev(), which is documented to return "the
> revision in which @a path under @a root was created", but in fact
> returns the revision in which it was last modified.

I think the first sentence of the following docstring is wrong:

    /** Set @a *revision to the revision in which @a path under @a root was
     * created. Use @a pool for any temporary allocations. @a *revision
will
     * be set to #SVN_INVALID_REVNUM for uncommitted nodes (i.e. modified
nodes
     * under a transaction root). Note that the root of an unmodified
transaction
     * is not itself considered to be modified; in that case, return the
revision
     * upon which the transaction was based.
     */
    svn_error_t *
    svn_fs_node_created_rev(svn_revnum_t *revision,

It sounds as though it gives the answer to `svn log --stop-on-copy
--limit=1 -r 0:HEAD path_at_root`, but in fact it gives the "Last Changed
Revision" of path_at_root.

I think we need at least this patch:

    Index: subversion/include/svn_fs.h
    ===================================================================
    --- subversion/include/svn_fs.h (revision 1717002)
    +++ subversion/include/svn_fs.h (working copy)
    @@ -1775,2 +1775,2 @@
    -/** Set @a *revision to the revision in which @a path under @a root was
    - * created. Use @a pool for any temporary allocations. @a *revision
will
    +/** Set @a *revision to the revision in which @a path under @a root was
last
    + * modified. Use @a pool for any temporary allocations. @a *revision
will

I didn't check the sibling functions for analogous docstring bugs.

I can't commit this myself due to an outstanding issue with my apache
account :-(

Cheers,

Daniel
Received on 2015-11-30 00:50:04 CET

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.