You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "C. Michael Pilato" <cm...@collab.net> on 2010/03/01 17:20:48 UTC

Re: "svnlook pl --revprop" does not work on transactions?

Olivier Dehon wrote:
> On Sat, 2010-02-27 at 08:43 -0600, Ryan Schmidt wrote:
>> On Feb 27, 2010, at 08:36, Olivier Dehon wrote:
>>> On Fri, 2010-02-26 at 22:15 -0800, Alexey Neyman wrote:
>>>> It seems that I encountered a bug in 'svnlook pl --revprop': it fails with 
>>>> the following message:
>>>>
>>>> $ svnlook pl --revprop -t 10547-86b /svn/test-svn
>>>> svnlook: Invalid revision number '-1'
>>> Looks like you need to use "svnlook info -t" to access the values of the
>>> properties that are going to be set on the revision-to-be (svn:log,
>>> svn:author, ...)
>> Why can't he use "svnlook pl --revprop -t" as he suggested? "svnlook help pl" suggests this should work.
>>
> 
> Agreed, it might be a missing feature. I was just trying to suggest a
> workaround for what the OP wanted to achieve.

This is not an oversight.  Subversion's public interfaces have always split
trees of changes in the repository into two non-overlapping segments:
revisions ("which are sets of tree changes that have been promoted into new,
numbered, revisions by the commit process"), and transactions ("which are
sets of tree changes not yet promoted into revisions").  We believe that the
fact that those "revisions" are just promoted "transactions" (meaning, that
you can still address them by their transaction name) is a bit of an
implementation detail that needn't be revealed through the public interfaces
to Subversion.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: "svnlook pl --revprop" does not work on transactions?

Posted by "C. Michael Pilato" <cm...@collab.net>.
C. Michael Pilato wrote:
> C. Michael Pilato wrote:
>> Ryan Schmidt wrote:
>>>> Did I miss something in the original problem description?  Is that precisely
>>>> what is being attempted here and yet it's not working?
>>> That is my understanding:
>>>
>>> On Fri, 2010-02-26 at 22:15 -0800, Alexey Neyman wrote:
>>>> It seems that I encountered a bug in 'svnlook pl --revprop': it fails with 
>>>> the following message:
>>>>
>>>> $ svnlook pl --revprop -t 10547-86b /svn/test-svn
>>>> svnlook: Invalid revision number '-1'
>>> I can replicate this error message with svn 1.6.9 on Mac OS X. "svnlook
>>> pl -t" works fine, but "svnlook pl --revprop -t" complains that revision number
>>> '-1' is invalid, though I specified a correct in-progress transaction number.
>> Okay -- sorry for the noise, then.  That was my fault for not parsing the
>> conversation correctly.
>>
>> Yes, this I believe this is a bug.  (I'll even grant that using an option
>> named "--revprops" does nothing for the illusion that revisions aren't
>> really just "special transactions".)
> 
> I think the attached patch fixes this, and I plan to commit as much after
> some more testing.

Committed in r917640 and proposed for backport to 1.6.x.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: "svnlook pl --revprop" does not work on transactions?

Posted by Lieven Govaerts <sv...@mobsol.be>.
On Mon, Mar 1, 2010 at 7:42 PM, C. Michael Pilato <cm...@collab.net> wrote:
> C. Michael Pilato wrote:
>> Ryan Schmidt wrote:
>>>> Did I miss something in the original problem description?  Is that precisely
>>>> what is being attempted here and yet it's not working?
>>> That is my understanding:
>>>
>>> On Fri, 2010-02-26 at 22:15 -0800, Alexey Neyman wrote:
>>>> It seems that I encountered a bug in 'svnlook pl --revprop': it fails with
>>>> the following message:
>>>>
>>>> $ svnlook pl --revprop -t 10547-86b /svn/test-svn
>>>> svnlook: Invalid revision number '-1'
>>> I can replicate this error message with svn 1.6.9 on Mac OS X. "svnlook
>>> pl -t" works fine, but "svnlook pl --revprop -t" complains that revision number
>>> '-1' is invalid, though I specified a correct in-progress transaction number.
>>
>> Okay -- sorry for the noise, then.  That was my fault for not parsing the
>> conversation correctly.
>>
>> Yes, this I believe this is a bug.  (I'll even grant that using an option
>> named "--revprops" does nothing for the illusion that revisions aren't
>> really just "special transactions".)
>
> I think the attached patch fixes this, and I plan to commit as much after
> some more testing.
>
> --
> C. Michael Pilato <cm...@collab.net>
> CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
>
> * subversion/svnlook/main.c
>  (do_plist): Correctly handle invocations of 'svnlook plist --revprop' when
>    used with '-t TXN_NAME' instead of '-r REV'.
>
> Reported by: Alexey Neyman <stilor{_AT_}att.net>
> --This line, and those below, will be ignored--
>
> Index: subversion/svnlook/main.c
> ===================================================================
> --- subversion/svnlook/main.c   (revision 916775)
> +++ subversion/svnlook/main.c   (working copy)
> @@ -1685,11 +1685,16 @@
>       SVN_ERR(verify_path(&kind, root, path, pool));
>       SVN_ERR(svn_fs_node_proplist(&props, root, path, pool));
>     }
> -  else
> +  else if (c->is_revision)
>     {
>       SVN_ERR(svn_fs_revision_proplist(&props, c->fs, c->rev_id, pool));
>       revprop = TRUE;
>     }
> +  else
> +    {
> +      SVN_ERR(svn_fs_txn_proplist(&props, c->txn, pool));
> +      revprop = TRUE;
> +    }
>
>   if (xml)
>     {
> @@ -1703,8 +1708,16 @@
>       if (revprop)
>         {
>           /* "<revprops ...>" */
> -          svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "revprops",
> -                                "rev", revstr, NULL);
> +          if (c->is_revision)
> +            {
> +              svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "revprops",
> +                                    "rev", revstr, NULL);
> +            }
> +          else
> +            {
> +              svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "revprops",
> +                                    "txn", c->txn_name, NULL);
> +            }
>         }
He, thanks for also fixing the XML part. I was in fact, working on a
regression test, as none of the svnlook options seem to be tested on
transactions.

I'll commit the test when I'm finished and add it to your backport proposal.

Lieven

Re: "svnlook pl --revprop" does not work on transactions?

Posted by "C. Michael Pilato" <cm...@collab.net>.
C. Michael Pilato wrote:
> Ryan Schmidt wrote:
>>> Did I miss something in the original problem description?  Is that precisely
>>> what is being attempted here and yet it's not working?
>> That is my understanding:
>>
>> On Fri, 2010-02-26 at 22:15 -0800, Alexey Neyman wrote:
>>> It seems that I encountered a bug in 'svnlook pl --revprop': it fails with 
>>> the following message:
>>>
>>> $ svnlook pl --revprop -t 10547-86b /svn/test-svn
>>> svnlook: Invalid revision number '-1'
>> I can replicate this error message with svn 1.6.9 on Mac OS X. "svnlook
>> pl -t" works fine, but "svnlook pl --revprop -t" complains that revision number
>> '-1' is invalid, though I specified a correct in-progress transaction number.
> 
> Okay -- sorry for the noise, then.  That was my fault for not parsing the
> conversation correctly.
> 
> Yes, this I believe this is a bug.  (I'll even grant that using an option
> named "--revprops" does nothing for the illusion that revisions aren't
> really just "special transactions".)

I think the attached patch fixes this, and I plan to commit as much after
some more testing.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Re: "svnlook pl --revprop" does not work on transactions?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Ryan Schmidt wrote:
>> Did I miss something in the original problem description?  Is that precisely
>> what is being attempted here and yet it's not working?
> 
> That is my understanding:
> 
> On Fri, 2010-02-26 at 22:15 -0800, Alexey Neyman wrote:
>> It seems that I encountered a bug in 'svnlook pl --revprop': it fails with 
>> the following message:
>>
>> $ svnlook pl --revprop -t 10547-86b /svn/test-svn
>> svnlook: Invalid revision number '-1'
> 
> I can replicate this error message with svn 1.6.9 on Mac OS X. "svnlook
> pl -t" works fine, but "svnlook pl --revprop -t" complains that revision number
> '-1' is invalid, though I specified a correct in-progress transaction number.

Okay -- sorry for the noise, then.  That was my fault for not parsing the
conversation correctly.

Yes, this I believe this is a bug.  (I'll even grant that using an option
named "--revprops" does nothing for the illusion that revisions aren't
really just "special transactions".)

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: "svnlook pl --revprop" does not work on transactions?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 1, 2010, at 11:53, C. Michael Pilato wrote:
> Ryan Schmidt wrote:
>> So you're saying "svnlook pl --revprop -t" is not meant to work? If that's correct, how are we meant to know this from the output of "svnlook help pl" (which I'll show again) which clearly states that "--revprop" may be used with either "-r" or "-t"?
> 
> No, I'm saying that 'svnlook pl --revprop -t TXN_NAME' is expected to work
> only if TXN_NAME is the name of an uncommitted transaction.

Well naturally. :)


> Did I miss something in the original problem description?  Is that precisely
> what is being attempted here and yet it's not working?

That is my understanding:

On Fri, 2010-02-26 at 22:15 -0800, Alexey Neyman wrote:
> It seems that I encountered a bug in 'svnlook pl --revprop': it fails with 
> the following message:
> 
> $ svnlook pl --revprop -t 10547-86b /svn/test-svn
> svnlook: Invalid revision number '-1'

I can replicate this error message with svn 1.6.9 on Mac OS X. "svnlook pl -t" works fine, but "svnlook pl --revprop -t" complains that revision number '-1' is invalid, though I specified a correct in-progress transaction number.


This pre-commit hook demonstrates the problem:


#!/bin/sh

REPO="$1"
TXN="$2"

SVNLOOK=/opt/local/bin/svnlook

$SVNLOOK pl --revprop -t "$TXN" "$REPO" 1>&2

exit 1


Re: "svnlook pl --revprop" does not work on transactions?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Ryan Schmidt wrote:
> On Mar 1, 2010, at 11:20, C. Michael Pilato wrote:
>> Olivier Dehon wrote:
>>> On Sat, 2010-02-27 at 08:43 -0600, Ryan Schmidt wrote:
>>>> Why can't he use "svnlook pl --revprop -t" as he suggested? "svnlook help pl" suggests this should work.
>>> Agreed, it might be a missing feature. I was just trying to suggest a
>>> workaround for what the OP wanted to achieve.
>> This is not an oversight.  Subversion's public interfaces have always split
>> trees of changes in the repository into two non-overlapping segments:
>> revisions ("which are sets of tree changes that have been promoted into new,
>> numbered, revisions by the commit process"), and transactions ("which are
>> sets of tree changes not yet promoted into revisions").  We believe that the
>> fact that those "revisions" are just promoted "transactions" (meaning, that
>> you can still address them by their transaction name) is a bit of an
>> implementation detail that needn't be revealed through the public interfaces
>> to Subversion.
> 
> So you're saying "svnlook pl --revprop -t" is not meant to work? If that's correct, how are we meant to know this from the output of "svnlook help pl" (which I'll show again) which clearly states that "--revprop" may be used with either "-r" or "-t"?

No, I'm saying that 'svnlook pl --revprop -t TXN_NAME' is expected to work
only if TXN_NAME is the name of an uncommitted transaction.

Did I miss something in the original problem description?  Is that precisely
what is being attempted here and yet it's not working?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: "svnlook pl --revprop" does not work on transactions?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 1, 2010, at 11:20, C. Michael Pilato wrote:
> Olivier Dehon wrote:
>> On Sat, 2010-02-27 at 08:43 -0600, Ryan Schmidt wrote:
>>> Why can't he use "svnlook pl --revprop -t" as he suggested? "svnlook help pl" suggests this should work.
>> 
>> Agreed, it might be a missing feature. I was just trying to suggest a
>> workaround for what the OP wanted to achieve.
> 
> This is not an oversight.  Subversion's public interfaces have always split
> trees of changes in the repository into two non-overlapping segments:
> revisions ("which are sets of tree changes that have been promoted into new,
> numbered, revisions by the commit process"), and transactions ("which are
> sets of tree changes not yet promoted into revisions").  We believe that the
> fact that those "revisions" are just promoted "transactions" (meaning, that
> you can still address them by their transaction name) is a bit of an
> implementation detail that needn't be revealed through the public interfaces
> to Subversion.

So you're saying "svnlook pl --revprop -t" is not meant to work? If that's correct, how are we meant to know this from the output of "svnlook help pl" (which I'll show again) which clearly states that "--revprop" may be used with either "-r" or "-t"?


$ svnlook help pl
proplist (plist, pl): usage: 1. svnlook proplist REPOS_PATH PATH_IN_REPOS
                             2. svnlook proplist --revprop REPOS_PATH

List the properties of a path in the repository, or
with the --revprop option, revision properties.
With -v, show the property values too.

Valid options:
  -r [--revision] ARG      : specify revision number ARG
  -t [--transaction] ARG   : specify transaction name ARG
  -v [--verbose]           : be verbose
  --revprop                : operate on a revision property (use with -r or -t)
  --xml                    : output in XML