Dmitrijs Ledkovs wrote:
> Recent bzr-svn generates revno / revid which looks like this:
>
> In [13]: b.last_revision_info()
> Out[13]: (2311, 'svn-v4:95a4280c-1b0e-0410-9f8f-80a059958c3c:trunk:3257')
>
> So to substitute {svn} in deb_version revision:
>
> 1) check that it starts with 'svn-v4'
> 2) And strip rev-id to last ":" and return last digits as {svn}
I think bzr-svn can tell you the svn revno for a revision. I'm not sure
if it writes the metadata or does something similar to what you suggest.
I think re-using the code from bzr-svn would be good though. I haven't
had a chance to look at the source to find out what it does yet.
> I've tried to write a patch myself but I failed =(
>
> As far as I understood it a new def is required in class BaseRecipeBranch.
> I took substitute as a template basis but I don't see where get_revno_cb() is defined and where should I place alternative get_svn_revno_cb() which will return svn revision as bisected above.
It's implemented as a callback because it is potentially expensive, but
that might help implementing this.
get_revno is a function defined inline in the _resolve_revisions_recurse
function, see line 215 of recipe.py.
Dmitrijs Ledkovs wrote: revision_ info() 95a4280c- 1b0e-0410- 9f8f-80a059958c 3c:trunk: 3257')
> Recent bzr-svn generates revno / revid which looks like this:
>
> In [13]: b.last_
> Out[13]: (2311, 'svn-v4:
>
> So to substitute {svn} in deb_version revision:
>
> 1) check that it starts with 'svn-v4'
> 2) And strip rev-id to last ":" and return last digits as {svn}
I think bzr-svn can tell you the svn revno for a revision. I'm not sure
if it writes the metadata or does something similar to what you suggest.
I think re-using the code from bzr-svn would be good though. I haven't
had a chance to look at the source to find out what it does yet.
> I've tried to write a patch myself but I failed =(
>
> As far as I understood it a new def is required in class BaseRecipeBranch.
> I took substitute as a template basis but I don't see where get_revno_cb() is defined and where should I place alternative get_svn_revno_cb() which will return svn revision as bisected above.
It's implemented as a callback because it is potentially expensive, but
that might help implementing this.
get_revno is a function defined inline in the _resolve_ revisions_ recurse
function, see line 215 of recipe.py.
Thanks,
James