简体   繁体   中英

in Subversion, Confusing about revision numbering of Branch

I have been using Clear Case, and I started to use Subversion.

Now I'm confused if a branch's revision number starts from 0 or if it starts from the trunk's HEAD revision number.

And another question, after I commit on Trunk, I'm confused if the latest revision of branch is same as the Trunk's HEAD revision.

Thanks in advance.

The revision numbers in a Subversion repository are global, ie they apply to the whole repository including trunk , tags and branches .

This Section of the book "Version Control with Subversion" might be useful to you:

You should not apply any of ClearCase experience (apart from the concept of systematic change management) when thinking of versioning, branching, and merging in Subversion. It is completely different.

Trunk and branches in subversion are symmetric independent folders. When one is branched off another it is in fact a lightweight copy-on-write.

Revision is a global state of the repository rather than a state of individual element, that's why you see "the latest revision of the branch is the same as the trunk head revision".

Within Subversion, each new repository will start at revision 1 when it is created.

All revisions are unique and incremental for each repository, regardless of whether you commit to the trunk, branch or create a tag.

So you would get revision numbers like this:

Commit to Trunk - rev 1
Commit to Trunk - rev 2
Commit to Branch - rev 3
Commit to Trunk - rev 4

Subversion revision numbers are strictly monotonous. If your commit gets revision number n then the next commit will be revision n +1 regardless of where in the repo something gets committed. It could even be to a different project in the same repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM