vclog 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/HISTORY.rdoc +16 -0
  2. data/PROFILE +5 -5
  3. data/README.rdoc +11 -1
  4. data/REQUIRE +1 -0
  5. data/ROADMAP.rdoc +6 -2
  6. data/VERSION +1 -1
  7. data/features/git.feature +86 -0
  8. data/features/hg.feature +86 -0
  9. data/features/step_definitions/repo_steps.rb +71 -0
  10. data/features/support/aruba.rb +1 -0
  11. data/features/support/repo.rb +15 -0
  12. data/features/svn.feature +86 -0
  13. data/lib/plugins/syckle/vclog.rb +54 -55
  14. data/lib/vclog/{vcs.rb → adapters/abstract.rb} +39 -21
  15. data/lib/vclog/adapters/darcs.rb +83 -0
  16. data/lib/vclog/adapters/git.rb +83 -0
  17. data/lib/vclog/adapters/hg.rb +82 -0
  18. data/lib/vclog/adapters/svn.rb +139 -0
  19. data/lib/vclog/adapters.rb +29 -0
  20. data/lib/vclog/change.rb +38 -13
  21. data/lib/vclog/changelog.rb +23 -3
  22. data/lib/vclog/cli.rb +43 -50
  23. data/lib/vclog/formatter.rb +105 -0
  24. data/lib/vclog/history.rb +33 -17
  25. data/lib/vclog/metadata.rb +13 -0
  26. data/lib/vclog/release.rb +14 -3
  27. data/lib/vclog/tag.rb +17 -9
  28. data/lib/vclog/templates/changelog.atom +26 -0
  29. data/lib/vclog/templates/changelog.gnu +2 -2
  30. data/lib/vclog/templates/changelog.html +3 -3
  31. data/lib/vclog/templates/changelog.json +1 -0
  32. data/lib/vclog/templates/changelog.markdown +2 -2
  33. data/lib/vclog/templates/changelog.rdoc +2 -2
  34. data/lib/vclog/templates/changelog.xml +3 -3
  35. data/lib/vclog/templates/changelog.yaml +1 -0
  36. data/lib/vclog/templates/history.atom +46 -0
  37. data/lib/vclog/templates/history.gnu +12 -0
  38. data/lib/vclog/templates/history.html +5 -5
  39. data/lib/vclog/templates/history.json +1 -0
  40. data/lib/vclog/templates/history.markdown +4 -4
  41. data/lib/vclog/templates/history.rdoc +4 -4
  42. data/lib/vclog/templates/history.xml +5 -4
  43. data/lib/vclog/templates/history.yaml +1 -0
  44. data/lib/vclog.rb +1 -1
  45. metadata +27 -27
  46. data/features/history.feature +0 -16
  47. data/lib/vclog/vcs/darcs.rb +0 -83
  48. data/lib/vclog/vcs/git.rb +0 -83
  49. data/lib/vclog/vcs/hg.rb +0 -0
  50. data/lib/vclog/vcs/svn.rb +0 -116
  51. data/meta/authors +0 -1
  52. data/meta/contact +0 -1
  53. data/meta/created +0 -1
  54. data/meta/description +0 -1
  55. data/meta/homepage +0 -1
  56. data/meta/license +0 -1
  57. data/meta/name +0 -1
  58. data/meta/repository +0 -1
  59. data/meta/requires +0 -1
  60. data/meta/ruby +0 -2
  61. data/meta/sitemap +0 -1
  62. data/meta/suite +0 -1
  63. data/meta/summary +0 -1
  64. data/meta/title +0 -1
  65. data/meta/version +0 -1
data/HISTORY.rdoc CHANGED
@@ -1,5 +1,21 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 1.5.0 / 2010-05-29
4
+
5
+ This release adds support for Mercurial repositories and Atom newsfeed output format. The commandline inteface has change such that <code>--foramt</code>/<code>-f</code> is used to select the format instead of using the previous per-format options, e.g. use <code>-f xml</code> instead of <code>--xml</code>. This release also includes some subtantial changes under-the-hood --the first of a two part code refactoring process.
6
+
7
+ Changes:
8
+
9
+ * 2 Major Enhancements
10
+
11
+ * Add Mercurial support
12
+ * Add Atom feed format
13
+
14
+ * 1 Minor Enhancement
15
+
16
+ * Select format using -f option.
17
+
18
+
3
19
  == 1.4.0 / 2010-05-26
4
20
 
5
21
  This release includes some basic improvments and a few bug fixes. The primary change you might encounter is the need to use -e or --extra in order to see the detailed Changes list in the Release History. Also changed 'git-log' to 'git log', as it seems the latest versions of git does not support the many executables any longer. SVN support requires xmlsimple library. Note also that SVN support is lack luster at this time becuase it hits the server every time an 'svn log' command is issued which is done once for each tag when a history is generated (any one know a better way?).
data/PROFILE CHANGED
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  title : VCLog
3
+ suite : proutils
3
4
  summary : Cross-VCS/SCM ChangeLog Generator
4
5
  copyright: Copyright (c) 2009 Thomas Sawyer
5
- license : GPL3
6
- suite : proutils
7
- authors : Thomas Sawyer
6
+ license : MIT
7
+ contact : trans <transfire@gmail.com>
8
8
  created : 2006-05-09
9
- contact : http://googlegroups.com/group/proutils
9
+ authors : Thomas Sawyer
10
10
 
11
11
  description:
12
12
  VCLog is a cross-VCS/SCM ChangeLog generator.
13
13
 
14
14
  resources:
15
- homepage: http://proutils.rubyforge.org/vclog
15
+ homepage: http://proutils.github.com/vclog
16
16
  repository: git://github.com/proutils/vclog.git
17
17
 
data/README.rdoc CHANGED
@@ -19,11 +19,21 @@ repository's root directory try:
19
19
 
20
20
  To generate an XML formatted changelog use:
21
21
 
22
- $ vclog --xml
22
+ $ vclog -f xml
23
23
 
24
24
  See 'vclog --help' for more options.
25
25
 
26
26
 
27
+ == NOTE ABOUT SUBVSERION
28
+
29
+ Because Subversion is a centralized version control system, it contacts
30
+ the server every time 'svn log' is run. For this reason, having vclog
31
+ generate a release history is likely to fail since it must run 'svn log'
32
+ for each tag. Any repository with more than a few tags may be denied
33
+ access by the server for making too many rapid requests. I have no
34
+ idea how to remedy this issue. If you have any ideas please let me know.
35
+
36
+
27
37
  == RELEASE NOTES
28
38
 
29
39
  Please see HISTORY file.
data/REQUIRE CHANGED
@@ -6,4 +6,5 @@ development:
6
6
 
7
7
  development/test:
8
8
  - cucumber
9
+ - aruba
9
10
 
data/ROADMAP.rdoc CHANGED
@@ -1,6 +1,10 @@
1
- = TODO
1
+ = ROADMAP
2
2
 
3
- == Automagical Version
3
+ == Subversion History Support
4
+
5
+ Generating a Relase History for a svn repo is painfully slow and will likely fail due to hitting the server too many times in rapid succession. Is there another way?
6
+
7
+ == Automagical Version Numbers
4
8
 
5
9
  Would be cool if it could also generate an automagical version number.
6
10
 
data/VERSION CHANGED
@@ -1,5 +1,5 @@
1
1
  name : vclog
2
2
  major: 1
3
- minor: 4
3
+ minor: 5
4
4
  patch: 0
5
5
  date : 2010-05-26
@@ -0,0 +1,86 @@
1
+ Feature: Git Support
2
+ As a Git user
3
+ I want to generate a nicely formatted Changelog
4
+ And I want to generate a nicely formatted Release History
5
+
6
+ Scenario: Git Changelog
7
+ Given a suitable Git repository
8
+ When I run "vclog"
9
+ Then the exit status should be 0
10
+
11
+ Scenario: Git Changelog in RDoc
12
+ Given a suitable Git repository
13
+ When I run "vclog -f rdoc"
14
+ Then the exit status should be 0
15
+
16
+ Scenario: Git Changelog in Markdown
17
+ Given a suitable Git repository
18
+ When I run "vclog -f markdown"
19
+ Then the exit status should be 0
20
+
21
+ Scenario: Git Changelog in HTML
22
+ Given a suitable Git repository
23
+ When I run "vclog -f html"
24
+ Then the exit status should be 0
25
+
26
+ Scenario: Git Changelog in XML
27
+ Given a suitable Git repository
28
+ When I run "vclog -f xml"
29
+ Then the exit status should be 0
30
+
31
+ Scenario: Git Changelog in Atom
32
+ Given a suitable Git repository
33
+ When I run "vclog -f atom"
34
+ Then the exit status should be 0
35
+
36
+ Scenario: Git Changelog in YAML
37
+ Given a suitable Git repository
38
+ When I run "vclog -f yaml"
39
+ Then the exit status should be 0
40
+
41
+ Scenario: Git Changelog in JSON
42
+ Given a suitable Git repository
43
+ When I run "vclog -f json"
44
+ Then the exit status should be 0
45
+
46
+
47
+ Scenario: Git Release History
48
+ Given a suitable Git repository
49
+ When I run "vclog -r"
50
+ Then the exit status should be 0
51
+
52
+ Scenario: Git Release History in RDoc
53
+ Given a suitable Git repository
54
+ When I run "vclog -r -f rdoc"
55
+ Then the exit status should be 0
56
+
57
+ Scenario: Git Release History in Markdown
58
+ Given a suitable Git repository
59
+ When I run "vclog -r -f markdown"
60
+ Then the exit status should be 0
61
+
62
+ Scenario: Git Release History in HTML
63
+ Given a suitable Git repository
64
+ When I run "vclog -r -f html"
65
+ Then the exit status should be 0
66
+
67
+ Scenario: Git Release History in XML
68
+ Given a suitable Git repository
69
+ When I run "vclog -r -f xml"
70
+ Then the exit status should be 0
71
+
72
+ Scenario: Git Release History in Atom
73
+ Given a suitable Git repository
74
+ When I run "vclog -r -f atom"
75
+ Then the exit status should be 0
76
+
77
+ Scenario: Git Release History in YAML
78
+ Given a suitable Git repository
79
+ When I run "vclog -r -f yaml"
80
+ Then the exit status should be 0
81
+
82
+ Scenario: Git Release History in JSON
83
+ Given a suitable Git repository
84
+ When I run "vclog -r -f json"
85
+ Then the exit status should be 0
86
+
@@ -0,0 +1,86 @@
1
+ Feature: Mercurial Support
2
+ As a Mercurial user
3
+ I want to generate a nicely formatted Changelog
4
+ And I want to generate a nicely formatted Release History
5
+
6
+ Scenario: Mercurial Changelog
7
+ Given a suitable Mercurial repository
8
+ When I run "vclog"
9
+ Then the exit status should be 0
10
+
11
+ Scenario: Mercurial Changelog in RDoc
12
+ Given a suitable Mercurial repository
13
+ When I run "vclog -f rdoc"
14
+ Then the exit status should be 0
15
+
16
+ Scenario: Mercurial Changelog in Markdown
17
+ Given a suitable Mercurial repository
18
+ When I run "vclog -f markdown"
19
+ Then the exit status should be 0
20
+
21
+ Scenario: Mercurial Changelog in HTML
22
+ Given a suitable Mercurial repository
23
+ When I run "vclog -f html"
24
+ Then the exit status should be 0
25
+
26
+ Scenario: Mercurial Changelog in XML
27
+ Given a suitable Mercurial repository
28
+ When I run "vclog -f xml"
29
+ Then the exit status should be 0
30
+
31
+ Scenario: Mercurial Changelog in Atom
32
+ Given a suitable Mercurial repository
33
+ When I run "vclog -f atom"
34
+ Then the exit status should be 0
35
+
36
+ Scenario: Mercurial Changelog in YAML
37
+ Given a suitable Mercurial repository
38
+ When I run "vclog -f yaml"
39
+ Then the exit status should be 0
40
+
41
+ Scenario: Mercurial Changelog in JSON
42
+ Given a suitable Mercurial repository
43
+ When I run "vclog -f json"
44
+ Then the exit status should be 0
45
+
46
+
47
+ Scenario: Mercurial Release History
48
+ Given a suitable Mercurial repository
49
+ When I run "vclog -r"
50
+ Then the exit status should be 0
51
+
52
+ Scenario: Mercurial Release History in RDoc
53
+ Given a suitable Mercurial repository
54
+ When I run "vclog -r -f rdoc"
55
+ Then the exit status should be 0
56
+
57
+ Scenario: Mercurial Release History in Markdown
58
+ Given a suitable Mercurial repository
59
+ When I run "vclog -r -f markdown"
60
+ Then the exit status should be 0
61
+
62
+ Scenario: Mercurial Release History in HTML
63
+ Given a suitable Mercurial repository
64
+ When I run "vclog -r -f html"
65
+ Then the exit status should be 0
66
+
67
+ Scenario: Mercurial Release History in XML
68
+ Given a suitable Mercurial repository
69
+ When I run "vclog -r -f xml"
70
+ Then the exit status should be 0
71
+
72
+ Scenario: Mercurial Release History in Atom
73
+ Given a suitable Mercurial repository
74
+ When I run "vclog -r -f atom"
75
+ Then the exit status should be 0
76
+
77
+ Scenario: Mercurial Release History in YAML
78
+ Given a suitable Mercurial repository
79
+ When I run "vclog -r -f yaml"
80
+ Then the exit status should be 0
81
+
82
+ Scenario: Mercurial Release History in JSON
83
+ Given a suitable Mercurial repository
84
+ When I run "vclog -r -f json"
85
+ Then the exit status should be 0
86
+
@@ -0,0 +1,71 @@
1
+ Given /a suitable Subversion repository/ do
2
+ url = "svn://rubyforge.org/var/svn/rubygems"
3
+ name = "rubygems"
4
+ type = "svn"
5
+ marker = ".svn"
6
+ clone = "svn checkout #{url} #{name}"
7
+
8
+ setup_repo(name, type, marker, clone)
9
+
10
+ #dir = File.expand_path("tmp/hold/#{type}")
11
+ #unless File.exist?("#{dir}/#{name}/.svn")
12
+ # `mkdir -p #{dir}; cd #{dir}; svn checkout #{url} #{name}`
13
+ #end
14
+ #create_dir(type)
15
+ #cd(type)
16
+ #run "cp -r #{dir} #{name}"
17
+ #cd(name)
18
+ end
19
+
20
+ Given /a suitable Git repository/ do
21
+ url = "git://github.com/proutils/vclog.git"
22
+ name = "vclog"
23
+ type = "git"
24
+ marker = ".git"
25
+ clone = "git clone #{url} #{name}"
26
+
27
+ setup_repo(name, type, marker, clone)
28
+
29
+ #create_dir('git')
30
+ #cd('git')
31
+ #unless File.exist?("#{name}/.git")
32
+ # cmd = "git clone #{url} #{name}"
33
+ # run cmd
34
+ #end
35
+ #cd(name)
36
+ end
37
+
38
+ Given /a suitable Mercurial repository/ do
39
+ url = "http://bitbucket.org/birkenfeld/sphinx"
40
+ name = "sphinx"
41
+ type = "hg"
42
+ marker = ".hg"
43
+ clone = "hg clone #{url} #{name}"
44
+
45
+ setup_repo(name, type, marker, clone)
46
+
47
+ #create_dir('hg')
48
+ #cd('hg')
49
+ #unless File.exist?("#{name}/.hg")
50
+ # cmd = "hg clone #{url} #{name}"
51
+ # run cmd
52
+ #end
53
+ #cd(name)
54
+ end
55
+
56
+ Given /a suitable Darcs repository/ do
57
+ url =
58
+ name =
59
+ type = "darcs"
60
+ marker = "_darcs"
61
+ clone = ""
62
+
63
+ #create_dir('darcs')
64
+ #cd('darcs')
65
+ #unless File.exist?("#{name}/_darcs")
66
+ # cmd = "darcs clone "
67
+ # #run cmd
68
+ #end
69
+ #cd(name)
70
+ end
71
+
@@ -0,0 +1 @@
1
+ require 'aruba'
@@ -0,0 +1,15 @@
1
+ #
2
+ def setup_repo(name, type, marker, clone_command)
3
+ dir = File.expand_path("tmp/hold/#{type}")
4
+
5
+ unless File.exist?("#{dir}/#{name}/#{marker}")
6
+ $stderr.puts(" #{clone_command}")
7
+ `mkdir -p #{dir}` unless File.directory?(dir)
8
+ `cd #{dir}; #{clone_command}`
9
+ end
10
+
11
+ run "cp -r #{dir} #{type}"
12
+ cd(type)
13
+ cd(name)
14
+ end
15
+
@@ -0,0 +1,86 @@
1
+ Feature: Subversion Support
2
+ As a Subversion user
3
+ I want to generate a nicely formatted Changelog
4
+ And I want to generate a nicely formatted Release History
5
+
6
+ Scenario: Subversion Changelog
7
+ Given a suitable Subversion repository
8
+ When I run "vclog"
9
+ Then the exit status should be 0
10
+
11
+ Scenario: Subversion Changelog in RDoc
12
+ Given a suitable Subversion repository
13
+ When I run "vclog -f rdoc"
14
+ Then the exit status should be 0
15
+
16
+ Scenario: Subversion Changelog in Markdown
17
+ Given a suitable Subversion repository
18
+ When I run "vclog -f markdown"
19
+ Then the exit status should be 0
20
+
21
+ Scenario: Subversion Changelog in HTML
22
+ Given a suitable Subversion repository
23
+ When I run "vclog -f html"
24
+ Then the exit status should be 0
25
+
26
+ Scenario: Subversion Changelog in XML
27
+ Given a suitable Subversion repository
28
+ When I run "vclog -f xml"
29
+ Then the exit status should be 0
30
+
31
+ Scenario: Subversion Changelog in Atom
32
+ Given a suitable Subversion repository
33
+ When I run "vclog -f atom"
34
+ Then the exit status should be 0
35
+
36
+ Scenario: Subversion Changelog in YAML
37
+ Given a suitable Subversion repository
38
+ When I run "vclog -f yaml"
39
+ Then the exit status should be 0
40
+
41
+ Scenario: Subversion Changelog in JSON
42
+ Given a suitable Subversion repository
43
+ When I run "vclog -f json"
44
+ Then the exit status should be 0
45
+
46
+
47
+ Scenario: Subversion Release History
48
+ Given a suitable Subversion repository
49
+ When I run "vclog -r"
50
+ Then the exit status should be 0
51
+
52
+ Scenario: Subversion Release History in RDoc
53
+ Given a suitable Subversion repository
54
+ When I run "vclog -r -f rdoc"
55
+ Then the exit status should be 0
56
+
57
+ Scenario: Subversion Release History in Markdown
58
+ Given a suitable Subversion repository
59
+ When I run "vclog -r -f markdown"
60
+ Then the exit status should be 0
61
+
62
+ Scenario: Subversion Release History in HTML
63
+ Given a suitable Subversion repository
64
+ When I run "vclog -r -f html"
65
+ Then the exit status should be 0
66
+
67
+ Scenario: Subversion Release History in XML
68
+ Given a suitable Subversion repository
69
+ When I run "vclog -r -f xml"
70
+ Then the exit status should be 0
71
+
72
+ Scenario: Subversion Release History in Atom
73
+ Given a suitable Subversion repository
74
+ When I run "vclog -r -f atom"
75
+ Then the exit status should be 0
76
+
77
+ Scenario: Subversion Release History in YAML
78
+ Given a suitable Subversion repository
79
+ When I run "vclog -r -f yaml"
80
+ Then the exit status should be 0
81
+
82
+ Scenario: Subversion Release History in JSON
83
+ Given a suitable Subversion repository
84
+ When I run "vclog -r -f json"
85
+ Then the exit status should be 0
86
+
@@ -3,6 +3,7 @@ module Syckle::Plugins
3
3
  # VClog service generates changelogs from
4
4
  # SCM commit messages.
5
5
  #
6
+ # TODO: Support multiple formats in one pass.
6
7
  class VClog < Service
7
8
 
8
9
  cycle :main, :document
@@ -21,7 +22,7 @@ module Syckle::Plugins
21
22
 
22
23
  # Changelog format. Default is +html+.
23
24
  # Supports +html+, +xml+, +json+, +yaml+, +rdoc+, +markdown+, and +gnu+.
24
- attr_accessor :format
25
+ attr_accessor :formats
25
26
 
26
27
  # Changelog layout type (+log+ or +rel+). Default is +log+.
27
28
  attr_accessor :type
@@ -41,25 +42,27 @@ module Syckle::Plugins
41
42
 
42
43
  #
43
44
  def initialize_defaults
44
- require 'vclog/vcs'
45
+ require 'vclog'
45
46
  @version = metadata.version
46
47
  @title = metadata.title
47
- @format = 'html'
48
+ @formats = ['atom']
48
49
  @type = 'log'
49
50
  end
50
51
 
51
52
  #
52
53
  def valid?
53
- return false unless format =~ /^(html|yaml|json|xml|rdoc|markdown|gnu|txt)$/
54
+ return false unless format =~ /^(html|yaml|json|xml|rdoc|markdown|gnu|txt|atom)$/
54
55
  return false unless type =~ /^(log|rel|history|changelog)$/
55
56
  return true
56
57
  end
57
58
 
58
59
  #
59
- def format=(f)
60
- @format = f.to_s.downcase
60
+ def formats=(f)
61
+ @formats = f.to_list
61
62
  end
62
63
 
64
+ alias_method :format=, :formats=
65
+
63
66
  #
64
67
  def type=(f)
65
68
  @type = f.to_s.downcase
@@ -75,28 +78,30 @@ module Syckle::Plugins
75
78
  #--
76
79
 
77
80
  def document_changelog
78
- case type
79
- when 'rel', 'history'
80
- file = output || (project.log + "vclog/history.#{format}").to_s
81
- else
82
- file = output || (project.log + "vclog/changelog.#{format}").to_s
83
- end
84
- #apply_naming_policy('changelog', log_format.downcase)
85
- if dryrun?
86
- report "# vclog --#{type} --#{format} -o #{file}"
87
- else
88
- changed = save(file)
89
- if changed
90
- report "Updated #{relative_from_root(file)}"
81
+ formats.each do |format|
82
+ case type
83
+ when 'rel', 'history'
84
+ file = output || (project.log + "vclog/history.#{format}").to_s
91
85
  else
92
- report "#{relative_from_root(file)} is current"
86
+ file = output || (project.log + "vclog/changelog.#{format}").to_s
87
+ end
88
+ #apply_naming_policy('changelog', log_format.downcase)
89
+ if dryrun?
90
+ report "# vclog --#{type} -f #{format} -o #{file}"
91
+ else
92
+ changed = save(format, file)
93
+ if changed
94
+ report "Updated #{relative_from_root(file)}"
95
+ else
96
+ report "Current #{relative_from_root(file)}"
97
+ end
93
98
  end
94
99
  end
95
100
  end
96
101
 
97
102
  # Save changelog/history to +output+ file.
98
- def save(output)
99
- text = render
103
+ def save(format, output)
104
+ text = render(format)
100
105
  if File.exist?(output)
101
106
  if File.read(output) != text
102
107
  File.open(output, 'w'){ |f| f << text }
@@ -111,45 +116,39 @@ module Syckle::Plugins
111
116
  end
112
117
  end
113
118
 
114
- # Returns changelog or history depending on type selection.
115
- def log
116
- @log ||= (
117
- case type
118
- when 'log', 'changelog'
119
- log = vcs.changelog
120
- when 'rel', 'history'
121
- log = vcs.history(:title=>title, :version=>version)
122
- else
123
- log = vcs.changelog
124
- end
125
- )
126
- end
119
+ ## Returns changelog or history depending on type selection.
120
+ #def log
121
+ # @log ||= (
122
+ # case type
123
+ # when 'log', 'changelog'
124
+ # log = vcs.changelog
125
+ # when 'rel', 'history'
126
+ # log = vcs.history(:title=>title, :version=>version)
127
+ # else
128
+ # log = vcs.changelog
129
+ # end
130
+ # )
131
+ #end
127
132
 
128
133
  # Access to version control system.
129
134
  def vcs
130
135
  #@vcs ||= VCLog::VCS.new #(self)
131
- @vcs ||= VCLog::VCS.factory #(root)
136
+ @vcs ||= VCLog::Adapters.factory #(root)
132
137
  end
133
138
 
134
- # Convert log to desiered format.
135
- def render
136
- case format
137
- when 'xml'
138
- txt = log.to_xml(style) # xsl stylesheet url
139
- when 'html'
140
- txt = log.to_html(style) # css stylesheet url
141
- when 'yaml'
142
- txt = log.to_yaml
143
- when 'json'
144
- txt = log.to_json
145
- when 'markdown'
146
- txt = log.to_markdown(rev)
147
- when 'rdoc'
148
- txt = log.to_rdoc(rev)
149
- else #:gnu
150
- txt = log.to_gnu(rev)
151
- end
152
- txt
139
+ # Convert log to desired format.
140
+ def render(format)
141
+ doctype = type
142
+ doctype = 'history' if doctype == 'rel'
143
+ doctype = 'changelog' if doctype == 'log'
144
+
145
+ options = {
146
+ :stylesheet => style,
147
+ :revision => rev,
148
+ :version => version,
149
+ :title => title
150
+ }
151
+ vcs.display(doctype, format, options)
153
152
  end
154
153
 
155
154