Right, I'm struggling. I'm partly struggling because this is a back burner task which I can't afford to dedicate a chunk of time to, and I'm partly struggling because PERL is not a language I'm that comfortable with.
brief summary
When using CVS 1.12.13, in Scmbug/Activity.pl, when prepare_product_name
is called, the information which prepare_product_name needs in order to
infer the product name has not yet been set up; but it is available and
is subsequently set up. How do I modify CVS.pm so that
activity->prepare_product_name gets called after the files and
repository data are set up?
This matters critically for tagging operations, since the product name
is needed in order to be able to create a new Bugzilla version for the
product.
in more detail
But, scmbug can - and does - get hold of the information I need. It
sends email to users like this:
The following changeset has been COMMITED.
----------------------------------------------------------------------
Commited by : [EMAIL PROTECTED]
Product : Bugzilla-CVS-Wiki integration
----------------------------------------------------------------------
SCM Repository : /var/lib/cvs/ScottishPower/OPD/frontend
Description :
Fixed spurious Equipment_Owner bug reported by KB
Branch: HEAD
Affected files:
---------------
%{Vvs} --> Bugzilla-CVS-Wiki integration:ScottishPower/OPD/frontend/
Now, the bit I want to isolate in that is the path element immediately
following /var/lib/cvs/ - in this case ScottishPower.
The 'SCM Repository' value comes at line 1027 of
Scmbug/Daemon/Process.pm:
$message .= "SCM Repository : " . $request->{ repository
} . "\n\n";
Where $request is the first arg to mail_notification where it in turn
comes from the first arg to process_activity where in turn it comes from
the third arg to process_connection; however, the bit we're interested
in, the repository, is actually set up in line 108 in
process_connection:
# Retrieve the repository
$line = <$socket_in>;
$line =~ s/\n$//g;
$request->{ repository } = $line;
It seems from my reading that the repository is simply the text of the
third line of the message sent.
Again, by my reading of the code, the message from the Glue to the
Daemon which is being processed in Scmbug/Daemon/Process.pm is
dispatched at line 121 of Scmbug/Glue/Glue.pm:
# Everything went well. Process the requested activity
$self->connection()->process_activity( $self->scm()->activity(),
$self->policies() );
And in Scmbug/Connection.pm at line 71 the repository is actually set up
from the activity:
# Repository
$request .= $activity->repository() . "\n";
Well, you'd think, that's fine; because it's actually within Activity.pm
that prepare_product_name gets called - it's actually a method of
activity. But, sadly, not so. At the time that
activity->prepare_product_name gets called, activity->repository has not
yet been set up - although clearly it does get set up later (just as
activity->files, which is what prepare_product_name actually looks for,
also hasn't been set up, although I'm not sure whether that ever does
get set up).
What's particularly frustrating is that when prepare_product_name is
called, it gets called with these arguments:
prepare_product_name:
arg 0: /var/lib/cvs/CVSROOT/etc/scmbug/glue.conf
arg 1: activity_verify
arg 2: /tmp/cvsCmXw63
arg 3: TestScmbug/lib/Scmbug
The product name - which is what we want to get hold of - is the first
element of arg3. So if I just hacked Activity.pm to extract the product
name from arg3, that would probably work for me - but, of course, would
not work for other users of scmbug.
I have experimentally added
$self->activity()->prepare_product_name();
As the very last line of prepare_activity_tag in CVS.pm; this has had
unexpected results. I can now tag, which I couldn't before (it
complained about missing product name); but a new product version does
not get created in Bugzilla.
The scmbug activity log shows:
[EMAIL PROTECTED]:~# tail -f /var/log/scmbug/activity.log
Wed May 28 17:18:34 2008 127.0.0.1:42849 Processing connection from
localhost
Wed May 28 17:18:34 2008 127.0.0.1:42847 Connection from localhost
processed
Wed May 28 17:18:34 2008 127.0.0.1:42849 Processing an 'activity_tag'
for 'C1873-SRU-Hospitality_RELEASE_1-4-0' from SCM user 'sb'
Wed May 28 17:18:34 2008 127.0.0.1:42851 Processing connection from
localhost
Wed May 28 17:18:34 2008 127.0.0.1:42851 Processing an 'activity_tag'
for 'C1873-SRU-Hospitality_RELEASE_1-4-0' from SCM user 'sb'
Wed May 28 17:18:34 2008 127.0.0.1:42851 Connection from localhost
processed
Wed May 28 17:18:35 2008 reaped 18089
Wed May 28 17:18:37 2008 127.0.0.1:42849 Connection from localhost
processed
Wed May 28 17:18:42 2008 reaped 18083
Simon Brooke, Software Specialist
Cygnet Solutions Ltd
Registered office: Swan House, Darvel, Ayrshire, Scotland, KA17 0LP
Registered in Scotland No. SC158059
mail: [EMAIL PROTECTED]
www: http://www.cygnets.co.uk
tel: +44(0)1560 323444
fax: +44(0)1560 323432
<<inline: rondel.gif>>
_______________________________________________ scmbug-users mailing list [email protected] http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users
