You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stephen Butler <sb...@elego.de> on 2008/01/28 15:00:45 UTC

[PATCH] 'svn commit' of out-of-date items

Hi folks,

A user has noticed that the handling of out-of-date conditions in
'svn commit' is inconsistent.  For a single file, Subversion 1.4
and 1.5 behave as follows.

Case 1.
Scheduled for deletion locally, modified in the repo.
Error:  File 'foo' is out of date

Case 2.
Modified locally, deleted in the repo.
Error:  File not found: transaction '2-3', path 'foo'

Case 3.
Scheduled for deletion locally, already deleted in the repo.
No error, commit succeeds.

The same applies to a directory with property modifications.

Subversion issue #1017 led to a new commit test
commit_out_of_date_deletions(), which covers case 1 above.  The
following diff ensures that the out-of-date error is raised for
cases 2 and 3, and extends the test to cover those cases.

This came up while investigating tree conflicts.  We need to
"tighten the net" at commit time to give future tree-conflict
resolution a chance to work during update, switch or merge.
Since it's unlikely that anyone depends on the current
inconsistency, I suggest we fix it now.

Regards,
Steve


[[[
Make 'svn commit' safe for (future) tree conflict resolution.
The commit of a file or dir should stop with an out-of-date error if
the file or dir has been deleted in the repo since the last update.

* subversion/libsvn_repos/commit.c
   (delete_entry, open_file, change_dir_prop): Call out_of_date() to
    raise an error if the node is not found in the repo.

* subversion/tests/cmdline/commit_tests.py
   (commit_out_of_date_deletions): Extend test to include file and dir
    deleted in the working copy and deleted in the repo, and file and
    dir modified in the working copy and deleted in the repo.
]]]



-- 
Stephen Butler | Software Developer

elego Software Solutions GmbH
Gustav-Meyer-Allee 25 | 13355 Berlin | Germany

fon: +49 30 2345 8696 | mobile: +49 163 25 45 015
fax: +49 30 2345 8695 | http://www.elegosoft.com

Geschäftsführer: Olaf Wagner | Sitz der Gesellschaft: Berlin
Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194



Re: [PATCH] 'svn commit' of out-of-date items

Posted by Karl Fogel <kf...@red-bean.com>.
Stephen Butler <sb...@elego.de> writes:
> A user has noticed that the handling of out-of-date conditions in
> 'svn commit' is inconsistent.  For a single file, Subversion 1.4
> and 1.5 behave as follows.
>
> Case 1.
> Scheduled for deletion locally, modified in the repo.
> Error:  File 'foo' is out of date
>
> Case 2.
> Modified locally, deleted in the repo.
> Error:  File not found: transaction '2-3', path 'foo'
>
> Case 3.
> Scheduled for deletion locally, already deleted in the repo.
> No error, commit succeeds.
>
> The same applies to a directory with property modifications.
>
> Subversion issue #1017 led to a new commit test
> commit_out_of_date_deletions(), which covers case 1 above.  The
> following diff ensures that the out-of-date error is raised for
> cases 2 and 3, and extends the test to cover those cases.

Stephen, I haven't had time to look at your patch closely, but I
wanted to make sure you were already aware of r27365 / issue #2740.
Your patch seems like it might be a continuation of that; if it's
applied, we should probably cross-reference the change with that other
revision and with the issue.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org