Sungguk Lim
Sungguk Lim

Reputation: 6228

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.

Upvotes: 3

Views: 131

Answers (4)

bobah
bobah

Reputation: 18864

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".

Upvotes: 1

felerian
felerian

Reputation: 653

The revision numbers in a Subversion repository are global, i.e. 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:

Upvotes: 4

tripleee
tripleee

Reputation: 189457

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.

Upvotes: 1

Trevor Pilley
Trevor Pilley

Reputation: 16393

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

Upvotes: 1

Related Questions