You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2010/08/24 16:13:27 UTC

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

Author: philip
Date: Tue Aug 24 14:13:26 2010
New Revision: 988550

URL: http://svn.apache.org/viewvc?rev=988550&view=rev
Log:
Fix upgrade_tests.py 7 in single-db.

* subversion/libsvn_wc/entries.c
  (insert_working_node): Don't force kind to subdir.
  (write_entry): Make working_node subdirs incomplete initially.

* subversion/tests/cmdline/upgrade_tests.py
  (basic_upgrade_1_0): Check pristines after upgrade.

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/entries.c?rev=988550&r1=988549&r2=988550&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Tue Aug 24 14:13:26 2010
@@ -1718,13 +1718,16 @@ insert_working_node(svn_sqlite__db_t *sd
   else if (working_node->presence == svn_wc__db_status_excluded)
     SVN_ERR(svn_sqlite__bind_text(stmt, 4, "excluded"));
 
+#ifndef SVN_WC__SINGLE_DB
   /* ### in per-subdir operation, if we're about to write a directory and
      ### it is *not* "this dir", then we're writing a row in the parent
      ### directory about the child. note that in the kind.  */
   if (working_node->kind == svn_node_dir
       && *working_node->local_relpath != '\0')
     SVN_ERR(svn_sqlite__bind_text(stmt, 5, "subdir"));
-  else if (working_node->kind == svn_node_none)
+  else
+#endif
+  if (working_node->kind == svn_node_none)
     SVN_ERR(svn_sqlite__bind_text(stmt, 5, "unknown"));
   else
     SVN_ERR(svn_sqlite__bind_text(stmt, 5,
@@ -2171,6 +2174,17 @@ write_entry(svn_wc__db_t *db,
                                        svn_checksum_md5,
                                        entry->checksum, scratch_pool));
 
+#ifdef SVN_WC__SINGLE_DB
+      /* All subdirs start of incomplete, and stop being incomplete
+         when the entries file in the subdir is upgraded. */
+      if (entry->kind == svn_node_dir
+          && strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR))
+        {
+          working_node->presence = svn_wc__db_status_incomplete;
+          working_node->kind = svn_node_dir;
+        }
+      else
+#endif
       if (entry->schedule == svn_wc_schedule_delete)
         {
           if (entry->incomplete)

Modified: subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/upgrade_tests.py?rev=988550&r1=988549&r2=988550&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/upgrade_tests.py Tue Aug 24 14:13:26 2010
@@ -413,6 +413,8 @@ def basic_upgrade_1_0(sbox):
   svntest.actions.run_and_verify_info(expected_infos,
                                       os.path.join(sbox.wc_dir, 'DELETED'))
 
+  check_pristine(sbox, ['iota', 'A/mu', 'A/D/H/zeta'])
+
 # Helper function for the x3 tests.
 def do_x3_upgrade(sbox):
   # Attempt to use the working copy, this should give an error



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

Posted by Philip Martin <ph...@wandisco.com>.
"Bert Huijben" <be...@qqmail.nl> writes:

>> -----Original Message-----
>> From: philip@apache.org [mailto:philip@apache.org]
>> Sent: dinsdag 24 augustus 2010 16:13
>> To: commits@subversion.apache.org
>> Subject: svn commit: r988550 - in /subversion/trunk/subversion:
>> libsvn_wc/entries.c tests/cmdline/upgrade_tests.py
>> 
>> Author: philip
>> Date: Tue Aug 24 14:13:26 2010
>> New Revision: 988550
>> 
>> URL: http://svn.apache.org/viewvc?rev=988550&view=rev
>> Log:
>> Fix upgrade_tests.py 7 in single-db.
>> 
>> * subversion/libsvn_wc/entries.c
>>   (insert_working_node): Don't force kind to subdir.
>>   (write_entry): Make working_node subdirs incomplete initially.
>
> How are you going to handle not present but added subdirectories in this way?

Do you mean

$ svn rm wc/A
$ svn ci -mm wc     # wc/A is not-present
$ svn mkdir wc/A
$ svn upgrade wc

I get

$ sqlite3 wc/.svn/wc.db "select * from base_node"
1||1|||normal|dir|1|||1|1282662995630871|pm|infinity||0||||
1|A|1|A||not-present|dir|-1||||||infinity||0||||
$ sqlite3 wc/.svn/wc.db "select * from working_node"
1|A||normal|dir||||||infinity|||||||0||0

which I think is correct. Or do you mean

$ svn mkdir wc/A
$ rm -rf wc/A
$ svn upgrade wc

I get

$ sqlite3 wc/.svn/wc.db "select * from base_node"
1||1|||normal|dir|0|||0|1282663366673755||infinity||0||||
$ sqlite3 wc/.svn/wc.db "select * from working_node"
1|A||incomplete|dir||||||infinity|||||||0||0

I don't think there is any Subversion command to fix the
working=incomplete at present.  I suppose the user could revert and do
another mkdir.

> You only have one status field for BASE_NODE and not present is only
> recorded in the parent directories (in the entries world recorded as
> entry->deleted in the parent dir). But if you set the directory to
> incomplete the 'not-present' status gets lost.  And this can't be
> fixed from the directory itself, as it doesn't know that it
> originally existed as not-present, because we only started
> propagating this information into the subdir in the WC-NG work.

-- 
Philip

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

Posted by Philip Martin <ph...@wandisco.com>.
"Bert Huijben" <be...@qqmail.nl> writes:

>> -----Original Message-----
>> From: philip@apache.org [mailto:philip@apache.org]
>> Sent: dinsdag 24 augustus 2010 16:13
>> To: commits@subversion.apache.org
>> Subject: svn commit: r988550 - in /subversion/trunk/subversion:
>> libsvn_wc/entries.c tests/cmdline/upgrade_tests.py
>> 
>> Author: philip
>> Date: Tue Aug 24 14:13:26 2010
>> New Revision: 988550
>> 
>> URL: http://svn.apache.org/viewvc?rev=988550&view=rev
>> Log:
>> Fix upgrade_tests.py 7 in single-db.
>> 
>> * subversion/libsvn_wc/entries.c
>>   (insert_working_node): Don't force kind to subdir.
>>   (write_entry): Make working_node subdirs incomplete initially.
>
> How are you going to handle not present but added subdirectories in this way?

Do you mean

$ svn rm wc/A
$ svn ci -mm wc     # wc/A is not-present
$ svn mkdir wc/A
$ svn upgrade wc

I get

$ sqlite3 wc/.svn/wc.db "select * from base_node"
1||1|||normal|dir|1|||1|1282662995630871|pm|infinity||0||||
1|A|1|A||not-present|dir|-1||||||infinity||0||||
$ sqlite3 wc/.svn/wc.db "select * from working_node"
1|A||normal|dir||||||infinity|||||||0||0

which I think is correct. Or do you mean

$ svn mkdir wc/A
$ rm -rf wc/A
$ svn upgrade wc

I get

$ sqlite3 wc/.svn/wc.db "select * from base_node"
1||1|||normal|dir|0|||0|1282663366673755||infinity||0||||
$ sqlite3 wc/.svn/wc.db "select * from working_node"
1|A||incomplete|dir||||||infinity|||||||0||0

I don't think there is any Subversion command to fix the
working=incomplete at present.  I suppose the user could revert and do
another mkdir.

> You only have one status field for BASE_NODE and not present is only
> recorded in the parent directories (in the entries world recorded as
> entry->deleted in the parent dir). But if you set the directory to
> incomplete the 'not-present' status gets lost.  And this can't be
> fixed from the directory itself, as it doesn't know that it
> originally existed as not-present, because we only started
> propagating this information into the subdir in the WC-NG work.

-- 
Philip

RE: svn commit: r988550 - in /subversion/trunk/subversion: libsvn_wc/entries.c tests/cmdline/upgrade_tests.py

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: philip@apache.org [mailto:philip@apache.org]
> Sent: dinsdag 24 augustus 2010 16:13
> To: commits@subversion.apache.org
> Subject: svn commit: r988550 - in /subversion/trunk/subversion:
> libsvn_wc/entries.c tests/cmdline/upgrade_tests.py
> 
> Author: philip
> Date: Tue Aug 24 14:13:26 2010
> New Revision: 988550
> 
> URL: http://svn.apache.org/viewvc?rev=988550&view=rev
> Log:
> Fix upgrade_tests.py 7 in single-db.
> 
> * subversion/libsvn_wc/entries.c
>   (insert_working_node): Don't force kind to subdir.
>   (write_entry): Make working_node subdirs incomplete initially.

How are you going to handle not present but added subdirectories in this way?

You only have one status field for BASE_NODE and not present is only recorded in the parent directories (in the entries world recorded as entry->deleted in the parent dir). But if you set the directory to incomplete the 'not-present' status gets lost.
And this can't be fixed from the directory itself, as it doesn't know that it originally existed as not-present, because we only started propagating this information into the subdir in the WC-NG work.

	Bert 


RE: svn commit: r988550 - in /subversion/trunk/subversion: libsvn_wc/entries.c tests/cmdline/upgrade_tests.py

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: philip@apache.org [mailto:philip@apache.org]
> Sent: dinsdag 24 augustus 2010 16:13
> To: commits@subversion.apache.org
> Subject: svn commit: r988550 - in /subversion/trunk/subversion:
> libsvn_wc/entries.c tests/cmdline/upgrade_tests.py
> 
> Author: philip
> Date: Tue Aug 24 14:13:26 2010
> New Revision: 988550
> 
> URL: http://svn.apache.org/viewvc?rev=988550&view=rev
> Log:
> Fix upgrade_tests.py 7 in single-db.
> 
> * subversion/libsvn_wc/entries.c
>   (insert_working_node): Don't force kind to subdir.
>   (write_entry): Make working_node subdirs incomplete initially.

How are you going to handle not present but added subdirectories in this way?

You only have one status field for BASE_NODE and not present is only recorded in the parent directories (in the entries world recorded as entry->deleted in the parent dir). But if you set the directory to incomplete the 'not-present' status gets lost.
And this can't be fixed from the directory itself, as it doesn't know that it originally existed as not-present, because we only started propagating this information into the subdir in the WC-NG work.

	Bert