abbas.aniefa
abbas.aniefa

Reputation: 2905

How to get next Revision number in SVN

I'm developing android application using eclipse and svn for version control.

I wanted to know the next Revision number of svn before committing my project source.

Form Properties->Team->Show History, i can get the current Revision number, but i cant assume that the next revision number will be always +1 , because from the branch if any commit made then the next Revision number would be +2 or +3 depends upon number of Commit from branch .

So please someone tell me how to get the next Revision number.

Thanks

Upvotes: 4

Views: 1891

Answers (2)

Bananeweizen
Bananeweizen

Reputation: 22070

There is no need to set the next revision number. It does not matter, if you use current revision + 1, or current revision + 42, or current revision - 123, as long as you use the same constant all the time (so the version code increments when the revision increments).

Given the possible choice of all constants as explained above, current revision + 0 is the most simple to chose and implement, as most version control systems can embed that number directly in the files.

Upvotes: 0

Pekka
Pekka

Reputation: 449613

I wanted to know the next Revision number of svn before committing my project source.

I don't think that's possible, for the exact reason you state: there could be revisions between when you receive the number, and when you commit. As far as I know, Subversion does not allow "locking" revision numbers - nor would it make sense.

i'm trying to set the Next Revision number as my version code

There is an established workflow for inserting the revision number into your code base. That is probably what you want. It is explained in this question.

Upvotes: 5

Related Questions