You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Giulio Troccoli <Gi...@uk.linedata.com> on 2010/04/22 10:17:43 UTC
Common name for transaction and revision object
Hello guys,
I'm writing the hooks for a new repository in Perl and I'm exploring using OO Perl. In both pre- and post-commit hooks I need the list of files, the author and other similar information. My idea was to define a class and create an instance of that class given either the transaction number adn repository path or the revision number and the repository URL. The 'new' function will then initialise all the information I need calling either svnlook or svn. For instance:
my $transaction = new Transaction($txn, $repo_path);
Or
my $commit = new Commit($rev, $repo_url);
As you can see they are almost the same, so it would be nice to have a single class (I could then check the second parameter to see if it's a URL or a path and do things accordingly). But I cannot come up with a single name that would encompass both, and that's what I'm asking the list.
So, any suggestions?
Thanks
Giulio
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
Re: Common name for transaction and revision object
Posted by Geoff Rowell <ge...@gmail.com>.
On Thu, Apr 22, 2010 at 10:01 AM, Giulio Troccoli
<Gi...@uk.linedata.com> wrote:
>> Giulio Troccoli <Gi...@uk.linedata.com> wrote:
>> >
>> > I'm writing the hooks for a new repository in Perl and I'm
>> exploring
>> > using
>> OO Perl. In both pre- and post-commit hooks I need the list
>> of files, the author and other similar information. My idea
>> was to define a class and create an instance of that class
>> given either the transaction number adn repository path or
>> the revision number and the repository URL. The 'new'
>> function will then initialise all the information I need
>> calling either svnlook or svn. For instance:
>> >
>> > my $transaction = new Transaction($txn, $repo_path);
>> >
>> > Or
>> >
>> > my $commit = new Commit($rev, $repo_url);
>> >
>> > As you can see they are almost the same, so it would be
>> nice to have a
>> single class (I could then check the second parameter to see
>> if it's a URL or a path and do things accordingly). But I
>> cannot come up with a single name that would encompass both,
>> and that's what I'm asking the list.
>> >
>> > So, any suggestions?
>>
>> Sounds like you're duplicating the Subversion Hook Framework.
>>
>> http://sourceforge.net/projects/svnhook
>>
>
> Well, not really. It's sounds like a very interesting project and I think it should be publicised more, but it's not really suitable for my case (I think).
>
> We use our in-house bug-tracking system and both pre- and post-commit hooks have to interact with that. This does not include only checking if the bug number is correct, but also if the issue has the correct status, if we are committing in the correct branch, etc. I'm sure that could be done with that framework (but please correct me if I'm wrong).
>
Hi Giulio,
I've added an "ExecuteCmd" action tag to version 2.1.3 that can be
used to execute system commands.
--
Geoff Rowell
geoff.rowell@gmail.com
RE: Common name for transaction and revision object
Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
> Giulio Troccoli <Gi...@uk.linedata.com> wrote:
> >
> > I'm writing the hooks for a new repository in Perl and I'm
> exploring
> > using
> OO Perl. In both pre- and post-commit hooks I need the list
> of files, the author and other similar information. My idea
> was to define a class and create an instance of that class
> given either the transaction number adn repository path or
> the revision number and the repository URL. The 'new'
> function will then initialise all the information I need
> calling either svnlook or svn. For instance:
> >
> > my $transaction = new Transaction($txn, $repo_path);
> >
> > Or
> >
> > my $commit = new Commit($rev, $repo_url);
> >
> > As you can see they are almost the same, so it would be
> nice to have a
> single class (I could then check the second parameter to see
> if it's a URL or a path and do things accordingly). But I
> cannot come up with a single name that would encompass both,
> and that's what I'm asking the list.
> >
> > So, any suggestions?
>
> Sounds like you're duplicating the Subversion Hook Framework.
>
> http://sourceforge.net/projects/svnhook
>
Well, not really. It's sounds like a very interesting project and I think it should be publicised more, but it's not really suitable for my case (I think).
We use our in-house bug-tracking system and both pre- and post-commit hooks have to interact with that. This does not include only checking if the bug number is correct, but also if the issue has the correct status, if we are committing in the correct branch, etc. I'm sure that could be done with that framework (but please correct me if I'm wrong).
Giulio
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
RE: Common name for transaction and revision object
Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
> Giulio Troccoli <Gi...@uk.linedata.com> wrote:
> >
> > I'm writing the hooks for a new repository in Perl and I'm
> exploring
> > using
> OO Perl. In both pre- and post-commit hooks I need the list
> of files, the author and other similar information. My idea
> was to define a class and create an instance of that class
> given either the transaction number adn repository path or
> the revision number and the repository URL. The 'new'
> function will then initialise all the information I need
> calling either svnlook or svn. For instance:
> >
> > my $transaction = new Transaction($txn, $repo_path);
> >
> > Or
> >
> > my $commit = new Commit($rev, $repo_url);
> >
> > As you can see they are almost the same, so it would be
> nice to have a
> single class (I could then check the second parameter to see
> if it's a URL or a path and do things accordingly). But I
> cannot come up with a single name that would encompass both,
> and that's what I'm asking the list.
> >
> > So, any suggestions?
>
> Sounds like you're duplicating the Subversion Hook Framework.
>
> http://sourceforge.net/projects/svnhook
>
Well, not really. It's sounds like a very interesting project and I think it should be publicised more, but it's not really suitable for my case (I think).
We use our in-house bug-tracking system and both pre- and post-commit hooks have to interact with that. This does not include only checking if the bug number is correct, but also if the issue has the correct status, if we are committing in the correct branch, etc. I'm sure that could be done with that framework (but please correct me if I'm wrong).
Giulio
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
Re: Common name for transaction and revision object
Posted by Geoff Rowell <ge...@gmail.com>.
On Wed, Apr 28, 2010 at 10:01 AM, Cooke, Mark <ma...@siemens.com> wrote:
>> > From: Geoff Rowell [mailto:geoff.rowell@gmail.com]
>> > Sent: 22 April 2010 14:21
>> > To: Giulio Troccoli
>> > Cc: users@subversion.apache.org
>> > Subject: RE: Common name for transaction and revision object
>> >
>> > Giulio Troccoli <Gi...@uk.linedata.com> wrote:
>> > >
>> > > I'm writing the hooks for a new repository in Perl and I'm
>> > exploring
>> > > using
>> > OO Perl. In both pre- and post-commit hooks I need the list
>> > of files, the author and other similar information. My idea
>> > was to define a class and create an instance of that class
>> > given either the transaction number adn repository path or
>> > the revision number and the repository URL. The 'new'
>> > function will then initialise all the information I need
>> > calling either svnlook or svn. For instance:
>> > >
>> > > my $transaction = new Transaction($txn, $repo_path);
>> > >
>> > > Or
>> > >
>> > > my $commit = new Commit($rev, $repo_url);
>> > >
>> > > As you can see they are almost the same, so it would be
>> > nice to have a
>> > single class (I could then check the second parameter to see
>> > if it's a URL or a path and do things accordingly). But I
>> > cannot come up with a single name that would encompass both,
>> > and that's what I'm asking the list.
>> > >
>> > > So, any suggestions?
>> >
>>
>> Sorry, for posting again but I haven't received any
>> suggestions regarding the name. Nobody can come up with
>> anything? Really?
>>
> What about "Transaction" or "BaseTransaction" or "TransactionBase"? A
> commit is just a specific transaction anyway.
>
> What does the other poster use in the framework he pointed you to?
>
SvnHook uses Context::Transaction (as opposed to Context::Revision and
Context::Standard).
--
Geoff Rowell
geoff.rowell@gmail.com
RE: Common name for transaction and revision object
Posted by "Cooke, Mark" <ma...@siemens.com>.
> > From: Geoff Rowell [mailto:geoff.rowell@gmail.com]
> > Sent: 22 April 2010 14:21
> > To: Giulio Troccoli
> > Cc: users@subversion.apache.org
> > Subject: RE: Common name for transaction and revision object
> >
> > Giulio Troccoli <Gi...@uk.linedata.com> wrote:
> > >
> > > I'm writing the hooks for a new repository in Perl and I'm
> > exploring
> > > using
> > OO Perl. In both pre- and post-commit hooks I need the list
> > of files, the author and other similar information. My idea
> > was to define a class and create an instance of that class
> > given either the transaction number adn repository path or
> > the revision number and the repository URL. The 'new'
> > function will then initialise all the information I need
> > calling either svnlook or svn. For instance:
> > >
> > > my $transaction = new Transaction($txn, $repo_path);
> > >
> > > Or
> > >
> > > my $commit = new Commit($rev, $repo_url);
> > >
> > > As you can see they are almost the same, so it would be
> > nice to have a
> > single class (I could then check the second parameter to see
> > if it's a URL or a path and do things accordingly). But I
> > cannot come up with a single name that would encompass both,
> > and that's what I'm asking the list.
> > >
> > > So, any suggestions?
> >
>
> Sorry, for posting again but I haven't received any
> suggestions regarding the name. Nobody can come up with
> anything? Really?
>
> G
>
What about "Transaction" or "BaseTransaction" or "TransactionBase"? A
commit is just a specific transaction anyway.
What does the other poster use in the framework he pointed you to?
~ mark c
RE: Common name for transaction and revision object
Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
> > If you look at the svn_fs.h API, they are both referred to
> as revision roots. svn_fs_revision_root() and
> svn_fs_txn_root() both return a svn_fs_root_t * object.
>
> That does not sound like they're both being referred to as
> "revision roots"; that sounds like they're both being
> referred to as "roots".
>
> If you're just looking to name a variable, you can call it
> RevisionOrTransaction.
I'm trying to name a class that will hold information about a transaction (during pre-commit) or a revision (during post-commit). Because the information is pretty much the same, e.g path, url, files changes, log message, etc., I thought I could have a common class and then either use it in both pre- and post-commit hooks or use it as a parent class of more specialised Transaction and. Revision classes. I'm working in Perl, btw.
I'm leaning towards calling it TxnRev to be honest.
G
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
RE: Common name for transaction and revision object
Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
> > If you look at the svn_fs.h API, they are both referred to
> as revision roots. svn_fs_revision_root() and
> svn_fs_txn_root() both return a svn_fs_root_t * object.
>
> That does not sound like they're both being referred to as
> "revision roots"; that sounds like they're both being
> referred to as "roots".
>
> If you're just looking to name a variable, you can call it
> RevisionOrTransaction.
I'm trying to name a class that will hold information about a transaction (during pre-commit) or a revision (during post-commit). Because the information is pretty much the same, e.g path, url, files changes, log message, etc., I thought I could have a common class and then either use it in both pre- and post-commit hooks or use it as a parent class of more specialised Transaction and. Revision classes. I'm working in Perl, btw.
I'm leaning towards calling it TxnRev to be honest.
G
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
Re: Common name for transaction and revision object
Posted by Blair Zajac <bl...@orcaware.com>.
On 04/28/2010 02:38 PM, Ryan Schmidt wrote:
> On Apr 28, 2010, at 10:03, Blair Zajac wrote:
>
>> If you look at the svn_fs.h API, they are both referred to as revision roots. svn_fs_revision_root() and svn_fs_txn_root() both return a svn_fs_root_t * object.
>
> That does not sound like they're both being referred to as "revision roots"; that sounds like they're both being referred to as "roots".
Oops, yes, they are filesystem roots.
> If you're just looking to name a variable, you can call it RevisionOrTransaction.
I've done that in code I've used, or RevisionOrTransactionRoot for my
use case.
Blair
Re: Common name for transaction and revision object
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Apr 28, 2010, at 10:03, Blair Zajac wrote:
> If you look at the svn_fs.h API, they are both referred to as revision roots. svn_fs_revision_root() and svn_fs_txn_root() both return a svn_fs_root_t * object.
That does not sound like they're both being referred to as "revision roots"; that sounds like they're both being referred to as "roots".
If you're just looking to name a variable, you can call it RevisionOrTransaction.
Re: Common name for transaction and revision object
Posted by Blair Zajac <bl...@orcaware.com>.
On 4/28/10 6:46 AM, Giulio Troccoli wrote:
>>
>
>
> Linedata Services (UK) Ltd
> Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
> Registered in England and Wales No 3027851 VAT Reg No 778499447
>
> -----Original Message-----
>
>
>> From: Geoff Rowell [mailto:geoff.rowell@gmail.com]
>> Sent: 22 April 2010 14:21
>> To: Giulio Troccoli
>> Cc: users@subversion.apache.org
>> Subject: RE: Common name for transaction and revision object
>>
>> Giulio Troccoli<Gi...@uk.linedata.com> wrote:
>>>
>>> I'm writing the hooks for a new repository in Perl and I'm
>> exploring
>>> using
>> OO Perl. In both pre- and post-commit hooks I need the list
>> of files, the author and other similar information. My idea
>> was to define a class and create an instance of that class
>> given either the transaction number adn repository path or
>> the revision number and the repository URL. The 'new'
>> function will then initialise all the information I need
>> calling either svnlook or svn. For instance:
>>> As you can see they are almost the same, so it would be
>> nice to have a
>> single class (I could then check the second parameter to see
>> if it's a URL or a path and do things accordingly). But I
>> cannot come up with a single name that would encompass both,
>> and that's what I'm asking the list.
>>>
>>> So, any suggestions?
>>
>
> Sorry, for posting again but I haven't received any suggestions regarding the name. Nobody can come up with anything? Really?
If you look at the svn_fs.h API, they are both referred to as revision roots.
svn_fs_revision_root() and svn_fs_txn_root() both return a svn_fs_root_t * object.
Blair
RE: Common name for transaction and revision object
Posted by Giulio Troccoli <Gi...@uk.linedata.com>.
>
Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447
-----Original Message-----
> From: Geoff Rowell [mailto:geoff.rowell@gmail.com]
> Sent: 22 April 2010 14:21
> To: Giulio Troccoli
> Cc: users@subversion.apache.org
> Subject: RE: Common name for transaction and revision object
>
> Giulio Troccoli <Gi...@uk.linedata.com> wrote:
> >
> > I'm writing the hooks for a new repository in Perl and I'm
> exploring
> > using
> OO Perl. In both pre- and post-commit hooks I need the list
> of files, the author and other similar information. My idea
> was to define a class and create an instance of that class
> given either the transaction number adn repository path or
> the revision number and the repository URL. The 'new'
> function will then initialise all the information I need
> calling either svnlook or svn. For instance:
> >
> > my $transaction = new Transaction($txn, $repo_path);
> >
> > Or
> >
> > my $commit = new Commit($rev, $repo_url);
> >
> > As you can see they are almost the same, so it would be
> nice to have a
> single class (I could then check the second parameter to see
> if it's a URL or a path and do things accordingly). But I
> cannot come up with a single name that would encompass both,
> and that's what I'm asking the list.
> >
> > So, any suggestions?
>
Sorry, for posting again but I haven't received any suggestions regarding the name. Nobody can come up with anything? Really?
G
RE: Common name for transaction and revision object
Posted by Geoff Rowell <ge...@gmail.com>.
Giulio Troccoli <Gi...@uk.linedata.com> wrote:
>
> I'm writing the hooks for a new repository in Perl and I'm exploring using
OO Perl. In both pre- and post-commit hooks I need the list of files, the
author and other similar information. My idea was to define a class and
create an instance of that class given either the transaction number adn
repository path or the revision number and the repository URL. The 'new'
function will then initialise all the information I need calling either
svnlook or svn. For instance:
>
> my $transaction = new Transaction($txn, $repo_path);
>
> Or
>
> my $commit = new Commit($rev, $repo_url);
>
> As you can see they are almost the same, so it would be nice to have a
single class (I could then check the second parameter to see if it's a URL
or a path and do things accordingly). But I cannot come up with a single
name that would encompass both, and that's what I'm asking the list.
>
> So, any suggestions?
Sounds like you're duplicating the Subversion Hook Framework.
http://sourceforge.net/projects/svnhook
---
Geoff Rowell
geoff.rowell@gmail.com