Hi Kristis.
As your other mail suggested, I tried "eval 'use threads';" and that
worked. Thanks for the simplification.
Attached are diffs for the changes I made to integrate with our SVN
browser. There are two sections in the doc: top shows scmbug diffs,
bottom shows Bugzilla diffs.
I wasn't aware of bug 266, but I think what we're doing is pretty
similar with two exceptions:
1. We have multiple SVN repositories, rather than multiple projects in
one repository. Each repo has a unique name to identify it, which is
required by the svn browser, but is not displayed/derivable from the
list of changed files.
2. Our links point to the changelist in the svn browser, not individual
files. We do this because it provides a simpler experience from
end-user perspective and takes full advantage of the browser's
functionality.
Let me know if you have any questions, and thanks again for ScmBug!
-marty
-----Original Message-----
From: Kristis Makris [mailto:[EMAIL PROTECTED]
Sent: Friday, October 19, 2007 6:02 PM
To: Marty Frenzel
Cc: [email protected]
Subject: RE: perl threads in scmbug
Can you also try instead of:
use threads;
to execute:
do 'use threads';
??
Yes, please send the autolinkification patch you have. Are you also
aware of this:
http://bugzilla.mkgnu.net/show_bug.cgi?id=266
??
On Fri, 2007-10-19 at 15:49 -0400, Marty Frenzel wrote:
> Hi Kristis.
>
> Thanks for the prompt turnaround. Unfortunately, I continued to see
the
> problem after applying the patch. To get around it for now I did the
> following:
> - removed "use threads;" from Process.pm.in
> - commented out 'start_daemon_threaded' and its child dependencies in
> Daemon.pm.in
>
> After that it's starting fine. There may well be a simpler approach,
> but since I don't plan to use threads it's a fine workaround for me at
> this time.
>
> On a side note, I did some work to integrate our SVN/ScmBug/Bugzilla
> setup with a repository browser. This allows the Bugzilla comments
> created by ScmBug to link into the repository browser, which shows
> detailed changelist info and diffs for the revision. If you're
> interested let me know and I'll send further details.
>
> Regards,
> marty
>
> -----Original Message-----
> From: Kristis Makris [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 19, 2007 2:57 PM
> To: Marty Frenzel
> Cc: [email protected]
> Subject: Re: perl threads in scmbug
>
> Hi Marty,
>
> All evidence seems to indicate Perl with threads is indeed required
for
> the threaded version. I doubt you are missing a configuration step,
> since the error reported here is coming directly out of Perl -- not
> Scmbug.
>
> But you shouldn't need to be confined to threads if you want to run in
> the forked mode. So I went ahead and applied a change that will use
the
> threads package only if you are configured in the threaded mode. You
can
> manually apply this patch:
>
>
http://www.mkgnu.net/cgi-bin/viewcvs.cgi/scmbug/cvsroot/system/src/lib/p
> roduct/Daemon/Daemon.pm.in?r1=1.89&r2=1.90
>
> Note that I also witnessed this:
>
> http://bugzilla.mkgnu.net/show_bug.cgi?id=264#c39
>
> But the tests in the testsuite are passing.
>
> I hope this helps. Thanks for the feedback.
>
> Kristis
>
> On Fri, 2007-10-19 at 14:29 -0400, Marty Frenzel wrote:
> > Hi Kristis.
> >
> >
> >
> > I've been using ScmBug for a while and recently update to version
0-22
> > while moving to Bugzilla 3. I'm receiving the same 'useithreads'
> > error when as mentioned in comment 34 of bug 264 when trying to
start
> > the daemon and wanted to check with you whether Perl with threads is
> > indeed required, or if I'm missing a configuration step. I tried
> > setting daemon_mode to 'forked' (from 'auto'), but that didn't help.
> > My environment is Linux ES 4 with perl 5.8.8.
> >
> >
> >
> > http://bugzilla.mkgnu.net/show_bug.cgi?id=264#c34
> >
> >
> >
> > thanks and regards.
> >
> > Marty Frenzel
> >
> >
================================================================================================
SCMBUG 0.22 CHANGES
================================================================================================
[EMAIL PROTECTED] scmbug]$ svn diff -r60:61
Index: src/lib/product/Connection.pm.in
===================================================================
--- src/lib/product/Connection.pm.in (revision 60)
+++ src/lib/product/Connection.pm.in (revision 61)
@@ -207,6 +207,20 @@
# Send the end of affected files token
$request .= $PRODUCT_AFFECTED_FILES_END_TOKEN . "\n";
+ # Marty - include commitnumber if one is defined
+ if ( defined( $activity->{ commitnumber }) ) {
+ $request .= $activity->{ commitnumber } . "\n";
+ } else {
+ $request .= "UNKNOWN\n";
+ }
+
+ # Marty - include repository name if one is defined
+ if ( defined( $activity->{ repositoryname }) ) {
+ $request .= $activity->{ repositoryname } . "\n";
+ } else {
+ $request .= "UNKNOWN\n";
+ }
+
return $request;
}
Index: src/lib/product/Tools/Glue_Installer.pm.in
===================================================================
--- src/lib/product/Tools/Glue_Installer.pm.in (revision 60)
+++ src/lib/product/Tools/Glue_Installer.pm.in (revision 61)
@@ -94,6 +94,7 @@
GetOptions( "daemon=s" => \$arguments->{ daemon_ip },
"scm=s" => \$arguments->{ scm_name },
"repository=s" => \$arguments->{ repository_path },
+ "repositoryname=s" => \$arguments->{ repository_name },
"product=s" => \$arguments->{ product_name },
"bug=s" => \$arguments->{ bug_id },
"binary-paths=s" => \$arguments->{ binary_paths },
@@ -124,6 +125,11 @@
print "Missing required argument --repository=<path>\n";
$errors = 1;
}
+
+ if ( $arguments->{ repository_name } eq "" ) {
+ print "Missing required argument --repositoryname=<name>\n";
+ $errors = 1;
+ }
if ( $arguments->{ product_name } eq "" ) {
print "Missing required argument --product=<product_name>\n";
@@ -151,6 +157,7 @@
$install_configuration->{ bug_id } = $arguments->{ bug_id };
$install_configuration->{ daemon_ip } = $arguments->{ daemon_ip };
+ $install_configuration->{ repository_name } = $arguments->{
repository_name };
$install_configuration->{ original_path } =
"@datadir@/@DEVEL_PRODUCT_NAME_LOWER@";
@@ -204,6 +214,8 @@
--repository=<path> The CVSROOT equivalent. MUST use a file:// prefix
for Subversion. Directory that holds the .git
directory for Git
+ --repositoryname=<name> Unique canonical name used to refer to this
repository.
+ For example, 'dev', 'lib', 'intuit', etc.
--bug=<id> The bug number against which this glue installation
will be documented
--binary-paths=<list> A comma(,) separated list of paths to the SCM tool's
@@ -639,6 +651,8 @@
$new_output =~ s/replace_with_scm_tool_name/$regex_replace/;
$regex_replace = $install_configuration->{ binary_paths };
$new_output =~ s/replace_with_paths_to_scm_binaries/$regex_replace/;
+ $regex_replace = $install_configuration->{ repository_name };
+ $new_output =~ s/replace_with_repository_name/$regex_replace/;
Index: src/lib/product/Daemon/Process.pm.in
===================================================================
--- src/lib/product/Daemon/Process.pm.in (revision 60)
+++ src/lib/product/Daemon/Process.pm.in (revision 61)
@@ -401,6 +401,15 @@
$files_state_counter = 0;
}
}
+
+ # Marty - the next line should be the commit number, or 'UNKNOWN' if one
is not known
+ $line = <STDIN>;
+ $line =~ s/\n$//g;
+ $request->{ commitnumber } = $line;
+ # Marty - the next line should be the repository name, or 'UNKNOWN' if one
is not known
+ $line = <STDIN>;
+ $line =~ s/\n$//g;
+ $request->{ repositoryname } = $line;
}
@@ -796,7 +805,17 @@
my ( $request ) = ( @_ );
# Prepare a log message that will list the affected files commited
- $request->{ log_message } = $request->{ original_log_message } . "\n";
+ # Marty: Also include the commitnumber (i.e. revision number) in a
specially formatted syntax that
+ # Bugzilla uses to automatically generate links into a repository browser.
+ # Do not change the 'svncommit <REP>-<NBR>' syntax without also updating
Bugzilla's serach/replace
+ # regex. Otherwise, automatic link generation will break.
+ # See: <BUGZILLA_ROOT>/Bugzilla/Template.pm
+ if ( $request->{ repositoryname } eq "UNKNOWN" ) {
+ $request->{ log_message } = "svncommit " . $request->{ commitnumber }
. "\n";
+ } else {
+ $request->{ log_message } = "svncommit " . $request->{ repositoryname
} . "-" . $request->{ commitnumber } . "\n";
+ }
+ $request->{ log_message } .= $request->{ original_log_message };
$request->{ log_message } .= $PRODUCT_BRANCH_NAME_TOKEN .
$PRODUCT_BRANCH_NAME_SPACE_TOKEN . $request->{ branch_name } . "\n";
$request->{ log_message } .= $PRODUCT_AFFECTED_FILES_TOKEN;
foreach my $file ( sort keys %{ $request->{ files } } ) {
Index: src/lib/product/Glue/Subversion.pm.in
===================================================================
--- src/lib/product/Glue/Subversion.pm.in (revision 60)
+++ src/lib/product/Glue/Subversion.pm.in (revision 61)
@@ -209,6 +209,9 @@
$old_version = $line;
close ( SVNLOOK_YOUNGEST );
+ # Marty - store the commit number for later reference
+ $self->activity()->{ commitnumber } = $old_version;
+
# Find the list of affected files
open ( SVNLOOK_CHANGED, "@DEVEL_CONFIG_SCM_BINARY_SVNLOOK@ changed " .
$svn_tools_argument . " $svn_txn $svn_repository |" ) || @[EMAIL PROTECTED](
$GLUE_ERROR_CANNOT_EXECUTE_SVNLOOK_CHANGED, "Cannot execute 'svnlook changed':
$!\n");
# Cygwin has a problem with newlines
Index: src/lib/product/Glue/Glue.pm.in
===================================================================
--- src/lib/product/Glue/Glue.pm.in (revision 60)
+++ src/lib/product/Glue/Glue.pm.in (revision 61)
@@ -114,6 +114,13 @@
# Automatically detect the branch name
$self->scm()->prepare_branch_name();
+ # Marty - set the name of this Subversion repository in the activity.
It's an odd place
+ # to put it, but we put it there since the activity is already pushed
through and this way
+ # we don't need to modify a lot of stuff.
+ if ( defined ($self->configuration()->{ repository }->{ name }) ) {
+ $self->scm()->activity()->{ repositoryname } =
$self->configuration()->{ repository }->{ name };
+ }
+
# Check if this activity adheres to the defined policies
$self->check_policies( $self->scm()->{ activity } );
@@ -143,6 +150,11 @@
$new_activity->product_name_prefixes(
$self->scm()->activity()->product_name_prefixes() );
$new_activity->{ type }->{ tag } = $self->scm()->activity()->{ type
}->{ tag };
+ # Marty - set the name of this Subversion repository in the activity.
+ if ( defined ($self->configuration()->{ repository }->{ name }) ) {
+ $new_activity->{ repositoryname } = $self->configuration()->{
repository }->{ name };
+ }
+
foreach my $file ( keys %{ $self->scm()->activity()->{ files } } ) {
# Copy the list of files from the commit activity. Store
# the old version as the version that will be tagged.
Index: src/glue/etc/product/glue.conf.template.in
===================================================================
--- src/glue/etc/product/glue.conf.template.in (revision 60)
+++ src/glue/etc/product/glue.conf.template.in (revision 61)
@@ -40,6 +40,14 @@
},
#
+ # Canonical name used to reference this repository. Each repository
+ # must have a unique name. At Allurent we use this name to tie back
+ # to this repository in the repository browser.
+ repository => {
+ name => 'replace_with_repository_name'
+ },
+
================================================================================================
BUGZILLA 3.0 CHANGES
================================================================================================
[EMAIL PROTECTED] bugzilla-trunk]$ svn diff -r53:54
Index: skins/custom/global.css
===================================================================
--- skins/custom/global.css (revision 53)
+++ skins/custom/global.css (revision 54)
@@ -2,3 +2,7 @@
* Custom rules for global.css.
* The rules you put here override rules in that stylesheet.
*/
+
+/* Source control commit messages */
+.bz_scmcommit { background: #7DCEC5; }
+
Index: Bugzilla/Template.pm
===================================================================
--- Bugzilla/Template.pm (revision 53)
+++ Bugzilla/Template.pm (revision 54)
@@ -352,6 +352,19 @@
~get_bug_link($1, $1)
~egmx;
+ # --------------------------------------------
+ # Marty : check for Subversion commit links and colorize their comments
+ # ---------------- START ---------------------
+ my $svncommitregex = qr/svncommit\s((\w+)-)?(\d+)/i;
+ $text =~ s~\b($svncommitregex)\b
+ ~GetRevisionLink($4, $3)
+ ~egmx;
+
+ if ( $text=~/\b($svncommitregex)\b/ ) {
+ $text = "<DIV class=\"bz_scmcommit\">$text</DIV>";
+ }
+ # ---------------- END ---------------------
+
# Now remove the encoding hacks
$text =~ s/\0\0(\d+)\0\0/$things[$1]/eg;
$text =~ s/$chr1\0/\0/g;
@@ -359,6 +372,22 @@
return $text;
}
+# Marty : GetRevisionLink creates a link to the Subversion repository browser
+sub GetRevisionLink {
+ my ($revision_num, $repository_name) = @_;
+ $revision_num || return "<missing revision number>";
+
+ my $revlink;
+ if (! defined $repository_name ) {
+ # assume 'dev' repo if one was not specified
+ $revlink = "<a
href=\"http://svn.allurent.com:8080/browser/revinfo.svn?revision=$revision_num&name=dev\">svncommit
$revision_num</a>";
+ } else {
+ $revlink = "<a
href=\"http://svn.allurent.com:8080/browser/revinfo.svn?revision=$revision_num&name=$repository_name\">svncommit
$repository_name-$revision_num</a>";
+ }
+
+ return $revlink;
+}
+
# Creates a link to an attachment, including its title.
sub get_attachment_link {
my ($attachid, $link_text) = @_;
_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users