You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2003/11/21 23:39:36 UTC
Re: svn commit: rev 7825 - in trunk/subversion: libsvn_wc
tests/clients/cmdline
kfogel@tigris.org writes:
> Author: kfogel
> Date: Fri Nov 21 13:02:34 2003
> New Revision: 7825
>
> Modified:
> trunk/subversion/libsvn_wc/entries.c
> trunk/subversion/libsvn_wc/lock.c
> trunk/subversion/tests/clients/cmdline/schedule_tests.py
> Log:
> Fix issue #1609: 'svn status' thought replaced items were unversioned.
>
> * subversion/libsvn_wc/lock.c
> (prune_deleted, do_open): Check for svn_wc_schedule_replace, as well
> as svn_wc_schedule_add, when deciding whath to ignore.
The schedule replace versus schedule add stuff still appears to be a
bit confused, see below
> Modified: trunk/subversion/tests/clients/cmdline/schedule_tests.py
> ==============================================================================
> --- trunk/subversion/tests/clients/cmdline/schedule_tests.py (original)
> +++ trunk/subversion/tests/clients/cmdline/schedule_tests.py Fri Nov 21 13:02:34 2003
> @@ -585,6 +585,41 @@
> finally:
> os.chdir(was_cwd)
>
> +#----------------------------------------------------------------------
> +# Regression test for issue #1609:
> +# 'svn status' should show a schedule-replace directory as 'R' not '?'
> +
> +def status_replaced_directory(sbox):
> + "status on a replaced directory"
> +
> + sbox.build()
> + wc_dir = sbox.wc_dir
> +
> + # The original recipe:
Let's do a file as well as a directory
> + #
> + # svnadmin create repo
> + # svn mkdir file://`pwd`/repo/foo -m r1
svn import svn-config file://`pwd`/repo/bar -m r1x
> + # svn co file://`pwd`/repo wc
> + # svn rm wc/foo
> + # rm -rf wc/foo
svn rm wc/bar
> + # svn ci wc -m r2
> + # svn mkdir wc/foo
touch wc/bar
svn add wc/bar
> + A_path = os.path.join(wc_dir, 'A')
> + svntest.actions.run_and_verify_svn(None, None, [], 'rm', A_path)
> + shutil.rmtree(A_path)
> + svntest.actions.run_and_verify_svn(None, None, [],
> + 'ci', '-m', 'log msg', wc_dir)
> + svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', A_path)
> +
> + # Now check that status says replaced.
> + expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
> + expected_status.tweak(wc_rev=1)
> + expected_status.tweak('A', status='R ', wc_rev=0)
The directory shows up as status 'R' but the file shows up as status
'A'. I think they should be the same, but I don't know whether it
should be add or replace.
Next problem, if the "rm -rf wc/foo" step is omitted from the recipe
then the directory no longer shows up as status 'R' but instead shows
up as status 'A' just like the file. Again I think they should be the
same, but I don't know if add or replace is correct.
The final problem is really a separate issue. Whether the directory
is status 'R' or status 'A' running update causes both the file and
the directory to become unversioned. This is obviously a problem with
the update logic that removes entries in state deleted. I think what
should happen is that entries that are schedule add/replace should
remain but should have the deleted state cleared. Perhaps schedule
replace should be converted into schedule add as well.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: rev 7825 - in trunk/subversion: libsvn_wc tests/clients/cmdline
Posted by kf...@collab.net.
Philip Martin <ph...@codematters.co.uk> writes:
> > Whew. Want to file the issue? :)
>
> I have a patch :)
Now *that's* the sort of exchange I could get used to...
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: rev 7825 - in trunk/subversion: libsvn_wc
tests/clients/cmdline
Posted by Philip Martin <ph...@codematters.co.uk>.
kfogel@collab.net writes:
>> The directory shows up as status 'R' but the file shows up as status
>> 'A'. I think they should be the same, but I don't know whether it
>> should be add or replace.
>
> Actually...
>
> I think 'A'dd is a more appropriate answer (although the code is
> currently doing 'R' for the directory case, I guess).
>
>> Next problem, if the "rm -rf wc/foo" step is omitted from the recipe
>> then the directory no longer shows up as status 'R' but instead shows
>> up as status 'A' just like the file. Again I think they should be the
>> same, but I don't know if add or replace is correct.
>
> If the object hadn't been committed after being rm'd, then 'R'. But
> since it has, 'A'.
>
> Does this make sense to you too?
Yes. I suspect the reason for the 'A'/'R' anomaly is that the code is
making a decision based on the result of svn_io_check_path() rather
than svn_wc_entry(). This is a common problem in the wc code, there
is already an issue about copy making the same mistake.
>> The final problem is really a separate issue. Whether the directory
>> is status 'R' or status 'A' running update causes both the file and
>> the directory to become unversioned. This is obviously a problem with
>> the update logic that removes entries in state deleted. I think what
>> should happen is that entries that are schedule add/replace should
>> remain but should have the deleted state cleared. Perhaps schedule
>> replace should be converted into schedule add as well.
>
> Yep.
>
> Whew. Want to file the issue? :)
I have a patch :)
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: svn commit: rev 7825 - in trunk/subversion: libsvn_wc tests/clients/cmdline
Posted by kf...@collab.net.
Philip Martin <ph...@codematters.co.uk> writes:
> The schedule replace versus schedule add stuff still appears to be a
> bit confused,
Ya think? :-)
One of my ambitions (I'd better file an issue about this) is to do a
tags-search for 'svn_wc_schedule_add' in conditionals, and see in how
many places it ought to be accompanied by an 'svn_wc_schedule_replace'.
In fact, I did this tags search, and came up with quite a few
suspicious spots.
> Let's do a file as well as a directory
The more the merrier!
> The directory shows up as status 'R' but the file shows up as status
> 'A'. I think they should be the same, but I don't know whether it
> should be add or replace.
Actually...
I think 'A'dd is a more appropriate answer (although the code is
currently doing 'R' for the directory case, I guess).
> Next problem, if the "rm -rf wc/foo" step is omitted from the recipe
> then the directory no longer shows up as status 'R' but instead shows
> up as status 'A' just like the file. Again I think they should be the
> same, but I don't know if add or replace is correct.
If the object hadn't been committed after being rm'd, then 'R'. But
since it has, 'A'.
Does this make sense to you too?
> The final problem is really a separate issue. Whether the directory
> is status 'R' or status 'A' running update causes both the file and
> the directory to become unversioned. This is obviously a problem with
> the update logic that removes entries in state deleted. I think what
> should happen is that entries that are schedule add/replace should
> remain but should have the deleted state cleared. Perhaps schedule
> replace should be converted into schedule add as well.
Yep.
Whew. Want to file the issue? :)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org