You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ren Wang <re...@gmail.com> on 2016/02/21 14:45:56 UTC

version number

Is there a way or API to set and get a file version number instead of
revision number? For my case, when a file is created, the version by default
should be 1, every change the version number will be incremented by 1.

 

Regards,

 

Ren

 

 


Re: version number

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 21, 2016, at 7:45 AM, Ren Wang wrote:

> Is there a way or API to set and get a file version number instead of revision number? For my case, when a file is created, the version by default should be 1, every change the version number will be incremented by 1.

No, Subversion doesn't track files individually; it tracks changes, and a change can affect any number of files and directories.



RE: version number

Posted by Ren Wang <re...@gmail.com>.
Hi Andreas,

Thank you so much for the answer!

Ren

-----Original Message-----
From: Andreas Mohr [mailto:andi@lisas.de] 
Sent: Sunday, February 21, 2016 9:40 AM
To: Ren Wang <re...@gmail.com>
Cc: users@subversion.apache.org
Subject: Re: version number

On Sun, Feb 21, 2016 at 08:45:56AM -0500, Ren Wang wrote:
>    Is there a way or API to set and get a file version number instead of
>    revision number? For my case, when a file is created, the version by
>    default should be 1, every change the version number will be 
> incremented

Generally spoken this is a pretty simple matter:

[number of log entries for this file] == "version number"

Since your requirement is compatible enough that the number of log entries
directly corresponds to the version number, we now at least know that there
is no *extra* state data needed which would need to be stored in database
area.


As an svn semi-expert (insufficiently informed since SvnBridge devel), I
don't know which particular APIs might be available to retrieve this
information in the most direct/efficient manner, though.
You are likely looking for something
which directly returns a shallow "number of log entries"
rather than deep (per-entry) log information...

HTH,

Andreas Mohr


Re: version number

Posted by Andreas Mohr <an...@lisas.de>.
On Sun, Feb 21, 2016 at 08:45:56AM -0500, Ren Wang wrote:
>    Is there a way or API to set and get a file version number instead of
>    revision number? For my case, when a file is created, the version by
>    default should be 1, every change the version number will be incremented

Generally spoken this is a pretty simple matter:

[number of log entries for this file] == "version number"

Since your requirement is compatible enough that
the number of log entries directly corresponds to the version number,
we now at least know
that there is no *extra* state data needed
which would need to be stored in database area.


As an svn semi-expert (insufficiently informed since SvnBridge devel),
I don't know which particular APIs might be available
to retrieve this information in the most direct/efficient manner, though.
You are likely looking for something
which directly returns a shallow "number of log entries"
rather than deep (per-entry) log information...

HTH,

Andreas Mohr