[Bps-public-commit] App-Changeloggr branch, master, updated. 8701627ce526dba410d9d9cdbf101daca3658919
sartak at bestpractical.com
sartak at bestpractical.com
Fri Feb 27 21:23:47 EST 2009
The branch, master has been updated
via 8701627ce526dba410d9d9cdbf101daca3658919 (commit)
from 5b40dcdbf6378ec2b7548e6e5f80590abe58dcd2 (commit)
Summary of changes:
lib/App/Changeloggr/Model/Change.pm | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
- Log -----------------------------------------------------------------
commit 8701627ce526dba410d9d9cdbf101daca3658919
Author: Shawn M Moore <sartak at gmail.com>
Date: Fri Feb 27 21:23:40 2009 -0500
Change->guess_type
diff --git a/lib/App/Changeloggr/Model/Change.pm b/lib/App/Changeloggr/Model/Change.pm
index d220c5c..075bc35 100644
--- a/lib/App/Changeloggr/Model/Change.pm
+++ b/lib/App/Changeloggr/Model/Change.pm
@@ -31,5 +31,24 @@ sub current_user_can {
return $self->SUPER::current_user_can($right, @_);
}
+sub guess_type {
+ my $self = shift;
+ my $text = shift;
+
+ if ($text =~ /^commit [0-9a-f]{32}$/m) {
+ return 'git';
+ }
+
+ if ($text =~ /^-{70}$/m) {
+ return 'svk';
+ }
+
+ if ($text =~ /^\w{3} \w{3} +\d+ \d\d:\d\d:\d\d \w{3} \d{4} /m) {
+ return 'darcs';
+ }
+
+ return 'unknown';
+}
+
1;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list