On Mon, Sep 6, 2010 at 7:57 PM, Giulio Troccoli <
giulio.trocc...@uk.linedata.com> wrote:

>
>
>
>
>
>
> Linedata Limited
> Registered Office: 85 Gracechurch St., London, EC3V 0AA
> Registered in England and Wales No 3475006 VAT Reg No 710 3140 03
>
> ________________________________
>
>
>
>        From: Daniel Becroft [mailto:djcbecr...@gmail.com]
>        Sent: 06 September 2010 10:52
>        To: Giulio Troccoli
>        Cc: users@subversion.apache.org
>        Subject: Re: Transaction and revision numbers
>
>
>        On Mon, Sep 6, 2010 at 7:29 PM, Giulio Troccoli <
> giulio.trocc...@uk.linedata.com> wrote:
>
>
>                Is there a special format of a transaction number?
>
>                I would like to write a method in perl that gets a number,
> either transaction or revision, and then adds the correct --revision or
> --transaction parameter (for the svnlook command). So if there is a special
> format for a transaction number I can use a regular expression to check it.
>
>
>
>        The difference between a transaction and revision number depends
> purely on context. AFAIK, the only time a transaction number is available is
> within a pre-commit hook - once the transaction has been committed, it's a
> revision number.
>
>        What context would your script be run in?
>
>        Cheers,
>        Daniel B.
>
>
> The class will be used by both the pre- and post-commit hooks, hence the
> need to distinguish between transaction or revision. And I would like to do
> it by just looking at the transaction/revision number.



> I think transactions are in the format of 9999999-9 (where 9 is any single
> number) while revisions are in the format 99999. If that's true, then I can
> check for the dash and I'm done. Can anyone confirm it to me?


Again, I think you would be better using it based on context, rather than
the actual string format (this could change down the track). Something like
this would be the simplest (but not the best):

PerformAction(repository_uuid, transaction_Id, revision_Id)

- for pre-commit hook, only populate the first two parameters
- for post-commit hook, populate the first and third parameters

Cheers,
Daniel B.

Reply via email to