You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Juanma M. R." <ju...@gmail.com> on 2013/10/23 12:57:47 UTC

Getting the node id for a new folder

Dear list,

This is my first post. I am Juan Manuel from Spain. I have been using
subversion for a long time in my developments and now I am starting to work
on a deeper way with subversion for my PhD work.

I would like to get the node id when I create a new folder. I would like to
do it as a post commit action in order to store it in a DB. How could I do
it? Any example or doc you recommend me?

(I think this is the list to send this message but if you think I should
send it to developers one just let me know)

Regards,
Juan Manuel Moreno Rivera.

Sección de Teledetección y SIG / Remote Sensing & GIS group

Instituto de Desarrollo Regional / Institute for Regional Development

Universidad de Castilla-La Mancha / University of Castilla-La Mancha

Tlf: +34 967599200 (Ext: 2623)
http://www.teledeteccionysig.es/

Re: Getting the node id for a new folder

Posted by "Juanma M. R." <ju...@gmail.com>.
Hi Brane,

That is also a good advice. Thanks. I am considering again using the
folders name and using the commands Philip recomended keep up to date the
database in every commit.

Regards,

Juan Manuel Moreno Rivera.

Sección de Teledetección y SIG / Remote Sensing & GIS group

Instituto de Desarrollo Regional / Institute for Regional Development

Universidad de Castilla-La Mancha / University of Castilla-La Mancha

Tlf: +34 967599200 (Ext: 2623)
http://www.teledeteccionysig.es/


2013/10/23 Branko Čibej <br...@wandisco.com>

>  On 23.10.2013 17:35, Juanma M. R. wrote:
>
> Hi Philip,
>
>  First of all thank you for such a quick answer. I will try to clarify my
> previous post.
>
> 2013/10/23 Philip Martin <ph...@wandisco.com>
>
>> "Juanma M. R." <ju...@gmail.com> writes:
>>
>> > I would like to get the node id when I create a new folder. I would
>> like to
>> > do it as a post commit action in order to store it in a DB. How could I
>> do
>> > it? Any example or doc you recommend me?
>>
>>  To which node id are you referring?  Subversion doesn't really have node
>> ids.  There is a node-revision-id in the repository but that changes as
>> the node is modified in subsequent revisions.
>
>
>  From the documentation here
> <http://subversion.apache.org/docs/api/1.6/group__svn__fs__nodes.html#_details>I
> got the idea that nodes themself have their own lifetime id.
>
>
> You shouldn't really rely on implementation details of the versioned
> filesystem in this way. Even if svnadmin shows node-rev-ids, there's no
> guarantee that they won't change drastically in the future.
>
> -- Brane
>
> --
> Branko Čibej | Director of Subversion
> WANdisco // Non-Stop Data
> e. brane@wandisco.com
>

Re: Getting the node id for a new folder

Posted by Branko Čibej <br...@wandisco.com>.
On 23.10.2013 17:35, Juanma M. R. wrote:
> Hi Philip,
>
> First of all thank you for such a quick answer. I will try to clarify
> my previous post.
>
>
> 2013/10/23 Philip Martin <philip.martin@wandisco.com
> <ma...@wandisco.com>>
>
>     "Juanma M. R." <juanma.mr@gmail.com <ma...@gmail.com>>
>     writes:
>
>     > I would like to get the node id when I create a new folder. I
>     would like to
>     > do it as a post commit action in order to store it in a DB. How
>     could I do
>     > it? Any example or doc you recommend me?
>
>     To which node id are you referring?  Subversion doesn't really
>     have node
>     ids.  There is a node-revision-id in the repository but that
>     changes as
>     the node is modified in subsequent revisions.  
>
>
> From the documentation here
> <http://subversion.apache.org/docs/api/1.6/group__svn__fs__nodes.html#_details>I
> got the idea that nodes themself have their own lifetime id.

You shouldn't really rely on implementation details of the versioned
filesystem in this way. Even if svnadmin shows node-rev-ids, there's no
guarantee that they won't change drastically in the future.

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane@wandisco.com

Re: Getting the node id for a new folder

Posted by "Juanma M. R." <ju...@gmail.com>.
Hi Philip,

First of all thank you for such a quick answer. I will try to clarify my
previous post.

2013/10/23 Philip Martin <ph...@wandisco.com>

> "Juanma M. R." <ju...@gmail.com> writes:
>
> > I would like to get the node id when I create a new folder. I would like
> to
> > do it as a post commit action in order to store it in a DB. How could I
> do
> > it? Any example or doc you recommend me?
>
> To which node id are you referring?  Subversion doesn't really have node
> ids.  There is a node-revision-id in the repository but that changes as
> the node is modified in subsequent revisions.


>From the documentation here
<http://subversion.apache.org/docs/api/1.6/group__svn__fs__nodes.html#_details>I
got the idea that nodes themself have their own lifetime id.

What I am trying to do is storing a branch folder in my database. If I
store the path in the repository to the branch and someone changes this
folder name I will lose the link from my database to the branch in the
repository. That is why I looked for that id for each node so that I can
store it better than the folder name.

But after your clarification I understand that I was in the wrong way.


> I'm not sure how it would
> be useful to you, but you can get node-revision-ids by using
>
>    svnlook changed -rREV REPOS_PATH



to identify the new paths which you then pass to
>
>    svnlook tree --show-ids -N -rREV REPOS_PATH PATH_IN_REPOS
>
>
This is exactly what I need. Even if I go on using the string to the path
in the repository or if I use the id these commands give me the information
I need. I can use it in a post-commit hook to update the database. Thank
you again.


> --
> Philip Martin | Subversion Committer
> WANdisco // *Non-Stop Data*
>


Regards,
Juan Manuel Moreno Rivera.

Sección de Teledetección y SIG / Remote Sensing & GIS group

Instituto de Desarrollo Regional / Institute for Regional Development

Universidad de Castilla-La Mancha / University of Castilla-La Mancha

Tlf: +34 967599200 (Ext: 2623)
http://www.teledeteccionysig.es/

Re: Getting the node id for a new folder

Posted by Philip Martin <ph...@wandisco.com>.
"Juanma M. R." <ju...@gmail.com> writes:

> I would like to get the node id when I create a new folder. I would like to
> do it as a post commit action in order to store it in a DB. How could I do
> it? Any example or doc you recommend me?

To which node id are you referring?  Subversion doesn't really have node
ids.  There is a node-revision-id in the repository but that changes as
the node is modified in subsequent revisions.  I'm not sure how it would
be useful to you, but you can get node-revision-ids by using

   svnlook changed -rREV REPOS_PATH

to identify the new paths which you then pass to

   svnlook tree --show-ids -N -rREV REPOS_PATH PATH_IN_REPOS

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*