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 2012/03/27 12:06:41 UTC

svn commit: r1305801 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/libsvn_wc/op-depth-test.c

Author: stsp
Date: Tue Mar 27 10:06:41 2012
New Revision: 1305801

URL: http://svn.apache.org/viewvc?rev=1305801&view=rev
Log:
Don't mark added nodes within a subtree as 'moved-here' when the subtree
is moved away. Fixes op-depth-test "move_added".

* subversion/tests/libsvn_wc/op-depth-test.c
  (test_funcs): move_added test passes now, was xfail.

* subversion/libsvn_wc/wc_db.c
  (get_info_for_copy): Obtain the detailed status of an added node from
   scan_addition(), making it available to callers.
  (db_op_copy): Never mark a locally added node as 'moved-here'.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.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=1305801&r1=1305800&r2=1305801&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Mar 27 10:06:41 2012
@@ -3443,7 +3443,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
     {
       const char *op_root_relpath;
 
-      SVN_ERR(scan_addition(NULL, &op_root_relpath,
+      SVN_ERR(scan_addition(status, &op_root_relpath,
                             NULL, NULL, /* repos_* */
                             copyfrom_relpath, copyfrom_id, copyfrom_rev,
                             NULL, NULL, NULL, wcroot, local_relpath,
@@ -3657,7 +3657,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
                     dst_op_depth,
                     dst_parent_relpath,
                     presence_map, dst_presence));
-      if (is_move)
+      if (is_move && status != svn_wc__db_status_added)
         SVN_ERR(svn_sqlite__bind_int64(stmt, 7, 1));
 
       SVN_ERR(svn_sqlite__step_done(stmt));

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1305801&r1=1305800&r2=1305801&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Tue Mar 27 10:06:41 2012
@@ -4666,7 +4666,7 @@ struct svn_test_descriptor_t test_funcs[
                        "move_on_move"),
     SVN_TEST_OPTS_PASS(move_on_move2,
                        "move_on_move2"),
-    SVN_TEST_OPTS_XFAIL(move_added,
+    SVN_TEST_OPTS_PASS(move_added,
                        "move_added"),
     SVN_TEST_OPTS_XFAIL(move_update,
                        "move_update"),



Re: svn commit: r1305801 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/libsvn_wc/op-depth-test.c

Posted by Stefan Sperling <st...@elego.de>.
On Tue, Mar 27, 2012 at 01:22:40PM -0400, Greg Stein wrote:
> Maybe leave a ### marker in there with a comment on current problems
> and initial thoughts on future work?

Sure, r1305922.

> I'd hate to lose your mind-state and have that code get shipped half-done.

Move support is generally not ready to ship yet. Maybe you weren't aware
of that. And at the moment, I myself have somewhat lost track of what
still needs doing. I currently rely on Philip's observations as my de-facto
TODO list. So you might be better off checking his mind-state, not mine :) 

Re: svn commit: r1305801 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/libsvn_wc/op-depth-test.c

Posted by Greg Stein <gs...@gmail.com>.
On Tue, Mar 27, 2012 at 13:12, Stefan Sperling <st...@elego.de> wrote:
> On Tue, Mar 27, 2012 at 12:36:21PM -0400, Greg Stein wrote:
>> On Tue, Mar 27, 2012 at 06:06,  <st...@apache.org> wrote:
>> >...
>> > +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Mar 27 10:06:41 2012
>> >...
>> > @@ -3657,7 +3657,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
>> >                     dst_op_depth,
>> >                     dst_parent_relpath,
>> >                     presence_map, dst_presence));
>> > -      if (is_move)
>> > +      if (is_move && status != svn_wc__db_status_added)
>> >         SVN_ERR(svn_sqlite__bind_int64(stmt, 7, 1));
>>
>> Hrm. What happens if the status is svn_wc__db_status_copied? (another
>> possible result from scan_addition) Don't you want to specifically
>> test for status_moved_here?
>
> As far as I understand, this could be the first time the node is moved.
> So it might be status normal.
>
> I thought briefly about performing a switch on 'status' to make sure
> we consider all cases, but decided to defer that for later and just
> fix the 'add' case for now.
>
> Considering 'svn cp A B; svn mv B C' is something a user could do,
> and given that this sequence doesn't currently result in useful DB state,
> additional work is definitely needed here.

Maybe leave a ### marker in there with a comment on current problems
and initial thoughts on future work?

I'd hate to lose your mind-state and have that code get shipped half-done.

Cheers,
-g

Re: svn commit: r1305801 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/libsvn_wc/op-depth-test.c

Posted by Stefan Sperling <st...@elego.de>.
On Tue, Mar 27, 2012 at 12:36:21PM -0400, Greg Stein wrote:
> On Tue, Mar 27, 2012 at 06:06,  <st...@apache.org> wrote:
> >...
> > +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Mar 27 10:06:41 2012
> >...
> > @@ -3657,7 +3657,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
> >                     dst_op_depth,
> >                     dst_parent_relpath,
> >                     presence_map, dst_presence));
> > -      if (is_move)
> > +      if (is_move && status != svn_wc__db_status_added)
> >         SVN_ERR(svn_sqlite__bind_int64(stmt, 7, 1));
> 
> Hrm. What happens if the status is svn_wc__db_status_copied? (another
> possible result from scan_addition) Don't you want to specifically
> test for status_moved_here?

As far as I understand, this could be the first time the node is moved.
So it might be status normal.

I thought briefly about performing a switch on 'status' to make sure
we consider all cases, but decided to defer that for later and just
fix the 'add' case for now.

Considering 'svn cp A B; svn mv B C' is something a user could do,
and given that this sequence doesn't currently result in useful DB state,
additional work is definitely needed here.

Re: svn commit: r1305801 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/libsvn_wc/op-depth-test.c

Posted by Greg Stein <gs...@gmail.com>.
On Tue, Mar 27, 2012 at 06:06,  <st...@apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_wc/wc_db.c Tue Mar 27 10:06:41 2012
>...
> @@ -3657,7 +3657,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
>                     dst_op_depth,
>                     dst_parent_relpath,
>                     presence_map, dst_presence));
> -      if (is_move)
> +      if (is_move && status != svn_wc__db_status_added)
>         SVN_ERR(svn_sqlite__bind_int64(stmt, 7, 1));

Hrm. What happens if the status is svn_wc__db_status_copied? (another
possible result from scan_addition) Don't you want to specifically
test for status_moved_here?

>...

Cheers,
-g