views:

1424

answers:

3

I have a project that has a revision number of 3960. But unfortunately it is not under source control. Now I would like to put it under SVN and use Tortoise SVN. But when I put it there it will have revision from 1,2,3,4 and so on.

Is there a way to change the revision number to 3960?

+7  A: 

It is possible in theory, but not very useful.

If you need somehow to keep track of this information, you may consider creating a tag '3960', but otherwise leaving the normal revision process taking place.

As said in the manual:

Global Revision Numbers
Unlike those of many other version control systems, Subversion's revision numbers apply to entire trees, 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 a Subversion user talks about “revision 5 of foo.c”, they really mean “foo.c as it appears in revision 5.”

A revision number is different than an **application version number" (the version number of your application): the latter is represented by a tag.

VonC
+3  A: 

First, I don't know a way to do this. If it would be possible, I think you have to use a svn-hookscript.

Second, the revision number in Source Control Systems has nothing to do with the revision (Version) Number of your Program. The Source Control System keeps track of every change you submit and so you may have much more submits than builds of your code. It may differ every time, if you don't just submit changes with a new build-number and I don't think that you should just check in changes in such huge steps.

For keeping track of your build numbers you should use tags.

Peter
+5  A: 

The safest way I can think of would be to make a dump file with an appropriate number of empty revisions, than load it. The format would be something like:

SVN-fs-dump-format-version: 2

Revision-number: 0
Prop-content-length: 56
Content-length: 56

K 8
svn:date
V 27
2009-01-12T14:58:15.449041Z
PROPS-END

Revision-number: 1
Prop-content-length: 56
Content-length: 56

K 8
svn:date
V 27
2009-01-12T14:58:40.758271Z
PROPS-END

Revision-number: 2
Prop-content-length: 56
Content-length: 56

K 8
svn:date
V 27
2009-01-12T14:58:44.509698Z
PROPS-END

You could omit the svn:date and it would still be a valid svn repository, but queries by {date} wouldn't work (just like they don't in any case where the dates are not monotonically increasing with revision). So it's probably best to fake up a string of plausible dates.

If you want 3960 such revisions, you probably want to write a script to generate the dump file. I leave that as an exercise to the reader :-)

puetzk