You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Weintraub <qa...@gmail.com> on 2005/06/30 15:30:45 UTC

Possible bug in "svn getprop --revprop" command

Just want to verify that this is a bug before I log it.

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.

--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


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

Posted by "C. Michael Pilato" <cm...@collab.net>.
kfogel@collab.net writes:

> "C. Michael Pilato" <cm...@collab.net> writes:
> > It's not exactly a bug in the sense yoy mean.  --revprop is for
> > revision props, and -t isn't a revision, so I would expect the
> > combination of the two not to work.  I would, however, expect that the
> > program would tell you about the illegal combination of options.
> > Additionally, it's just a pointless limitation.  The option should be
> > called --rev-or-txn-prop or something, and should work with either -r
> > or -t.
> 
> Yeah, there is some language weirdness going on here, but we have sort
> of been using "revprop" to mean "the unversioned properties attached
> to a revision or transaction".  I'm happy to deprecate the old option
> name and use a new one if you want, but in any case, it should work
> with txns as well as revisions (which it now does, since r15203).

No, I thought more about this, and decided the change was unnecessary.
If anything, perhaps --unversioned-props would be appropriate and
consistent with other communications (like the Book, etc.)  But your
tweak to the option's usage string is *plenty* helpful to users.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by kf...@collab.net.
"C. Michael Pilato" <cm...@collab.net> writes:
> It's not exactly a bug in the sense yoy mean.  --revprop is for
> revision props, and -t isn't a revision, so I would expect the
> combination of the two not to work.  I would, however, expect that the
> program would tell you about the illegal combination of options.
> Additionally, it's just a pointless limitation.  The option should be
> called --rev-or-txn-prop or something, and should work with either -r
> or -t.

Yeah, there is some language weirdness going on here, but we have sort
of been using "revprop" to mean "the unversioned properties attached
to a revision or transaction".  I'm happy to deprecate the old option
name and use a new one if you want, but in any case, it should work
with txns as well as revisions (which it now does, since r15203).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by "C. Michael Pilato" <cm...@collab.net>.
David Weintraub <qa...@gmail.com> writes:

> Just want to verify that this is a bug before I log it.
> 
> 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.

It's not exactly a bug in the sense yoy mean.  --revprop is for
revision props, and -t isn't a revision, so I would expect the
combination of the two not to work.  I would, however, expect that the
program would tell you about the illegal combination of options.
Additionally, it's just a pointless limitation.  The option should be
called --rev-or-txn-prop or something, and should work with either -r
or -t.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by David Weintraub <qa...@gmail.com>.
On 01 Jul 2005 13:11:13 -0500, kfogel@collab.net <kf...@collab.net> wrote:
> David Weintraub <qa...@gmail.com> writes:
> > Right now, I'm having fun with revision properties. I originally wrote
> > a hook script to help verify that certain revision properties were set
> > on the commit and were formatted correctly. Unfortunately, it wasn't
> > until after I finished my hook script that I realized you can't set
> > revision properties on a commit transaction. (There's defect 1976
> > against this, but no one is currently working on it).
> 
> Yeah.  You can still do it, of course, but you'd have to write a
> program against the svn libraries, or via the bindings, which is
> harder than having a command to do it.

Can't do it in the bindings. Already tried. In fact, there is nothing
in the client library about setting the revision properties and
there's no place where it can be stored.

There is one spot in the commit command where revision bindings are
being stored, but it is only for the svn:log, svn:date, and svn:author
revprops.

The easiest place to set the revision bindings would be rewriting the
commit transaction to accept more command line parameters where
revprops could be set.

Hmmm. It might be possible via the bindings to set revision properties
*AFTER* the commit was completed since I could easily find the
revision number at that point. Then use the bindings to set the
revision properties.

> 
> > There is also a need to have a way of listing revision properties --
> > maybe through a command line switch in the "svn log" command. After
> > all, "svn log" already lists the revision properties svn:log,
> > svn:date, and svn:author.
> 
> 'svn proplist --revprop -rXXX ...'

Except that I can't easily search for a particular revision property
value like I can search to see a particular svn:log entry or all the
revisions committed by a particular user. It would be nice to be able
to search all revisions where a particular defect was fixed without
having to query all revisions. I may have to execute "svn proplist
-revprop" thousands of times.

In fact, querying properties in general is hard in Subversion since
you can't get that information with a single command. It would be so
nice to be able to get all properties and revision properties via the
svn log command since that's a pretty fast command.

--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


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

Posted by kf...@collab.net.
David Weintraub <qa...@gmail.com> writes:
> Right now, I'm having fun with revision properties. I originally wrote
> a hook script to help verify that certain revision properties were set
> on the commit and were formatted correctly. Unfortunately, it wasn't
> until after I finished my hook script that I realized you can't set
> revision properties on a commit transaction. (There's defect 1976
> against this, but no one is currently working on it).

Yeah.  You can still do it, of course, but you'd have to write a
program against the svn libraries, or via the bindings, which is
harder than having a command to do it.

> There is also a need to have a way of listing revision properties --
> maybe through a command line switch in the "svn log" command. After
> all, "svn log" already lists the revision properties svn:log,
> svn:date, and svn:author.

'svn proplist --revprop -rXXX ...'

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by David Weintraub <qa...@gmail.com>.
Thanks for all of your help. I'm pretty new to Subversion and am
pretty much testing the limits of what can be done with it.

Right now, I'm having fun with revision properties. I originally wrote
a hook script to help verify that certain revision properties were set
on the commit and were formatted correctly. Unfortunately, it wasn't
until after I finished my hook script that I realized you can't set
revision properties on a commit transaction. (There's defect 1976
against this, but no one is currently working on it).

There is also a need to have a way of listing revision properties --
maybe through a command line switch in the "svn log" command. After
all, "svn log" already lists the revision properties svn:log,
svn:date, and svn:author.

Again, thank you for your work.

--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


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

Posted by kf...@collab.net.
David Weintraub <qa...@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 <qa...@gmail.com> for the report, at
http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=102054

   From: David Weintraub <qa...@gmail.com>
   Subject: Possible bug in "svn getprop --revprop" command
   Date: Thu, 30 Jun 2005 11:30:45 -0400
   Message-ID: <e1...@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