Re: How to discover which files are tagged or branced in a hook script?

2017-12-17 Thread Bo Berglund
On Sun, 17 Dec 2017 01:22:06 +0100, Branko ?ibej 
wrote:

>We'll have to dispel some misconceptions. Subversion's data model is
>significantly different from CVS's. Tags (and branches) are not
>properties of files, they're just (sub)trees within the repository.
>Creating a tag or a branch is exactly the same as copying a directory:
>the only thing that happens at the repository level is that a new
>version of the directory is created.
...

>The structure of the repository is entirely free-form. The
>trunk/branches/tags convention is exactly that: a convention, nothing
>more. Of course it helps to pick a convention and stick with it.


I have a hard time getting to understand this...
Do you mean that using "trunk", "branches" and "tags" as directories
is entirely voluntary? Does this also mean that files inside a
tags/something directory can be modified and committed, thus changing
the content of the tag?

In my CVS life there is a clear distinction between a tag and a branch
in that it is not possible to commit changes into a tag but it *is*
into a branch. So tags are immutable snapshots of the situaton at a
specific moment in time. Is this not the case in svn?

>I'd very strongly recommend to use one of the existing Subversion mailer
>scripts. There's one in the Subversion repository:
>
>https://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/mailer
>
>but there are others. You can certainly use this script to see how it
>gathers commit info from the repository.

I looked at it but could not make much of it since it is in Python, a
language I am very much not familiar with. I am doing ObjectPascal
(Delphi and FreePascal) for windows and linux platforms and also C
(not C++ though) for embedded controllers...

The Python code was very hard reading for me so I will try my way
along the Pascal rouad to get a commithook mailer that replicates the
emails we got out of CVS.

More experientation has shown up how I can use "svnlook tree" properly
to extract the files in a new tag, so that part is at least covered
now.


-- 
Bo Berglund
Developer in Sweden



Re: How to discover which files are tagged or branced in a hook script?

2017-12-17 Thread Nathan Hartman
On Dec 17, 2017, at 6:35 PM, Bo Berglund  wrote:
> 
> On Sun, 17 Dec 2017 01:22:06 +0100, Branko ?ibej 
> wrote:
> 
>> We'll have to dispel some misconceptions. Subversion's data model is
>> significantly different from CVS's. Tags (and branches) are not
>> properties of files, they're just (sub)trees within the repository.
>> Creating a tag or a branch is exactly the same as copying a directory:
>> the only thing that happens at the repository level is that a new
>> version of the directory is created.
> ...
> 
>> The structure of the repository is entirely free-form. The
>> trunk/branches/tags convention is exactly that: a convention, nothing
>> more. Of course it helps to pick a convention and stick with it.
> 
> 
> I have a hard time getting to understand this...
> Do you mean that using "trunk", "branches" and "tags" as directories
> is entirely voluntary? Does this also mean that files inside a
> tags/something directory can be modified and committed, thus changing
> the content of the tag?
> 
> In my CVS life there is a clear distinction between a tag and a branch
> in that it is not possible to commit changes into a tag but it *is*
> into a branch. So tags are immutable snapshots of the situaton at a
> specific moment in time. Is this not the case in svn?

Yes a tag is basically a copy of a directory as it appeared at a given 
revision. This is a server side copy which means it does not take up any 
storage space. Yes this means that you can commit there which modifies the 
content of the tag -- however: (1) history in Subversion is immutable and 
therefore never lost, so the original tagged content can always be recovered, 
and (2) immediately after tagging you can prevent any further commits to that 
sub tree thus making your tag immutable, though admittedly I don't know the 
incantation to do that. See the svn book by C. Michael Pilato et al, sorry I am 
on my phone and don't have the link handy, but I recall that the chapter about 
tags addresses this issue. The svn book is a good resource and includes a 
chapter on CVS to Subversion migration which may be helpful to you. Hope this 
helps. :-)



Re: How to discover which files are tagged or branced in a hook script?

2017-12-17 Thread Andreas Krey
On Mon, 18 Dec 2017 00:35:29 +, Bo Berglund wrote:
...
> I have a hard time getting to understand this...
> Do you mean that using "trunk", "branches" and "tags" as directories
> is entirely voluntary?

Exactly.

> Does this also mean that files inside a
> tags/something directory can be modified and committed, thus changing
> the content of the tag?

Exactly. Since svn doesn't even know the concept of a 'tag' and its
preferred writeonce property, accidentally doing an 'svn cp trunk tags/1.0'
twice has interesting consequences.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds 
Date: Fri, 22 Jan 2010 07:29:21 -0800


Re: How to discover which files are tagged or branced in a hook script?

2017-12-17 Thread Andreas Krey
On Sun, 17 Dec 2017 01:22:06 +, Branko ??ibej wrote:
...
> The /path/ of the file implies which branch or tag it belongs to. There
> is no other information you need.

Oh yes, there is. Knowing which files are included in the tag
is fine (and a very basic property), but I'd also like to be
able to find out

- which revision of the source tree the tag was taken of,

- which subtree it was taken of,

- and from the other end: which is the last tag
  taken from a specific subtree.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds 
Date: Fri, 22 Jan 2010 07:29:21 -0800


Re: How to discover which files are tagged or branced in a hook script?

2017-12-17 Thread Branko Čibej
On 18.12.2017 08:16, Andreas Krey wrote:
> On Sun, 17 Dec 2017 01:22:06 +, Branko ??ibej wrote:
> ...
>> The /path/ of the file implies which branch or tag it belongs to. There
>> is no other information you need.
> Oh yes, there is. Knowing which files are included in the tag
> is fine (and a very basic property), but I'd also like to be
> able to find out
>
> - which revision of the source tree the tag was taken of,

Recorded as the copied-from revision.

> - which subtree it was taken of,

Recorded as the copied-from path.

> - and from the other end: which is the last tag
>   taken from a specific subtree.

Ah, that one is not recorded.

-- Brane