[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: version number

From: Andreas Mohr <andi_at_lisas.de>
Date: Sun, 21 Feb 2016 15:40:09 +0100

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
Received on 2016-02-22 10:26:59 CET

This is an archived mail posted to the Subversion Users mailing list.