Simon, please send all communication to the mailing list.

On Thu, 2008-05-08 at 11:52 +0100, Simon Brooke wrote:
> Right! Things are getting better.
> 
> There is a function in Activity.pm called prepare_product_name. This gets 
> called from the function prepare_activity_verify_or_commit in Subversion.pm, 
> which in turn gets called from prepare_activity_verify and 
> prepare_activity_commit in the same file.
> 
> CVS.pm also has functions (methods?) prepare_activity_verify and 
> prepare_activity_commit, but these never call prepare_product_name. So the 
> solution is probably, fix 'em so they do - clearly, only if CVS version is 
> 1.12 or greater (but less than 2.0 as that's CVSNT).

No.

It's for is_version_latest() but *NOT* is_version_latest_cvsnt()

Don't use version numbers. Call functions.

> This patch should do that:
> 
> --- CVSROOT/lib/scmbug/Scmbug/Glue/CVS.pm     2008/04/28 14:57:41     1.1
> +++ CVSROOT/lib/scmbug/Scmbug/Glue/CVS.pm     2008/05/08 10:10:33     1.2
> @@ -165,6 +165,14 @@ sub prepare_activity_verify() {
>      # It is impossible to determine the branch name from CVS at this
>      # stage
>      $self->activity()->branch_name( $BRANCH_NAME_INDETERMINATE );
> +    
> +    #
> +     # If version is 1.12 or greater but less than 2.0 (CVSNT), then
> +     # automatically detect the product name. sb 20080508
> +     #
> +    if ( $self->is_version_latest() ) {
> +             $self->activity()->prepare_product_name();
> +    }
>  
>      # These are the arguments produced by CVS
>      # There is only 1 and it is in the format: <log_file_name>
> @@ -261,6 +269,12 @@ sub prepare_activity_commit_latest {
>  
>       $self->activity()->{ files }->{ $filename }->{ old_version } = 
> $old_version;
>       $self->activity()->{ files }->{ $filename }->{ new_version } = 
> $new_version;
> +     
> +     #
> +     # Automatically detect the product name. sb 20080508
> +     #
> +     $self->activity()->prepare_product_name();
> +     
>       $arguments_size = scalar @remaining_arguments;
>      }
>  }
> 
> However, this doesn't completely solve the problem. prepare_product_name 
> calls autodetect_product_name which iterates over the patterns in 
> product_name_prefixes until one matches the filename. As an aside could I 
> comment that 'prefixes' isn't a very helpful name here, because they aren't 
> prefixes, they're patterns... However my problem is that 
> product_name_prefixes isn't getting initialised for me, although I have in my 
> glue.conf the stanza:
> 
>       product_name_definition => {
>               type => 'auto',
>               value => '/\/?([0-9A-Za-z_-]*).*$/, 
> /\/var\/lib/cvs\/([0-9A-Za-z_-]*).*$/'
>       },
> 
> I'm further investigating why product_name_prefixes doesn't get initialised, 
> but if you can give me any pointers I'd be grateful.

I think you need to setup the value regular expression appropriately.
There are examples in the manual.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

Reply via email to