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

Re: FW: svn commit: r1185886 - in /subversion/trunk/subversion: libsvn_wc/entries.c tests/cmdline/upgrade_tests.py

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 18 Oct 2011 20:37:55 -0400

Sure. Thanks for the heads up. I'll take a look and respond "good" or
with comments...

On Tue, Oct 18, 2011 at 18:08, Bert Huijben <bert_at_qqmail.nl> wrote:
>        Greg,
>
> If you have some time to spare, could you please review this patch?
>
> I don't think we have a lot of svn_wc_entry_t experts that can review this patch at short notice. This to allow getting it in 1.7.1.
>
> Thanks,
>        Bert
>
>> -----Original Message-----
>> From: rhuijben_at_apache.org [mailto:rhuijben_at_apache.org]
>> Sent: dinsdag 18 oktober 2011 23:45
>> To: commits_at_subversion.apache.org
>> Subject: svn commit: r1185886 - in /subversion/trunk/subversion:
>> libsvn_wc/entries.c tests/cmdline/upgrade_tests.py
>>
>> Author: rhuijben
>> Date: Tue Oct 18 21:45:09 2011
>> New Revision: 1185886
>>
>> URL: http://svn.apache.org/viewvc?rev=1185886&view=rev
>> Log:
>> Make it possible to upgrade server-excluded (or 'absent') nodes from their
>> entries representation. Before this patch server-excluded directories were
>> accidentally upgraded as incomplete directories.
>>
>> * subversion/libsvn_wc/entries.c
>>   (insert_node): Make it possible to write server-excluded presence.
>>   (write_entry): Handle server-excluded like how we handle not-present.
>> This
>>     presence can't be combined with incomplete and there is no subdirectory
>>     with more data which can fill in details later. Absent nodes can't be
>>     shadowed.
>>
>>     Assert earlier code already set the right presence instead of setting the
>>     value again. Copy revision set code from the block that previously handled
>>     absent nodes.
>>
>> * subversion/tests/cmdline/upgrade_tests.py
>>   (upgrade_absent): Remove XFail marking and test that the update doesn't
>>     perform any changes.
>>
>> Modified:
>>     subversion/trunk/subversion/libsvn_wc/entries.c
>>     subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
>>
>> Modified: subversion/trunk/subversion/libsvn_wc/entries.c
>> URL:
>> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entri
>> es.c?rev=1185886&r1=1185885&r2=1185886&view=diff
>> ==========================================================
>> ====================
>> --- subversion/trunk/subversion/libsvn_wc/entries.c (original)
>> +++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Oct 18 21:45:09
>> 2011
>> @@ -1466,6 +1466,8 @@ insert_node(svn_sqlite__db_t *sdb,
>>      SVN_ERR(svn_sqlite__bind_text(stmt, 8, "incomplete"));
>>    else if (node->presence == svn_wc__db_status_excluded)
>>      SVN_ERR(svn_sqlite__bind_text(stmt, 8, "excluded"));
>> +  else if (node->presence == svn_wc__db_status_server_excluded)
>> +    SVN_ERR(svn_sqlite__bind_text(stmt, 8, "absent"));
>>
>>    if (node->kind == svn_node_none)
>>      SVN_ERR(svn_sqlite__bind_text(stmt, 10, "unknown"));
>> @@ -1697,10 +1699,10 @@ write_entry(struct write_baton **entry_n
>>        SVN_ERR_ASSERT(!entry->incomplete);
>>        base_node->presence = svn_wc__db_status_not_present;
>>      }
>> -
>> -  if (entry->absent)
>> +  else if (entry->absent)
>>      {
>> -      SVN_ERR_ASSERT(base_node && !working_node);
>> +      SVN_ERR_ASSERT(base_node && !working_node &&
>> !below_working_node);
>> +      SVN_ERR_ASSERT(!entry->incomplete);
>>        base_node->presence = svn_wc__db_status_server_excluded;
>>      }
>>
>> @@ -1873,9 +1875,22 @@ write_entry(struct write_baton **entry_n
>>
>>        if (entry->deleted)
>>          {
>> -          base_node->presence = svn_wc__db_status_not_present;
>> +          SVN_ERR_ASSERT(base_node->presence ==
>> svn_wc__db_status_not_present);
>> +          /* ### should be svn_node_unknown, but let's store what we have.
>> */
>> +          base_node->kind = entry->kind;
>> +        }
>> +      else if (entry->absent)
>> +        {
>> +          SVN_ERR_ASSERT(base_node->presence
>> +                                == svn_wc__db_status_server_excluded);
>>            /* ### should be svn_node_unknown, but let's store what we have. */
>>            base_node->kind = entry->kind;
>> +
>> +          /* Store the most likely revision in the node to avoid
>> +             base nodes without a valid revision. Of course
>> +             we remember that the data is still incomplete. */
>> +          if (!SVN_IS_VALID_REVNUM(base_node->revision) && parent_node-
>> >base)
>> +            base_node->revision = parent_node->base->revision;
>>          }
>>        else
>>          {
>>
>> Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
>> URL:
>> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/
>> upgrade_tests.py?rev=1185886&r1=1185885&r2=1185886&view=diff
>> ==========================================================
>> ====================
>> --- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
>> +++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Tue Oct
>> 18 21:45:09 2011
>> @@ -1199,36 +1199,40 @@ def upgrade_file_externals(sbox):
>>        })
>>
>>  @Skip(svntest.main.is_ra_type_file)
>> -_at_XFail()
>>  def upgrade_absent(sbox):
>> -  "upgrade absent nodes"
>> -
>> +  "upgrade absent nodes to server-excluded"
>> +
>>    # Install wc and repos
>>    replace_sbox_with_tarfile(sbox, 'upgrade_absent.tar.bz2')
>>    replace_sbox_repo_with_tarfile(sbox, 'upgrade_absent_repos.tar.bz2')
>> -
>> +
>>    # Update config for authz
>>    svntest.main.write_restrictive_svnserve_conf(sbox.repo_dir)
>>    svntest.main.write_authz_file(sbox, { "/"      : "*=rw",
>>                                          "/A/B"   : "*=",
>>                                          "/A/B/E" : "jrandom = rw"})
>> -
>> +
>>    # Attempt to use the working copy, this should give an error
>>    expected_stderr = wc_is_too_old_regex
>>    svntest.actions.run_and_verify_svn(None, None, expected_stderr,
>>                                       'info', sbox.wc_dir)
>> +
>>    # Now upgrade the working copy
>>    svntest.actions.run_and_verify_svn(None, None, [],
>>                                       'upgrade', sbox.wc_dir)
>>
>> -  #
>> +  # Relocate to allow finding the repository
>>    svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
>>                                       'svn://127.0.0.1/authz_tests-2',
>>                                       sbox.repo_url, sbox.wc_dir)
>>
>> -  # This currently fails because the absent node is incorrectly upgraded
>> -  sbox.simple_update()
>> -
>> +  expected_output = svntest.wc.State(sbox.wc_dir, {
>> +  })
>> +
>> +  # Expect no changes and certainly no errors
>> +  svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output,
>> +                                        None, None)
>> +
>>
>> ##########################################################
>> ##############
>>  # Run the tests
>>
>>
>
>
>
Received on 2011-10-19 02:38:28 CEST

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.