RE: Common name for transaction and revision object
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 3027851VAT Reg No 778499447
RE: Common name for transaction and revision object
Linedata Services (UK) Ltd Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB Registered in England and Wales No 3027851VAT Reg No 778499447 -Original Message- From: Geoff Rowell [mailto:geoff.row...@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 giulio.trocc...@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
From: Geoff Rowell [mailto:geoff.row...@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 giulio.trocc...@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
On Wed, Apr 28, 2010 at 10:01 AM, Cooke, Mark mark.co...@siemens.com wrote: From: Geoff Rowell [mailto:geoff.row...@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 giulio.trocc...@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.row...@gmail.com
Re: Common name for transaction and revision object
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 3027851VAT Reg No 778499447 -Original Message- From: Geoff Rowell [mailto:geoff.row...@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 Troccoligiulio.trocc...@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
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
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 3027851VAT Reg No 778499447
RE: Common name for transaction and revision object
Giulio Troccoli giulio.trocc...@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 3027851VAT Reg No 778499447
Re: Common name for transaction and revision object
On Thu, Apr 22, 2010 at 10:01 AM, Giulio Troccoli giulio.trocc...@uk.linedata.com wrote: Giulio Troccoli giulio.trocc...@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.row...@gmail.com