Method: Cigale::SCM#translate_svn_scm

Defined in:
lib/cigale/scm/svn.rb

#translate_svn_scm(xml, sdef) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/cigale/scm/svn.rb', line 3

def translate_svn_scm (xml, sdef)
  if vu = sdef["viewvc-url"]
    xml.browser :class => "hudson.scm.browsers.ViewSVN" do
      xml.url vu
    end
  end

  xml.locations do
    if repos = sdef["repos"]
      for r in repos
        xml.tag! "hudson.scm.SubversionSCM_-ModuleLocation" do
          xml.remote r["url"]
          xml.local r["basedir"] || "."
          if cri = r["credentials-id"]
            xml.credentialsId cri
          end
          xml.depthOption r["repo-depth"] || "infinity"
          xml.ignoreExternalsOption r["ignore-externals"] || false
        end
      end
    else
      xml.tag! "hudson.scm.SubversionSCM_-ModuleLocation" do
        xml.remote sdef["url"]
        xml.local "."
        if cri = sdef["credentials-id"]
          xml.credentialsId cri
        end
        xml.depthOption sdef["repo-depth"] || "infinity"
        xml.ignoreExternalsOption sdef["ignore-externals"] || false
      end
    end
  end # locations

  if upd = sdef["workspaceupdater"]
    uclass = svn_workspace_updaters[upd] or raise "Unknown svn repo updater: #{upd}"
    xml.workspaceUpdater :class => uclass
  end

  if exclRegions = sdef["excluded-regions"]
    xml.excludedRegions exclRegions.join("\n")
  end

  if inclRegions = sdef["included-regions"]
    xml.includedRegions inclRegions.join("\n")
  end

  if exclUsers = sdef["excluded-users"]
    xml.excludedUsers exclUsers.join("\n")
  end

  if exclProp = sdef["exclusion-revprop-name"]
    xml.excludedRevprop exclProp
  end

  if exclCommits = sdef["excluded-commit-messages"]
    xml.excludedCommitMessages exclCommits.join("\n")
  end

  xml.ignoreDirPropChanges sdef["ignore-property-changes-on-directories"] || false
  xml.filterChangelog sdef["filter-changelog"] || false
end