You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2011/12/23 01:31:52 UTC

svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Author: stsp
Date: Fri Dec 23 00:31:51 2011
New Revision: 1222521

URL: http://svn.apache.org/viewvc?rev=1222521&view=rev
Log:
Turn another wc-db assertion people are reporting into a normal error.

* subversion/libsvn_wc/wc_db.c
  (read_children_info): If a node from an unexpected repository is found,
   don't assert but print an informative error message.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1222521&r1=1222520&r2=1222521&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Dec 23 00:31:51 2011
@@ -7231,7 +7231,7 @@ read_children_info(void *baton,
   svn_boolean_t have_row;
   const char *repos_root_url = NULL;
   const char *repos_uuid = NULL;
-  apr_int64_t last_repos_id;
+  apr_int64_t last_repos_id = INVALID_REPOS_ID;
   apr_hash_t *nodes = rci->nodes;
   apr_hash_t *conflicts = rci->conflicts;
   apr_pool_t *result_pool = rci->result_pool;
@@ -7299,20 +7299,54 @@ read_children_info(void *baton,
             }
           else
             {
+              const char *last_repos_root_url = NULL;
+              const char *last_repos_uuid = NULL;
+
               apr_int64_t repos_id = svn_sqlite__column_int64(stmt, 1);
-              if (!repos_root_url)
+              if (!repos_root_url ||
+                  (last_repos_id != INVALID_REPOS_ID &&
+                   repos_id != last_repos_id))
                 {
+                  last_repos_root_url = repos_root_url;
+                  last_repos_uuid = repos_uuid;
                   err = fetch_repos_info(&repos_root_url, &repos_uuid,
                                          wcroot->sdb, repos_id, result_pool);
                   if (err)
                     SVN_ERR(svn_error_compose_create(err,
-                                                     svn_sqlite__reset(stmt)));
-                  last_repos_id = repos_id;
+                                                 svn_sqlite__reset(stmt)));
                 }
 
+              if (last_repos_id == INVALID_REPOS_ID)
+                last_repos_id = repos_id;
+
               /* Assume working copy is all one repos_id so that a
                  single cached value is sufficient. */
-              SVN_ERR_ASSERT(repos_id == last_repos_id);
+              if (repos_id != last_repos_id)
+                return svn_error_createf(
+                         SVN_ERR_WC_DB_ERROR, NULL,
+                         _("The node '%s' comes from unexpected repository "
+                           "(ID '%" APR_INT64_T_FMT "'%s%s, expected ID '%"
+                           APR_INT64_T_FMT"'%s%s); this could be a "
+                           "misconfigured file-external which points to a "
+                           "foreign repository"),
+                         child_relpath, repos_id,
+                         repos_root_url
+                           ? apr_psprintf(scratch_pool, ", URL '%s'",
+                                          repos_root_url)
+                           : "",
+                         repos_uuid
+                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
+                                          repos_uuid)
+                           : "",
+                         last_repos_id,
+                         last_repos_root_url
+                           ? apr_psprintf(scratch_pool, ", URL '%s'",
+                                          last_repos_root_url)
+                           : "",
+                         last_repos_uuid
+                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
+                                          last_repos_uuid)
+                           : "");
               child->repos_root_url = repos_root_url;
               child->repos_uuid = repos_uuid;
             }



Re: svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Dec 23, 2011 at 11:25:37AM +0100, Stefan Sperling wrote:
> On Fri, Dec 23, 2011 at 10:40:59AM +0400, Konstantin Kolinko wrote:
> > I would say that URL and UUID should be enough.
> 
> The repos_id is useful information for developers trying to help users
> with debugging the issue. The message only appears if a bug in Subversion
> is triggered. It was an assertion before this commit for a reason.

The problem is better understood now, see issue #4087.
Turns out that showing the URLs is indeed enough.
I"ve simplified the error message in r1222694.

Re: svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Dec 23, 2011 at 11:25:37AM +0100, Stefan Sperling wrote:
> On Fri, Dec 23, 2011 at 10:40:59AM +0400, Konstantin Kolinko wrote:
> > I would say that URL and UUID should be enough.
> 
> The repos_id is useful information for developers trying to help users
> with debugging the issue. The message only appears if a bug in Subversion
> is triggered. It was an assertion before this commit for a reason.

The problem is better understood now, see issue #4087.
Turns out that showing the URLs is indeed enough.
I"ve simplified the error message in r1222694.

Re: svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Dec 23, 2011 at 10:40:59AM +0400, Konstantin Kolinko wrote:
> 2011/12/23 Hyrum K Wright <hy...@wandisco.com>:
> > Yikes!  I think this wins the prize for "longest function call".
> > Perhaps a helper function or at least some temporary variables would
> > be in order?

I look into that, sure.


> I would say that the message is not friendly to translators.

That's right. For usual error messages I would care.
In this case I'm not sure though if it is very important to translate
the message. This is meant to help us with debugging.
Maybe we should not mark it for translation.
We'll end up asking people to set LC_ALL=C anyway if we don't recognize
the translated message (though we could probably recognize it quite
easily even if it was translated :)

> Those repos_id, last_repos_id -- are they needed in a message
> displayed to an user?
>
> I would say that URL and UUID should be enough.

The repos_id is useful information for developers trying to help users
with debugging the issue. The message only appears if a bug in Subversion
is triggered. It was an assertion before this commit for a reason.

Re: svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Dec 23, 2011 at 10:40:59AM +0400, Konstantin Kolinko wrote:
> 2011/12/23 Hyrum K Wright <hy...@wandisco.com>:
> > Yikes!  I think this wins the prize for "longest function call".
> > Perhaps a helper function or at least some temporary variables would
> > be in order?

I look into that, sure.


> I would say that the message is not friendly to translators.

That's right. For usual error messages I would care.
In this case I'm not sure though if it is very important to translate
the message. This is meant to help us with debugging.
Maybe we should not mark it for translation.
We'll end up asking people to set LC_ALL=C anyway if we don't recognize
the translated message (though we could probably recognize it quite
easily even if it was translated :)

> Those repos_id, last_repos_id -- are they needed in a message
> displayed to an user?
>
> I would say that URL and UUID should be enough.

The repos_id is useful information for developers trying to help users
with debugging the issue. The message only appears if a bug in Subversion
is triggered. It was an assertion before this commit for a reason.

Re: svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/12/23 Hyrum K Wright <hy...@wandisco.com>:
> On Thu, Dec 22, 2011 at 6:31 PM,  <st...@apache.org> wrote:
>> Author: stsp
>> Date: Fri Dec 23 00:31:51 2011
>> New Revision: 1222521
>>
>> URL: http://svn.apache.org/viewvc?rev=1222521&view=rev
>> Log:
>> Turn another wc-db assertion people are reporting into a normal error.
>>
>> * subversion/libsvn_wc/wc_db.c
>>  (read_children_info): If a node from an unexpected repository is found,
>>   don't assert but print an informative error message.
>>
>> Modified:
>>    subversion/trunk/subversion/libsvn_wc/wc_db.c
>>
>> Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1222521&r1=1222520&r2=1222521&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
>> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Dec 23 00:31:51 2011
>> @@ -7231,7 +7231,7 @@ read_children_info(void *baton,
>>   svn_boolean_t have_row;
>>   const char *repos_root_url = NULL;
>>   const char *repos_uuid = NULL;
>> -  apr_int64_t last_repos_id;
>> +  apr_int64_t last_repos_id = INVALID_REPOS_ID;
>>   apr_hash_t *nodes = rci->nodes;
>>   apr_hash_t *conflicts = rci->conflicts;
>>   apr_pool_t *result_pool = rci->result_pool;
>> @@ -7299,20 +7299,54 @@ read_children_info(void *baton,
>>             }
>>           else
>>             {
>> +              const char *last_repos_root_url = NULL;
>> +              const char *last_repos_uuid = NULL;
>> +
>>               apr_int64_t repos_id = svn_sqlite__column_int64(stmt, 1);
>> -              if (!repos_root_url)
>> +              if (!repos_root_url ||
>> +                  (last_repos_id != INVALID_REPOS_ID &&
>> +                   repos_id != last_repos_id))
>>                 {
>> +                  last_repos_root_url = repos_root_url;
>> +                  last_repos_uuid = repos_uuid;
>>                   err = fetch_repos_info(&repos_root_url, &repos_uuid,
>>                                          wcroot->sdb, repos_id, result_pool);
>>                   if (err)
>>                     SVN_ERR(svn_error_compose_create(err,
>> -                                                     svn_sqlite__reset(stmt)));
>> -                  last_repos_id = repos_id;
>> +                                                 svn_sqlite__reset(stmt)));
>>                 }
>>
>> +              if (last_repos_id == INVALID_REPOS_ID)
>> +                last_repos_id = repos_id;
>> +
>>               /* Assume working copy is all one repos_id so that a
>>                  single cached value is sufficient. */
>> -              SVN_ERR_ASSERT(repos_id == last_repos_id);
>> +              if (repos_id != last_repos_id)
>> +                return svn_error_createf(
>> +                         SVN_ERR_WC_DB_ERROR, NULL,
>> +                         _("The node '%s' comes from unexpected repository "
>> +                           "(ID '%" APR_INT64_T_FMT "'%s%s, expected ID '%"
>> +                           APR_INT64_T_FMT"'%s%s); this could be a "
>> +                           "misconfigured file-external which points to a "
>> +                           "foreign repository"),
>> +                         child_relpath, repos_id,
>> +                         repos_root_url
>> +                           ? apr_psprintf(scratch_pool, ", URL '%s'",
>> +                                          repos_root_url)
>> +                           : "",
>> +                         repos_uuid
>> +                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
>> +                                          repos_uuid)
>> +                           : "",
>> +                         last_repos_id,
>> +                         last_repos_root_url
>> +                           ? apr_psprintf(scratch_pool, ", URL '%s'",
>> +                                          last_repos_root_url)
>> +                           : "",
>> +                         last_repos_uuid
>> +                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
>> +                                          last_repos_uuid)
>> +                           : "");
>
> Yikes!  I think this wins the prize for "longest function call".
> Perhaps a helper function or at least some temporary variables would
> be in order?
>

I would say that the message is not friendly to translators.

Those repos_id, last_repos_id -- are they needed in a message
displayed to an user? I would say that URL and UUID should be enough.

I think it would be better to put them into the main message template string.

                         _("The node '%s' comes from unexpected repository "
                           "(URL '%s', UUID '%s', expected URL '%s',
UUID '%s'); "
                           "this could be a "
                           "misconfigured file-external which points to a "
                           "foreign repository"),
    (...)
                         repos_root_url ? repos_root_url : "",


>>               child->repos_root_url = repos_root_url;
>>               child->repos_uuid = repos_uuid;
>>             }
>>

Best regards,
Konstantin Kolinko

Re: svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/12/23 Hyrum K Wright <hy...@wandisco.com>:
> On Thu, Dec 22, 2011 at 6:31 PM,  <st...@apache.org> wrote:
>> Author: stsp
>> Date: Fri Dec 23 00:31:51 2011
>> New Revision: 1222521
>>
>> URL: http://svn.apache.org/viewvc?rev=1222521&view=rev
>> Log:
>> Turn another wc-db assertion people are reporting into a normal error.
>>
>> * subversion/libsvn_wc/wc_db.c
>>  (read_children_info): If a node from an unexpected repository is found,
>>   don't assert but print an informative error message.
>>
>> Modified:
>>    subversion/trunk/subversion/libsvn_wc/wc_db.c
>>
>> Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
>> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1222521&r1=1222520&r2=1222521&view=diff
>> ==============================================================================
>> --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
>> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Dec 23 00:31:51 2011
>> @@ -7231,7 +7231,7 @@ read_children_info(void *baton,
>>   svn_boolean_t have_row;
>>   const char *repos_root_url = NULL;
>>   const char *repos_uuid = NULL;
>> -  apr_int64_t last_repos_id;
>> +  apr_int64_t last_repos_id = INVALID_REPOS_ID;
>>   apr_hash_t *nodes = rci->nodes;
>>   apr_hash_t *conflicts = rci->conflicts;
>>   apr_pool_t *result_pool = rci->result_pool;
>> @@ -7299,20 +7299,54 @@ read_children_info(void *baton,
>>             }
>>           else
>>             {
>> +              const char *last_repos_root_url = NULL;
>> +              const char *last_repos_uuid = NULL;
>> +
>>               apr_int64_t repos_id = svn_sqlite__column_int64(stmt, 1);
>> -              if (!repos_root_url)
>> +              if (!repos_root_url ||
>> +                  (last_repos_id != INVALID_REPOS_ID &&
>> +                   repos_id != last_repos_id))
>>                 {
>> +                  last_repos_root_url = repos_root_url;
>> +                  last_repos_uuid = repos_uuid;
>>                   err = fetch_repos_info(&repos_root_url, &repos_uuid,
>>                                          wcroot->sdb, repos_id, result_pool);
>>                   if (err)
>>                     SVN_ERR(svn_error_compose_create(err,
>> -                                                     svn_sqlite__reset(stmt)));
>> -                  last_repos_id = repos_id;
>> +                                                 svn_sqlite__reset(stmt)));
>>                 }
>>
>> +              if (last_repos_id == INVALID_REPOS_ID)
>> +                last_repos_id = repos_id;
>> +
>>               /* Assume working copy is all one repos_id so that a
>>                  single cached value is sufficient. */
>> -              SVN_ERR_ASSERT(repos_id == last_repos_id);
>> +              if (repos_id != last_repos_id)
>> +                return svn_error_createf(
>> +                         SVN_ERR_WC_DB_ERROR, NULL,
>> +                         _("The node '%s' comes from unexpected repository "
>> +                           "(ID '%" APR_INT64_T_FMT "'%s%s, expected ID '%"
>> +                           APR_INT64_T_FMT"'%s%s); this could be a "
>> +                           "misconfigured file-external which points to a "
>> +                           "foreign repository"),
>> +                         child_relpath, repos_id,
>> +                         repos_root_url
>> +                           ? apr_psprintf(scratch_pool, ", URL '%s'",
>> +                                          repos_root_url)
>> +                           : "",
>> +                         repos_uuid
>> +                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
>> +                                          repos_uuid)
>> +                           : "",
>> +                         last_repos_id,
>> +                         last_repos_root_url
>> +                           ? apr_psprintf(scratch_pool, ", URL '%s'",
>> +                                          last_repos_root_url)
>> +                           : "",
>> +                         last_repos_uuid
>> +                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
>> +                                          last_repos_uuid)
>> +                           : "");
>
> Yikes!  I think this wins the prize for "longest function call".
> Perhaps a helper function or at least some temporary variables would
> be in order?
>

I would say that the message is not friendly to translators.

Those repos_id, last_repos_id -- are they needed in a message
displayed to an user? I would say that URL and UUID should be enough.

I think it would be better to put them into the main message template string.

                         _("The node '%s' comes from unexpected repository "
                           "(URL '%s', UUID '%s', expected URL '%s',
UUID '%s'); "
                           "this could be a "
                           "misconfigured file-external which points to a "
                           "foreign repository"),
    (...)
                         repos_root_url ? repos_root_url : "",


>>               child->repos_root_url = repos_root_url;
>>               child->repos_uuid = repos_uuid;
>>             }
>>

Best regards,
Konstantin Kolinko

Re: svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Thu, Dec 22, 2011 at 6:31 PM,  <st...@apache.org> wrote:
> Author: stsp
> Date: Fri Dec 23 00:31:51 2011
> New Revision: 1222521
>
> URL: http://svn.apache.org/viewvc?rev=1222521&view=rev
> Log:
> Turn another wc-db assertion people are reporting into a normal error.
>
> * subversion/libsvn_wc/wc_db.c
>  (read_children_info): If a node from an unexpected repository is found,
>   don't assert but print an informative error message.
>
> Modified:
>    subversion/trunk/subversion/libsvn_wc/wc_db.c
>
> Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1222521&r1=1222520&r2=1222521&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Dec 23 00:31:51 2011
> @@ -7231,7 +7231,7 @@ read_children_info(void *baton,
>   svn_boolean_t have_row;
>   const char *repos_root_url = NULL;
>   const char *repos_uuid = NULL;
> -  apr_int64_t last_repos_id;
> +  apr_int64_t last_repos_id = INVALID_REPOS_ID;
>   apr_hash_t *nodes = rci->nodes;
>   apr_hash_t *conflicts = rci->conflicts;
>   apr_pool_t *result_pool = rci->result_pool;
> @@ -7299,20 +7299,54 @@ read_children_info(void *baton,
>             }
>           else
>             {
> +              const char *last_repos_root_url = NULL;
> +              const char *last_repos_uuid = NULL;
> +
>               apr_int64_t repos_id = svn_sqlite__column_int64(stmt, 1);
> -              if (!repos_root_url)
> +              if (!repos_root_url ||
> +                  (last_repos_id != INVALID_REPOS_ID &&
> +                   repos_id != last_repos_id))
>                 {
> +                  last_repos_root_url = repos_root_url;
> +                  last_repos_uuid = repos_uuid;
>                   err = fetch_repos_info(&repos_root_url, &repos_uuid,
>                                          wcroot->sdb, repos_id, result_pool);
>                   if (err)
>                     SVN_ERR(svn_error_compose_create(err,
> -                                                     svn_sqlite__reset(stmt)));
> -                  last_repos_id = repos_id;
> +                                                 svn_sqlite__reset(stmt)));
>                 }
>
> +              if (last_repos_id == INVALID_REPOS_ID)
> +                last_repos_id = repos_id;
> +
>               /* Assume working copy is all one repos_id so that a
>                  single cached value is sufficient. */
> -              SVN_ERR_ASSERT(repos_id == last_repos_id);
> +              if (repos_id != last_repos_id)
> +                return svn_error_createf(
> +                         SVN_ERR_WC_DB_ERROR, NULL,
> +                         _("The node '%s' comes from unexpected repository "
> +                           "(ID '%" APR_INT64_T_FMT "'%s%s, expected ID '%"
> +                           APR_INT64_T_FMT"'%s%s); this could be a "
> +                           "misconfigured file-external which points to a "
> +                           "foreign repository"),
> +                         child_relpath, repos_id,
> +                         repos_root_url
> +                           ? apr_psprintf(scratch_pool, ", URL '%s'",
> +                                          repos_root_url)
> +                           : "",
> +                         repos_uuid
> +                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
> +                                          repos_uuid)
> +                           : "",
> +                         last_repos_id,
> +                         last_repos_root_url
> +                           ? apr_psprintf(scratch_pool, ", URL '%s'",
> +                                          last_repos_root_url)
> +                           : "",
> +                         last_repos_uuid
> +                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
> +                                          last_repos_uuid)
> +                           : "");

Yikes!  I think this wins the prize for "longest function call".
Perhaps a helper function or at least some temporary variables would
be in order?

-Hyrum

>               child->repos_root_url = repos_root_url;
>               child->repos_uuid = repos_uuid;
>             }
>
>



-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/

Re: svn commit: r1222521 - /subversion/trunk/subversion/libsvn_wc/wc_db.c

Posted by Hyrum K Wright <hy...@wandisco.com>.
On Thu, Dec 22, 2011 at 6:31 PM,  <st...@apache.org> wrote:
> Author: stsp
> Date: Fri Dec 23 00:31:51 2011
> New Revision: 1222521
>
> URL: http://svn.apache.org/viewvc?rev=1222521&view=rev
> Log:
> Turn another wc-db assertion people are reporting into a normal error.
>
> * subversion/libsvn_wc/wc_db.c
>  (read_children_info): If a node from an unexpected repository is found,
>   don't assert but print an informative error message.
>
> Modified:
>    subversion/trunk/subversion/libsvn_wc/wc_db.c
>
> Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1222521&r1=1222520&r2=1222521&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Fri Dec 23 00:31:51 2011
> @@ -7231,7 +7231,7 @@ read_children_info(void *baton,
>   svn_boolean_t have_row;
>   const char *repos_root_url = NULL;
>   const char *repos_uuid = NULL;
> -  apr_int64_t last_repos_id;
> +  apr_int64_t last_repos_id = INVALID_REPOS_ID;
>   apr_hash_t *nodes = rci->nodes;
>   apr_hash_t *conflicts = rci->conflicts;
>   apr_pool_t *result_pool = rci->result_pool;
> @@ -7299,20 +7299,54 @@ read_children_info(void *baton,
>             }
>           else
>             {
> +              const char *last_repos_root_url = NULL;
> +              const char *last_repos_uuid = NULL;
> +
>               apr_int64_t repos_id = svn_sqlite__column_int64(stmt, 1);
> -              if (!repos_root_url)
> +              if (!repos_root_url ||
> +                  (last_repos_id != INVALID_REPOS_ID &&
> +                   repos_id != last_repos_id))
>                 {
> +                  last_repos_root_url = repos_root_url;
> +                  last_repos_uuid = repos_uuid;
>                   err = fetch_repos_info(&repos_root_url, &repos_uuid,
>                                          wcroot->sdb, repos_id, result_pool);
>                   if (err)
>                     SVN_ERR(svn_error_compose_create(err,
> -                                                     svn_sqlite__reset(stmt)));
> -                  last_repos_id = repos_id;
> +                                                 svn_sqlite__reset(stmt)));
>                 }
>
> +              if (last_repos_id == INVALID_REPOS_ID)
> +                last_repos_id = repos_id;
> +
>               /* Assume working copy is all one repos_id so that a
>                  single cached value is sufficient. */
> -              SVN_ERR_ASSERT(repos_id == last_repos_id);
> +              if (repos_id != last_repos_id)
> +                return svn_error_createf(
> +                         SVN_ERR_WC_DB_ERROR, NULL,
> +                         _("The node '%s' comes from unexpected repository "
> +                           "(ID '%" APR_INT64_T_FMT "'%s%s, expected ID '%"
> +                           APR_INT64_T_FMT"'%s%s); this could be a "
> +                           "misconfigured file-external which points to a "
> +                           "foreign repository"),
> +                         child_relpath, repos_id,
> +                         repos_root_url
> +                           ? apr_psprintf(scratch_pool, ", URL '%s'",
> +                                          repos_root_url)
> +                           : "",
> +                         repos_uuid
> +                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
> +                                          repos_uuid)
> +                           : "",
> +                         last_repos_id,
> +                         last_repos_root_url
> +                           ? apr_psprintf(scratch_pool, ", URL '%s'",
> +                                          last_repos_root_url)
> +                           : "",
> +                         last_repos_uuid
> +                           ? apr_psprintf(scratch_pool, ", UUID '%s'",
> +                                          last_repos_uuid)
> +                           : "");

Yikes!  I think this wins the prize for "longest function call".
Perhaps a helper function or at least some temporary variables would
be in order?

-Hyrum

>               child->repos_root_url = repos_root_url;
>               child->repos_uuid = repos_uuid;
>             }
>
>



-- 

uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/