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

Re: [PATCH] Move issue 1550 check from svn to svn_client

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: 2007-09-21 02:18:43 CEST

Eric Gillespie <epg@pretzelnet.org> writes:

> Index: subversion/svn/log-cmd.c
> ===================================================================
> --- subversion/svn/log-cmd.c (revision 26666)
> +++ subversion/svn/log-cmd.c (working copy)
> @@ -322,10 +322,7 @@
>
> if (! SVN_IS_VALID_REVNUM(log_entry->revision))
> {
> - svn_xml_make_close_tag(&sb, pool, "logentry");
> - SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
> apr_array_pop(lb->merge_stack);
> -
> return SVN_NO_ERROR;
> }
>

Hyrum was right, this is the wrong change. I added XML test to
merge_sensitive_log_added_path and fixed it properly. Or did I?

Index: log-cmd.c
===================================================================
--- log-cmd.c (revision 26666)
+++ log-cmd.c (working copy)
@@ -322,10 +322,12 @@
 
   if (! SVN_IS_VALID_REVNUM(log_entry->revision))
     {
- svn_xml_make_close_tag(&sb, pool, "logentry");
- SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
- apr_array_pop(lb->merge_stack);
-
+ if (lb->merge_stack->nelts > 0)
+ {
+ svn_xml_make_close_tag(&sb, pool, "logentry");
+ SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout));
+ apr_array_pop(lb->merge_stack);
+ }
       return SVN_NO_ERROR;
     }
 

I think this change is wrong, too, now that I realize we only get
the broken XML for ra-{neon,serf,svn}; ra-local is fine. Here's
what the broken XML looks like (frommerge_sensitive_log_added_path):

<?xml version="1.0"?>
<log>
<logentry
   revision="14">
<author>jrandom</author>
<date>2007-06-07T17:29:48.480221Z</date>
<msg>Merge branches/b to trunk</msg>
</logentry>
<logentry
   revision="12">
<author>jrandom</author>
<date>2007-06-07T17:27:29.282205Z</date>
<msg>Merge branches/a to branches/b</msg>
</logentry>
<logentry
   revision="11">
<author>jrandom</author>
<date>2007-06-07T17:24:53.981098Z</date>
<msg>Added 'xi' to branches/a, made a few other changes.</msg>
</logentry>
</logentry>
</log>

Note the extra </logentry> at the end, which does not appear for
ra-local. Looking at libsvn_repos/log.c:send_logs and
libsvn_ra_svn/client.c:ra_svn_log, I see that the latter sends
SVN_INVALID_REVNUM again at the end:

  /* Send the "end of messages" sentinal. */
  log_entry = svn_log_entry_create(subpool);
  log_entry->revision = SVN_INVALID_REVNUM;
  SVN_ERR(receiver(receiver_baton, log_entry, subpool));

(It's "sentinel", BTW :)

So, my fix above is right if svn_repos_get_logs4 should be
calling the receiver with that final sentinel. But we could also
fix it by dropping the extra sentinel from the other ra modules.
I'm not really sure.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Sep 21 02:18:54 2007

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.