Thread: [Codestriker-commits] CVS update: codestriker/lib/Codestriker/FileParser Parser.pm
Brought to you by:
sits
|
From: <si...@us...> - 2007-08-18 04:17:26
|
User: sits
Date: 07/08/17 21:17:19
Modified: . CHANGELOG
lib/Codestriker/FileParser Parser.pm
Log:
* Handle topic text that starts with the UTF-8 BOM.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -r1.211 -r1.212
--- CHANGELOG 18 Aug 2007 04:15:46 -0000 1.211
+++ CHANGELOG 18 Aug 2007 04:17:19 -0000 1.212
@@ -45,6 +45,8 @@
* When calculating metrics, make sure email addresses are handled in
a case-insensitive manner.
+* Handle topic text that starts with the UTF-8 BOM.
+
Version 1.9.3
* The project list screen now displays for each project, the total
Index: Parser.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/Parser.pm,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- Parser.pm 10 Jun 2006 02:58:34 -0000 1.23
+++ Parser.pm 18 Aug 2007 04:17:19 -0000 1.24
@@ -57,7 +57,13 @@
}
binmode $fh;
+ my $first_line = 1;
while (<$fh>) {
+ if ($first_line) {
+ # Remove the UTF8 BOM if it exists.
+ s/^\xEF\xBB\xBF//o;
+ $first_line = 0;
+ }
my $line = Codestriker::decode_topic_text($_);
$line =~ s/\r\n/\n/go;
print $tmpfh $line;
|
|
From: <si...@us...> - 2008-06-26 21:52:24
|
User: sits
Date: 08/06/26 14:52:23
Modified: . CHANGELOG codestriker.conf
lib/Codestriker/FileParser Parser.pm
Log:
* Introduced new configuration variable $sort_diffs_by_filename in
codestriker.conf which indicates whether the diff chunks inside a
topic should be ordered by filename. Apparently Subversion can
produce diff topics in some circumstances in arbitrary order,
where using this setting would make sense. Default is for this
setting to disabled.
Prompted by https://sourceforge.net/tracker/index.php?func=detail&aid=2003380&group_id=41136&atid=429860.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -r1.236 -r1.237
--- CHANGELOG 25 Jun 2008 07:27:12 -0000 1.236
+++ CHANGELOG 26 Jun 2008 21:52:22 -0000 1.237
@@ -65,6 +65,13 @@
* Can now comment on any line of any file in the review, not just those
that are a part of the diff file.
+
+* Introduced new configuration variable $sort_diffs_by_filename in
+ codestriker.conf which indicates whether the diff chunks inside a
+ topic should be ordered by filename. Apparently Subversion can
+ produce diff topics in some circumstances in arbitrary order,
+ where using this setting would make sense. Default is for this
+ setting to disabled.
Version 1.9.4
Index: codestriker.conf
===================================================================
RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- codestriker.conf 23 Jun 2008 07:15:56 -0000 1.98
+++ codestriker.conf 26 Jun 2008 21:52:23 -0000 1.99
@@ -346,6 +346,13 @@
# can be changed dynamically on the view topic screen.
$default_tabwidth = 8;
+# Indicate whether the diffs presented in a topic should be ordered by
+# filename. For some deployments, it is important that the order of the
+# diffs are presented in the same order as it was in the file. For other
+# deployments, apparently Subversion can returns diffs in an arbitrary
+# order, so setting this to '1' would be useful.
+$sort_diffs_by_filename = 0;
+
# Bug database to update. Currently, Bugzilla, Flyspray and TestDirector
# are supported, but it is straight-forward to support other bug
# databases. To enable Bugzilla, set $bug_db to "bugzilla", and set
Index: Parser.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/Parser.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Parser.pm 18 Aug 2007 04:17:19 -0000 1.24
+++ Parser.pm 26 Jun 2008 21:52:23 -0000 1.25
@@ -172,9 +172,12 @@
seek($fh, 0, 0) ||
die "Unable to seek to the start of the temporary file. $!";
- # Sort the diff chunks by filename, then old linenumber.
- @diffs = sort { $a->{filename} cmp $b->{filename} ||
- $a->{old_linenumber} <=> $b->{old_linenumber} } @diffs;
+ if (defined $Codestriker::sort_diffs_by_filename &&
+ $Codestriker::sort_diffs_by_filename) {
+ # Sort the diff chunks by filename, then old linenumber.
+ @diffs = sort { $a->{filename} cmp $b->{filename} ||
+ $a->{old_linenumber} <=> $b->{old_linenumber} } @diffs;
+ }
# Only include those files whose extension is not in
# @Codestriker::exclude_file_types, provided it is defined.
|