]> git.pld-linux.org Git - packages/cvsspam.git/commitdiff
- trac url can't be resolved so early
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 23 Apr 2009 18:01:27 +0000 (18:01 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cvsspam-trac.patch -> 1.5

cvsspam-trac.patch

index 2d08040d41e2fedf94a2c151c5648347236f35c1..c1b80a34d4af08c7ed2abbce7a46c10dee40b38a 100644 (file)
@@ -1,5 +1,5 @@
---- cvsspam-0.2.12/cvsspam.rb  2009-04-23 20:18:09.329309382 +0300
-+++ tmp/cvsspam.rb     2009-04-23 19:19:04.000000000 +0300
+--- cvsspam-0.2.12/cvsspam.rb  2009-04-23 20:54:40.224507514 +0300
++++ cvsspam/cvsspam.rb 2009-04-23 20:53:58.177842646 +0300
 @@ -560,6 +560,10 @@
  jiraSub = proc { |match|
    "<a href=\"#{$jiraURL.sub(/%s/, match)}\">#{match}</a>"
  ticketSub = proc { |match|
    match =~ /([0-9]+)/
    "<a href=\"#{$ticketURL.sub(/%s/, $1)}\">#{match}</a>"
-@@ -930,15 +934,15 @@
+@@ -929,16 +933,39 @@
  # Link to Trac
  class TracFrontend < WebFrontend
++
++  def base_url()
++      url = @base_url
++
++    module_path = '/'
++    if Repository.count == 1
++      rep = Repository.array.first
++      module_path << rep.common_prefix
++    end
++
++      # if $tracProjects is set process repository_name to setup new $tracURL
++      if $tracProjects != nil && $tracURL != nil
++              $tracProjects.sort {|a,b| b[1] <=> a[1] }.each do |project, path|
++                      if module_path.index(path) == 0
++                              url = "#{@base_url}/#{project}"
++                              break
++                      end
++              end
++      end
++      blah("base_url: '#{url}'")
++      return url
++  end
++
    def path_url(path, tag)
 -    add_repo("#{@base_url}browser/#{urlEncode(path)}")
-+    add_repo("#{@base_url}/browser/#{urlEncode(path)}")
++    add_repo("#{base_url}/browser/#{urlEncode(path)}")
    end
  
    def version_url(path, version)
 -    add_repo("#{@base_url}browser/#{urlEncode(path)}?rev=#{version}")
-+    add_repo("#{@base_url}/browser/#{urlEncode(path)}?rev=#{version}")
++    add_repo("#{base_url}/browser/#{urlEncode(path)}?rev=#{version}")
    end
  
    def diff_url(file)
 -    add_repo("#{@base_url}changeset/#{file.toVer}")
-+    add_repo("#{@base_url}/changeset/#{file.toVer}")
++    add_repo("#{base_url}/changeset/#{file.toVer}")
    end
  
    protected
-@@ -949,7 +953,7 @@
+@@ -949,7 +976,7 @@
      else
        log_anchor = ""
      end
 -    add_repo("#{@base_url}log/#{urlEncode(file.path)}#{log_anchor}")
-+    add_repo("#{@base_url}/log/#{urlEncode(file.path)}#{log_anchor}")
++    add_repo("#{base_url}/log/#{urlEncode(file.path)}#{log_anchor}")
    end
  end
  
-@@ -1772,6 +1784,24 @@
-   fail "No email recipients defined"
- end
-+if $viewcvsURL != nil || $cvswebURL !=nil
-+  if $repository_name == GUESS
-+    # use the last component of the repository path as the name
-+    ENV['CVSROOT'] =~ /([^\/]+$)/
-+      $repository_name = $1
-+  end
-+end
-+
-+# if $tracProjects is set process repository_name to setup new $tracURL
-+if $tracProjects != nil && $tracURL != nil
-+      $tracProjects.sort {|a,b| b[1] <=> a[1] }.each do |project, path|
-+              if $repository_name.index(path) == 0
-+                      $tracURL = "#{$tracURL}/#{project}"
-+                      break
-+              end
-+      end
-+end
-+
- if $viewcvsURL != nil
-   $viewcvsURL << "/" unless $viewcvsURL =~ /\/$/
-   $frontend = ViewCVSFrontend.new($viewcvsURL)
-@@ -1781,23 +1811,15 @@
-   $cvswebURL << "/" unless $cvswebURL =~ /\/$/
-   $frontend = CVSwebFrontend.new($cvswebURL)
- elsif $tracURL !=nil
--  $tracURL << "/" unless $tracURL =~ /\/$/
-   $frontend = TracFrontend.new($tracURL)
- else
-   $frontend = NoFrontend.new
- end
--if $viewcvsURL != nil || $cvswebURL !=nil
--  if $repository_name == GUESS
--    # use the last component of the repository path as the name
--    ENV['CVSROOT'] =~ /([^\/]+$)/
--    $frontend.repository_name = $1
--  elsif $repository_name != nil
--    $frontend.repository_name = $repository_name
--  end
-+if $repository_name != nil
-+      $frontend.repository_name = $repository_name
- end
--
- if $bugzillaURL != nil
-   commentSubstitutions['\b[Bb](?:[Uu][Gg])?\s*[#:]?\s*\[?[0-9]+\]?'] = bugzillaSub
- end
-@@ -1810,7 +1832,9 @@
+@@ -1693,6 +1720,7 @@
+ $ticketURL = nil
+ $issueURL = nil
+ $viewcvsURL = nil
++$tracProjects = nil
+ $xplannerIterationURL = nil
+ $xplannerProjectURL = nil
+ $xplannerStoryURL = nil
+@@ -1818,7 +1847,9 @@
  if $jiraURL != nil
    commentSubstitutions['\b[a-zA-Z]+-[0-9]+\b'] = jiraSub
  end
This page took 0.062092 seconds and 4 git commands to generate.