You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Roel Harbers <ro...@roelharbers.nl> on 2004/05/07 11:05:28 UTC

Should a working copy always be up-to-date after a successful commit?

I tried to do the following:

D:\svn>svn co file:///D:/svn/Repositories/Test
A  Test\dir1
A  Test\dir1\dir2
Checked out revision 28.

D:\svn>cd Test

D:\svn\Test>svn status -u
Status against revision:     28

D:\svn\Test>svn delete dir1\dir2
D         dir1\dir2

D:\svn\Test>svn commit -mtest
Deleting       dir1\dir2

Committed revision 29.

D:\svn\Test>svn delete dir1
D         dir1

D:\svn\Test>svn status -u
D              28   dir1
Status against revision:     29

D:\svn\Test>svn commit -mtest
Deleting       dir1
svn: Commit failed (details follow):
svn: Out of date: 'dir1' in transaction '30'

Now, I understand that this can be easily fixed with a "svn update" 
before the last commit. But isn't it strange that after I commit, the 
working copy contains an out-of-date directory? Shouldn't a successful 
commit guarantee that the commited wc is up-to-date?

I think the problem is that dir2 isn't actually deleted from the wc's 
file system until after the commit. Then, the fs-delete of dir2 changes 
the properties of the dir1 directory, and svn thinks dir1 has changed.

Of course, I could be completely misunderstanding what happens here.

Regards,

Roel Harbers


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

Re: Should a working copy always be up-to-date after a successful commit?

Posted by John Peacock <jp...@rowman.com>.
Roel Harbers wrote:

> Now, I understand that this can be easily fixed with a "svn update" 
> before the last commit. But isn't it strange that after I commit, the 
> working copy contains an out-of-date directory? Shouldn't a successful 
> commit guarantee that the commited wc is up-to-date?
> 

No, this is by design.  See this link for details:

http://svnbook.red-bean.com/svnbook/ch02s03.html#svn-ch-2-sect-3.4

The long and short of it is that there are circumstances where you don't want a 
commit to trigger an automatic update.  There are also circumstances where 
certain operations will be blocked unless the WC is up-to-date.  Both of those 
are features of a mixed-revisions model and neither are (AFAIK) likely to change.

If it bothers you overmuch, it shouldn't be too hard to write a wrapper to svn 
which does the moral equivalent of

	svn ci $1
	svn up --non-recursive $1

NOTE: I don't think that actually works unless you pass only a directory (or no 
directory at all) to the wrapper.  The wrapper should be much more intelligent 
about what options are also passed on the command line, and whether the target 
is a file, directory, or just implied (current directory and below).

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

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