1
votes

When I Commit certain files under trunk, why revision number is not same for all the files inside that trunk in svn. as per SVN the revision number is applied to whole trunk not to individual files.

following is what SVN book said about revisions

Global Revision Numbers Unlike most version control systems, Subversion's revision numbers apply to the entire repository tree, not individual files. Each revision number selects an entire tree, a particular state of the repository after some committed change. Another way to think about it is that revision N represents the state of the repository filesystem after the Nth commit. When Subversion users talk about “revision 5 of foo.c,” they really mean “foo.c as it appears in revision 5.” Notice that in general, revisions N and M of a file do not necessarily differ!

2

2 Answers

1
votes

When you commit files, you now have a mixed-revision working copy. Basically, although you did create a new revision containing all files when you committed your changes, SVN does not automatically retrieve all files from that revision for you when you commit. It only does this when you update. So, to bring your working copy back in sync with an actual revision, you must simply svn update.

In fact, it is best practice to always svn update before you svn commit. Otherwise, changes that build and run fine in your own working copy, may be incompatible with changes made to the rest of the project.

0
votes

Are you looking at the files in repo browser? If so, the revision given for each file there is the revision that file was last updated in.