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

Re: Possible bug in "svn getprop --revprop" command

From: <kfogel_at_collab.net>
Date: 2005-06-30 20:10:45 CEST

David Weintraub <qazwart@gmail.com> writes:
> Just want to verify that this is a bug before I log it.

No need, fixed :-). See patch below. I'm running 'make check' before
committing, but I'm pretty sure this does the trick.
 
> I am attempting to check the value of "svn:log" at the time of the
> commit transaction via the svnlook command. I want to reject it if it
> doesn't match a predetermined string or regex. (Yes, I know I could
> simply do a "svnlook -t $TXN log" instead of an "svnlook propget
> --revprop -t $TXN", but it's a long story why I am doing it this
> way).
>
> When I run the command:
>
> /usr/bin/svnlook propget --revprop -t 0-1 /home/weintraub/respos svn:log
>
> I get:
>
> svnlook: No such revision -1
>
> Although this command succeeds:
>
> /usr/bin/svnlook propget -t 0-1 /home/weintraub/repos svn:keywords utilmenu
>
> It appears that the "svnlook propget --revprop" command is ignoring
> whether I use either a "-r" or "-t" command parameter, and just
> assumes that I am always referring to a revision number.

Here's the patch.

[[[
Fix bug whereby 'svnlook propget --revprop -t TXN' didn't work.

* subversion/svnlook/main.c
  (options_table): Mention that --revprop works with -t as well as -r.
  (do_pget): Call get_property(), so we can get revprops from both
  revisions and txns.

Thanks to David Weintraub <qazwart@gmail.com> for the report, at
http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=102054

   From: David Weintraub <qazwart@gmail.com>
   Subject: Possible bug in "svn getprop --revprop" command
   Date: Thu, 30 Jun 2005 11:30:45 -0400
   Message-ID: <e1823467050630083034f00e32@mail.gmail.com>
]]]

Index: subversion/svnlook/main.c
===================================================================
--- subversion/svnlook/main.c (revision 15201)
+++ subversion/svnlook/main.c (working copy)
@@ -119,7 +119,7 @@
      N_("print differences against the copy source")},
 
     {"revprop", svnlook__revprop_opt, 0,
- N_("operate on a revision property (use with -r)")},
+ N_("operate on a revision property (use with -r or -t)")},
 
     {"full-paths", svnlook__full_paths, 0,
      N_("show full paths instead of indenting them")},
@@ -1513,7 +1513,7 @@
       SVN_ERR (svn_fs_node_prop (&prop, root, path, propname, pool));
     }
   else
- SVN_ERR (svn_fs_revision_prop (&prop, c->fs, c->rev_id, propname, pool));
+ SVN_ERR (get_property (&prop, c, propname, pool));
 
   if (prop == NULL)
     {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jun 30 21:18:17 2005

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