You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@red-bean.com> on 2008/07/07 19:09:37 UTC
Re: svn commit: r31987 - in branches/issue-2843-dev/subversion: libsvn_wc tests/cmdline
firemeteor@tigris.org writes:
> Log:
> On the issue-2843-dev branch.
>
> Fix copying excluded items.
>
> * subversion/libsvn_wc/copy.c
> (post_copy_cleanup): Skip excluded entry.
>
> * subversion/tests/cmdline/depth_tests.py
> (excluded_path_operation): Add copy test.
>
> --- branches/issue-2843-dev/subversion/libsvn_wc/copy.c (r31986)
> +++ branches/issue-2843-dev/subversion/libsvn_wc/copy.c (r31987)
> @@ -559,12 +559,14 @@ post_copy_cleanup(svn_wc_adm_access_t *a
>
> svn_pool_clear(subpool);
>
> - /* TODO(#2843) Check if we need to handle exclude here. Possibly not. */
> apr_hash_this(hi, &key, NULL, &val);
> entry = val;
> kind = entry->kind;
> deleted = entry->deleted;
>
> + if (entry->depth == svn_depth_exclude)
> + continue;
> +
> /* Convert deleted="true" into schedule="delete" for all
> children (and grandchildren, if RECURSE is set) of the path
> represented by ADM_ACCESS. The result of this is that when
What if a child has both entry->deleted==TRUE and
entry->depth==svn_depth_exclude? Or is that supposed to be impossible?
Also, in the test change below...
> --- branches/issue-2843-dev/subversion/tests/cmdline/depth_tests.py (r31986)
> +++ branches/issue-2843-dev/subversion/tests/cmdline/depth_tests.py (r31987)
> @@ -2034,6 +2034,7 @@ def excluded_path_operation(sbox):
> infinity=True)
> A_path = os.path.join(wc_dir, 'A')
> B_path = os.path.join(A_path, 'B')
> + L_path = os.path.join(A_path, 'L')
> E_path = os.path.join(B_path, 'E')
>
> # Simply exclude a subtree
> @@ -2077,6 +2078,19 @@ def excluded_path_operation(sbox):
> svntest.actions.run_and_verify_svn(None, None, [],
> 'up', '--set-depth', 'exclude', E_path)
>
> + # copy A/B to A/L
> + expected_output = ['A '+L_path+'\n']
> + svntest.actions.run_and_verify_svn(None, expected_output, [],
> + 'cp', B_path, L_path)
> +
> + # revert A/L
> + expected_output = ["Reverted '"+L_path+"'\n"]
> + svntest.actions.run_and_verify_svn(None, expected_output, [],
> + 'revert', '--depth=infinity', L_path)
> +
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'rm', '--force', L_path)
> +
> # Exclude path B totally, in which contains an excluded subtree.
> expected_output = svntest.wc.State(wc_dir, {
> 'A/B' : Item(status='D '),
...it might be good to add a comment about what is being tested for in
this new code.
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r31987 - in branches/issue-2843-dev/subversion: libsvn_wc tests/cmdline
Posted by Karl Fogel <kf...@red-bean.com>.
"Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
>> What if a child has both entry->deleted==TRUE and
>> entry->depth==svn_depth_exclude? Or is that supposed to be impossible?
>
> We should prevent this from happening. entry->deleted == TRUE just means that
> the item is gone from the repos. However, the exclude assumes the item exists
> in the repos.
Just curious: if we have a tree T with excluded item E, what happens if
we do an update and it turns out E is now removed in the repository? Do
we locally receive the removal, and therefore remove any record of E in
the working copy?
>> > + # copy A/B to A/L
>> > + expected_output = ['A '+L_path+'\n']
>> > + svntest.actions.run_and_verify_svn(None, expected_output, [],
>> > + 'cp', B_path, L_path)
>> > +
>> > + # revert A/L
>> > + expected_output = ["Reverted '"+L_path+"'\n"]
>> > + svntest.actions.run_and_verify_svn(None, expected_output, [],
>> > + 'revert', '--depth=infinity', L_path)
>> > +
>> > + svntest.actions.run_and_verify_svn(None, None, [],
>> > + 'rm', '--force', L_path)
>> > +
>> > # Exclude path B totally, in which contains an excluded subtree.
>> > expected_output = svntest.wc.State(wc_dir, {
>> > 'A/B' : Item(status='D '),
>>
>> ...it might be good to add a comment about what is being tested for in
>> this new code.
>
> Just test the simple case of copy & revert. Maybe I should make it
> more clear?
Yes, I think that would help.
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: r31987 - in branches/issue-2843-dev/subversion:
libsvn_wc tests/cmdline
Posted by "Rui, Guo" <ti...@mail.ustc.edu.cn>.
On Mon, Jul 07, 2008 at 03:09:37PM -0400, Karl Fogel wrote:
> firemeteor@tigris.org writes:
> >
> > - /* TODO(#2843) Check if we need to handle exclude here. Possibly not. */
> > apr_hash_this(hi, &key, NULL, &val);
> > entry = val;
> > kind = entry->kind;
> > deleted = entry->deleted;
> >
> > + if (entry->depth == svn_depth_exclude)
> > + continue;
> > +
> > /* Convert deleted="true" into schedule="delete" for all
> > children (and grandchildren, if RECURSE is set) of the path
> > represented by ADM_ACCESS. The result of this is that when
>
> What if a child has both entry->deleted==TRUE and
> entry->depth==svn_depth_exclude? Or is that supposed to be impossible?
We should prevent this from happening. entry->deleted == TRUE just means that
the item is gone from the repos. However, the exclude assumes the item exists
in the repos.
> > + # copy A/B to A/L
> > + expected_output = ['A '+L_path+'\n']
> > + svntest.actions.run_and_verify_svn(None, expected_output, [],
> > + 'cp', B_path, L_path)
> > +
> > + # revert A/L
> > + expected_output = ["Reverted '"+L_path+"'\n"]
> > + svntest.actions.run_and_verify_svn(None, expected_output, [],
> > + 'revert', '--depth=infinity', L_path)
> > +
> > + svntest.actions.run_and_verify_svn(None, None, [],
> > + 'rm', '--force', L_path)
> > +
> > # Exclude path B totally, in which contains an excluded subtree.
> > expected_output = svntest.wc.State(wc_dir, {
> > 'A/B' : Item(status='D '),
>
> ...it might be good to add a comment about what is being tested for in
> this new code.
Just test the simple case of copy & revert. Maybe I should make it more clear?
Rui
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org