You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "G. T. Stresen-Reuter" <te...@gmail.com> on 2008/09/09 17:35:00 UTC

svn log xml order differs from non-xml version

Hi,

I'm working on a system that deploys the contents of repositories to  
development servers. I'll be using cURL to update the servers. I was  
hoping to use svn log --xml and XSLT to create the shell scripts  
required to update the servers, but I soon realized that the output  
of paths using svn log --xml does not appear to be in any order. svn  
log (without the --xml option) properly lists the order in which  
files need to be added/deleted, etc.

This issue was reported in 2006 (but maybe not to the right place?)
http://svn.haxx.se/users/archive-2006-04/0949.shtml

Unfortunately, there's no answer to that email (although it seems  
fairly clearly written).

I'm wondering if anyone knows of a workaround, if this is a bug, or  
if the order simply doesn't matter (or if I'm just an idiot and  
missing something obvious).

Thanks in advance.

Ted Stresen-Reuter
http://tedmasterweb.com


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

Re: svn log xml order differs from non-xml version

Posted by Karl Fogel <kf...@red-bean.com>.
"G. T. Stresen-Reuter" <te...@gmail.com> writes:
> Yup, there it is... If only I knew something about programming in C,
> I'd be all over it! Maybe (but probably not), if I get some "free"
> time, I'll take a swing at adding the sort to the xml version and
> submit a patch...

That would be great.  Remember to run the regression tests after making
a change (but before posting it); that often catches unexpected bugs.
It's just done by running 'make check' in the top of your source tree,
after rebuilding.

(I can't believe http://subversion.tigris.org/hacking.html doesn't have
a section on this... there's another patch we could use! :-) ).

-Karl

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

Re: svn log xml order differs from non-xml version

Posted by "G. T. Stresen-Reuter" <te...@gmail.com>.
On Sep 10, 2008, at 4:40 AM, Karl Fogel wrote:

> "G. T. Stresen-Reuter" <te...@gmail.com> writes:
>> But just out of curiosity, does anyone know where in the source code
>> the XML is generated? Maybe this is something that can be
>> standardized and incorporated into a future version?
>
> https://svn.collab.net/repos/svn/trunk/subversion/svn/log-cmd.c, in  
> the
> function log_entry_receiver_xml().  You can see where it loops over
> log_entry->changed_paths.  Compare that with the corresponding code in
> log_entry_receiver() (the non-xml log function), which does some  
> sort of
> sort (if you'll pardon the expression).
>
> -Karl

Yup, there it is... If only I knew something about programming in C,  
I'd be all over it! Maybe (but probably not), if I get some "free"  
time, I'll take a swing at adding the sort to the xml version and  
submit a patch...

Thanks again to all who answered.

Ted Stresen-Reuter
http://tedmasterweb.com


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

Re: svn log xml order differs from non-xml version

Posted by Karl Fogel <kf...@red-bean.com>.
"G. T. Stresen-Reuter" <te...@gmail.com> writes:
> But just out of curiosity, does anyone know where in the source code
> the XML is generated? Maybe this is something that can be
> standardized and incorporated into a future version?

https://svn.collab.net/repos/svn/trunk/subversion/svn/log-cmd.c, in the
function log_entry_receiver_xml().  You can see where it loops over
log_entry->changed_paths.  Compare that with the corresponding code in
log_entry_receiver() (the non-xml log function), which does some sort of
sort (if you'll pardon the expression).

-Karl

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

Re: svn log xml order differs from non-xml version

Posted by "G. T. Stresen-Reuter" <te...@gmail.com>.
On Sep 9, 2008, at 9:27 PM, Andy Levy wrote:

> On Tue, Sep 9, 2008 at 16:05, G. T. Stresen-Reuter
> <te...@gmail.com> wrote:
>> On Sep 9, 2008, at 8:28 PM, Hyrum K. Wright wrote:
>>
>>> G. T. Stresen-Reuter wrote:
>>>>
>>>> Hi,
>>>>
>>>> I'm working on a system that deploys the contents of  
>>>> repositories to
>>>> development servers. I'll be using cURL to update the servers. I  
>>>> was
>>>> hoping to use svn log --xml and XSLT to create the shell scripts
>>>> required to update the servers, but I soon realized that the  
>>>> output of
>>>> paths using svn log --xml does not appear to be in any order.  
>>>> svn log
>>>> (without the --xml option) properly lists the order in which  
>>>> files need
>>>> to be added/deleted, etc.
>>>>
>>>> This issue was reported in 2006 (but maybe not to the right place?)
>>>> http://svn.haxx.se/users/archive-2006-04/0949.shtml
>>>>
>>>> Unfortunately, there's no answer to that email (although it  
>>>> seems fairly
>>>> clearly written).
>>>>
>>>> I'm wondering if anyone knows of a workaround, if this is a bug,  
>>>> or if
>>>> the order simply doesn't matter (or if I'm just an idiot and  
>>>> missing
>>>> something obvious).
>>>
>>> Can you provide a specific example?  Perhaps a reproduction  
>>> recipe against
>>> Subversion's own repository?
>>>
>>> Thanks,
>>
>> Happy to oblige. Note that in the non-xml output, build.conf is  
>> the second
>> line, but in the xml output, it is the fifth line. This becomes an  
>> issue for
>> my specific project when updating directories: I can't add files to a
>> directory that hasn't been created yet, so the A /trunk/ 
>> my_directory has to
>> come before A /trunk/my_directory/some_file.txt and that does not  
>> always
>> seem to be the case (unless I'm missing something or just not paying
>> attention).
>
> Given that the non-XML log output appears to be sorted alphabetically,
> and the XML output appears to be unsorted, could you have your XSLT do
> a sort on the child nodes of <paths>, thus achieving the same ordering
> you get in the non-XML log?

Absolutely! All I was missing was the confirmation that the non-XML  
output had a reproducible sort order.

Thank you!!!

But just out of curiosity, does anyone know where in the source code  
the XML is generated? Maybe this is something that can be  
standardized and incorporated into a future version?

Ted S-R
http://tedmasterweb.com


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

Re: svn log xml order differs from non-xml version

Posted by Andy Levy <an...@gmail.com>.
On Tue, Sep 9, 2008 at 16:05, G. T. Stresen-Reuter
<te...@gmail.com> wrote:
> On Sep 9, 2008, at 8:28 PM, Hyrum K. Wright wrote:
>
>> G. T. Stresen-Reuter wrote:
>>>
>>> Hi,
>>>
>>> I'm working on a system that deploys the contents of repositories to
>>> development servers. I'll be using cURL to update the servers. I was
>>> hoping to use svn log --xml and XSLT to create the shell scripts
>>> required to update the servers, but I soon realized that the output of
>>> paths using svn log --xml does not appear to be in any order. svn log
>>> (without the --xml option) properly lists the order in which files need
>>> to be added/deleted, etc.
>>>
>>> This issue was reported in 2006 (but maybe not to the right place?)
>>> http://svn.haxx.se/users/archive-2006-04/0949.shtml
>>>
>>> Unfortunately, there's no answer to that email (although it seems fairly
>>> clearly written).
>>>
>>> I'm wondering if anyone knows of a workaround, if this is a bug, or if
>>> the order simply doesn't matter (or if I'm just an idiot and missing
>>> something obvious).
>>
>> Can you provide a specific example?  Perhaps a reproduction recipe against
>> Subversion's own repository?
>>
>> Thanks,
>
> Happy to oblige. Note that in the non-xml output, build.conf is the second
> line, but in the xml output, it is the fifth line. This becomes an issue for
> my specific project when updating directories: I can't add files to a
> directory that hasn't been created yet, so the A /trunk/my_directory has to
> come before A /trunk/my_directory/some_file.txt and that does not always
> seem to be the case (unless I'm missing something or just not paying
> attention).

Given that the non-XML log output appears to be sorted alphabetically,
and the XML output appears to be unsorted, could you have your XSLT do
a sort on the child nodes of <paths>, thus achieving the same ordering
you get in the non-XML log?

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

Re: svn log xml order differs from non-xml version

Posted by "G. T. Stresen-Reuter" <te...@gmail.com>.
On Sep 9, 2008, at 8:28 PM, Hyrum K. Wright wrote:

> G. T. Stresen-Reuter wrote:
>> Hi,
>>
>> I'm working on a system that deploys the contents of repositories to
>> development servers. I'll be using cURL to update the servers. I was
>> hoping to use svn log --xml and XSLT to create the shell scripts
>> required to update the servers, but I soon realized that the  
>> output of
>> paths using svn log --xml does not appear to be in any order. svn log
>> (without the --xml option) properly lists the order in which files  
>> need
>> to be added/deleted, etc.
>>
>> This issue was reported in 2006 (but maybe not to the right place?)
>> http://svn.haxx.se/users/archive-2006-04/0949.shtml
>>
>> Unfortunately, there's no answer to that email (although it seems  
>> fairly
>> clearly written).
>>
>> I'm wondering if anyone knows of a workaround, if this is a bug,  
>> or if
>> the order simply doesn't matter (or if I'm just an idiot and missing
>> something obvious).
>
> Can you provide a specific example?  Perhaps a reproduction recipe  
> against
> Subversion's own repository?
>
> Thanks,

Happy to oblige. Note that in the non-xml output, build.conf is the  
second line, but in the xml output, it is the fifth line. This  
becomes an issue for my specific project when updating directories: I  
can't add files to a directory that hasn't been created yet, so the  
A /trunk/my_directory has to come before A /trunk/my_directory/ 
some_file.txt and that does not always seem to be the case (unless  
I'm missing something or just not paying attention).

Thanks in advance for taking a look at this.

Sincerely,

Ted S-R
(sample output follows)

$ svn log -r32901 http://svn.collab.net/repos/svn/trunk/ -v -q
------------------------------------------------------------------------
r32901 | julianfoad | 2008-09-04 18:42:49 +0100 (Thu, 04 Sep 2008)
Changed paths:
    M /trunk
    M /trunk/build.conf
    M /trunk/notes/tree-conflicts/requirements.txt
    M /trunk/subversion/include
    M /trunk/subversion/libsvn_ra_neon/commit.c
    M /trunk/subversion/libsvn_ra_serf/commit.c
    M /trunk/subversion/libsvn_repos/commit.c
    M /trunk/subversion/libsvn_subr
    M /trunk/subversion/tests/cmdline/commit_tests.py
    M /trunk/subversion/tests/libsvn_subr
    M /trunk/tools/server-side/svn_server_log_parse.py
    M /trunk/tools/server-side/test_svn_server_log_parse.py
    M /trunk/www/development.html
    M /trunk/www/issue-tracker.html
    M /trunk/www/tasks.html
------------------------------------------------------------------------

$ svn log -r32901 http://svn.collab.net/repos/svn/trunk/ -v -q --xml
<?xml version="1.0"?>
<log>
<logentry
    revision="32901">
<author>julianfoad</author>
<date>2008-09-04T17:42:49.986838Z</date>
<paths>
<path
    action="M">/trunk/subversion/libsvn_repos/commit.c</path>
<path
    action="M">/trunk/subversion/tests/cmdline/commit_tests.py</path>
<path
    action="M">/trunk</path>
<path
    action="M">/trunk/subversion/include</path>
<path
    action="M">/trunk/build.conf</path>
<path
    action="M">/trunk/tools/server-side/test_svn_server_log_parse.py</ 
path>
<path
    action="M">/trunk/tools/server-side/svn_server_log_parse.py</path>
<path
    action="M">/trunk/subversion/libsvn_ra_neon/commit.c</path>
<path
    action="M">/trunk/subversion/libsvn_ra_serf/commit.c</path>
<path
    action="M">/trunk/subversion/libsvn_subr</path>
<path
    action="M">/trunk/www/issue-tracker.html</path>
<path
    action="M">/trunk/subversion/tests/libsvn_subr</path>
<path
    action="M">/trunk/www/development.html</path>
<path
    action="M">/trunk/notes/tree-conflicts/requirements.txt</path>
<path
    action="M">/trunk/www/tasks.html</path>
</paths>
</logentry>
</log>


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

Re: svn log xml order differs from non-xml version

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
G. T. Stresen-Reuter wrote:
> Hi,
> 
> I'm working on a system that deploys the contents of repositories to
> development servers. I'll be using cURL to update the servers. I was
> hoping to use svn log --xml and XSLT to create the shell scripts
> required to update the servers, but I soon realized that the output of
> paths using svn log --xml does not appear to be in any order. svn log
> (without the --xml option) properly lists the order in which files need
> to be added/deleted, etc.
> 
> This issue was reported in 2006 (but maybe not to the right place?)
> http://svn.haxx.se/users/archive-2006-04/0949.shtml
> 
> Unfortunately, there's no answer to that email (although it seems fairly
> clearly written).
> 
> I'm wondering if anyone knows of a workaround, if this is a bug, or if
> the order simply doesn't matter (or if I'm just an idiot and missing
> something obvious).

Can you provide a specific example?  Perhaps a reproduction recipe against
Subversion's own repository?

Thanks,
-Hyrum