Tuesday, July 04, 2006

What is mixed revision working copies in Subversion?

Assume that you have 2 files Day.txt and Number.txt which are contained in sesame directory at revision 1 in Subversion repository. You checkout them and change something in Day.txt then commit it to repository. At this time, if you run "svn log Day.txt" command, Subversion will show you the log of Day.txt and its revision is 2. But if you run "svn log sesame", the command's output will return revision 1.

Why? 'Cause Subversion treats directories as first class objects, it remembers the revision number for each directory in your working copy.

I guess Subversion works this way: When I commit Day.txt to repository, Subversion client will update Day.txt (its content, history and revision number) to repository, also in working directory and sesame directory to repository. It doesn't update sesame directory and Number.txt in working directory. That's why if I run "svn log sesame", the command's output only returns revision 1. Only after I do "svn update", sesame's revision number will change, it comes from repository.

One sentence is from Version Control with Subversion is "'push' action does not cause a 'pull'"

No comments: