vclog 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/HISTORY.rdoc +12 -0
  2. data/README.rdoc +5 -5
  3. data/REQUIRE +1 -0
  4. data/VERSION +2 -2
  5. data/bin/vclog +1 -1
  6. data/features/git.feature +8 -8
  7. data/features/hg.feature +8 -8
  8. data/features/svn.feature +8 -8
  9. data/lib/plugins/syckle/vclog.rb +19 -9
  10. data/lib/vclog/adapters/abstract.rb +78 -9
  11. data/lib/vclog/adapters/darcs.rb +5 -5
  12. data/lib/vclog/adapters.rb +3 -4
  13. data/lib/vclog/change.rb +14 -28
  14. data/lib/vclog/changelog.rb +8 -12
  15. data/lib/vclog/cli/abstract.rb +99 -0
  16. data/lib/vclog/cli/bump.rb +30 -0
  17. data/lib/vclog/cli/changelog.rb +33 -0
  18. data/lib/vclog/cli/help.rb +37 -0
  19. data/lib/vclog/cli/history.rb +40 -0
  20. data/lib/vclog/cli/list.rb +28 -0
  21. data/lib/vclog/cli/version.rb +30 -0
  22. data/lib/vclog/cli.rb +70 -51
  23. data/lib/vclog/config.rb +65 -0
  24. data/lib/vclog/formatter.rb +27 -10
  25. data/lib/vclog/heuristics/default.rb +20 -0
  26. data/lib/vclog/heuristics.rb +86 -8
  27. data/lib/vclog/history.rb +26 -191
  28. data/lib/vclog/kernel.rb +12 -0
  29. data/lib/vclog/metadata.rb +1 -0
  30. data/lib/vclog/release.rb +25 -10
  31. data/lib/vclog/tag.rb +14 -4
  32. data/lib/vclog/templates/changelog.ansi.rb +52 -0
  33. data/lib/vclog/templates/{changelog.atom → changelog.atom.erb} +0 -0
  34. data/lib/vclog/templates/changelog.gnu.rb +31 -0
  35. data/lib/vclog/templates/{changelog.html → changelog.html.erb} +0 -0
  36. data/lib/vclog/templates/changelog.json.rb +1 -0
  37. data/lib/vclog/templates/changelog.markdown.rb +30 -0
  38. data/lib/vclog/templates/changelog.rdoc.rb +30 -0
  39. data/lib/vclog/templates/{changelog.xml → changelog.xml.erb} +0 -0
  40. data/lib/vclog/templates/changelog.yaml.rb +1 -0
  41. data/lib/vclog/templates/history.ansi.rb +59 -0
  42. data/lib/vclog/templates/{history.atom → history.atom.erb} +1 -1
  43. data/lib/vclog/templates/history.gnu.rb +41 -0
  44. data/lib/vclog/templates/history.html.erb +52 -0
  45. data/lib/vclog/templates/history.json.rb +1 -0
  46. data/lib/vclog/templates/history.markdown.rb +40 -0
  47. data/lib/vclog/templates/history.rdoc.rb +40 -0
  48. data/lib/vclog/templates/{history.xml → history.xml.erb} +1 -1
  49. data/lib/vclog/templates/history.yaml.rb +1 -0
  50. data/lib/vclog.rb +6 -1
  51. metadata +95 -21
  52. data/ROADMAP.rdoc +0 -31
  53. data/lib/vclog/templates/changelog.gnu +0 -6
  54. data/lib/vclog/templates/changelog.json +0 -1
  55. data/lib/vclog/templates/changelog.markdown +0 -6
  56. data/lib/vclog/templates/changelog.rdoc +0 -6
  57. data/lib/vclog/templates/changelog.yaml +0 -1
  58. data/lib/vclog/templates/history.gnu +0 -12
  59. data/lib/vclog/templates/history.html +0 -47
  60. data/lib/vclog/templates/history.json +0 -1
  61. data/lib/vclog/templates/history.markdown +0 -12
  62. data/lib/vclog/templates/history.rdoc +0 -12
  63. data/lib/vclog/templates/history.yaml +0 -1
data/HISTORY.rdoc CHANGED
@@ -1,5 +1,17 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 1.6.0 / 2010-06-22
4
+
5
+ Previous versions utilized a system of "commit tagging" to identify types of commits. This proved less than optimal --it was unconventional, but worse it was easy to forget to put the proper label in the message. The new version of VClog uses a customizable heuristics systems instead. Rather than be limited to a strict syntax structure, you can write matching rules in .config/vclog/rules.rb that determine the commit type, and set descriptive labels for each type. This makes it very easy to get excellent History output. Also in this release the command-line interface has changed to use subcommands. And the default output format is now an ANSI-color GNU-like format. Use `-f gnu` to get the old default format.
6
+
7
+ Changes:
8
+
9
+ * 2 Major Enhancements
10
+
11
+ * Heuristics system for categorizing commits
12
+ * Command-line interface uses subcommands
13
+
14
+
3
15
  == 1.5.0 / 2010-05-29
4
16
 
5
17
  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.
data/README.rdoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = VCLog
2
2
 
3
- * http://proutils.rubyforge.org
4
- * http://proutils.rubyforge.org/vclog
3
+ * home: http://proutils.github.com/vclog
4
+ * work: http://github.com/proutils/vclog
5
5
 
6
6
 
7
7
  == DESCRIPTION
@@ -12,8 +12,8 @@ It currently supports Git and Subversion.
12
12
 
13
13
  == SYNOPSIS
14
14
 
15
- By default the format is a standard GNU text style. From a
16
- repository's root directory try:
15
+ The default format is a ANSI colored GNU-like text style.
16
+ From a repository's root directory try:
17
17
 
18
18
  $ vclog
19
19
 
@@ -21,7 +21,7 @@ To generate an XML formatted changelog use:
21
21
 
22
22
  $ vclog -f xml
23
23
 
24
- See 'vclog --help' for more options.
24
+ See 'vclog help' for more options.
25
25
 
26
26
 
27
27
  == NOTE ABOUT SUBVSERION
data/REQUIRE CHANGED
@@ -1,5 +1,6 @@
1
1
  runtime:
2
2
  - facets >2.4
3
+ - ansi
3
4
 
4
5
  development:
5
6
  - syckle
data/VERSION CHANGED
@@ -1,5 +1,5 @@
1
1
  name : vclog
2
2
  major: 1
3
- minor: 5
3
+ minor: 6
4
4
  patch: 0
5
- date : 2010-05-26
5
+ date : 2010-06-22
data/bin/vclog CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'vclog/cli'
3
- VCLog.run
3
+ VCLog::CLI.main(*ARGV)
4
4
 
data/features/git.feature CHANGED
@@ -46,41 +46,41 @@ Feature: Git Support
46
46
 
47
47
  Scenario: Git Release History
48
48
  Given a suitable Git repository
49
- When I run "vclog -r"
49
+ When I run "vclog r"
50
50
  Then the exit status should be 0
51
51
 
52
52
  Scenario: Git Release History in RDoc
53
53
  Given a suitable Git repository
54
- When I run "vclog -r -f rdoc"
54
+ When I run "vclog r -f rdoc"
55
55
  Then the exit status should be 0
56
56
 
57
57
  Scenario: Git Release History in Markdown
58
58
  Given a suitable Git repository
59
- When I run "vclog -r -f markdown"
59
+ When I run "vclog rel -f markdown"
60
60
  Then the exit status should be 0
61
61
 
62
62
  Scenario: Git Release History in HTML
63
63
  Given a suitable Git repository
64
- When I run "vclog -r -f html"
64
+ When I run "vclog rel -f html"
65
65
  Then the exit status should be 0
66
66
 
67
67
  Scenario: Git Release History in XML
68
68
  Given a suitable Git repository
69
- When I run "vclog -r -f xml"
69
+ When I run "vclog rel -f xml"
70
70
  Then the exit status should be 0
71
71
 
72
72
  Scenario: Git Release History in Atom
73
73
  Given a suitable Git repository
74
- When I run "vclog -r -f atom"
74
+ When I run "vclog rel -f atom"
75
75
  Then the exit status should be 0
76
76
 
77
77
  Scenario: Git Release History in YAML
78
78
  Given a suitable Git repository
79
- When I run "vclog -r -f yaml"
79
+ When I run "vclog rel -f yaml"
80
80
  Then the exit status should be 0
81
81
 
82
82
  Scenario: Git Release History in JSON
83
83
  Given a suitable Git repository
84
- When I run "vclog -r -f json"
84
+ When I run "vclog rel -f json"
85
85
  Then the exit status should be 0
86
86
 
data/features/hg.feature CHANGED
@@ -46,41 +46,41 @@ Feature: Mercurial Support
46
46
 
47
47
  Scenario: Mercurial Release History
48
48
  Given a suitable Mercurial repository
49
- When I run "vclog -r"
49
+ When I run "vclog rel"
50
50
  Then the exit status should be 0
51
51
 
52
52
  Scenario: Mercurial Release History in RDoc
53
53
  Given a suitable Mercurial repository
54
- When I run "vclog -r -f rdoc"
54
+ When I run "vclog rel -f rdoc"
55
55
  Then the exit status should be 0
56
56
 
57
57
  Scenario: Mercurial Release History in Markdown
58
58
  Given a suitable Mercurial repository
59
- When I run "vclog -r -f markdown"
59
+ When I run "vclog rel -f markdown"
60
60
  Then the exit status should be 0
61
61
 
62
62
  Scenario: Mercurial Release History in HTML
63
63
  Given a suitable Mercurial repository
64
- When I run "vclog -r -f html"
64
+ When I run "vclog rel -f html"
65
65
  Then the exit status should be 0
66
66
 
67
67
  Scenario: Mercurial Release History in XML
68
68
  Given a suitable Mercurial repository
69
- When I run "vclog -r -f xml"
69
+ When I run "vclog rel -f xml"
70
70
  Then the exit status should be 0
71
71
 
72
72
  Scenario: Mercurial Release History in Atom
73
73
  Given a suitable Mercurial repository
74
- When I run "vclog -r -f atom"
74
+ When I run "vclog rel -f atom"
75
75
  Then the exit status should be 0
76
76
 
77
77
  Scenario: Mercurial Release History in YAML
78
78
  Given a suitable Mercurial repository
79
- When I run "vclog -r -f yaml"
79
+ When I run "vclog rel -f yaml"
80
80
  Then the exit status should be 0
81
81
 
82
82
  Scenario: Mercurial Release History in JSON
83
83
  Given a suitable Mercurial repository
84
- When I run "vclog -r -f json"
84
+ When I run "vclog rel -f json"
85
85
  Then the exit status should be 0
86
86
 
data/features/svn.feature CHANGED
@@ -46,41 +46,41 @@ Feature: Subversion Support
46
46
 
47
47
  Scenario: Subversion Release History
48
48
  Given a suitable Subversion repository
49
- When I run "vclog -r"
49
+ When I run "vclog rel"
50
50
  Then the exit status should be 0
51
51
 
52
52
  Scenario: Subversion Release History in RDoc
53
53
  Given a suitable Subversion repository
54
- When I run "vclog -r -f rdoc"
54
+ When I run "vclog rel -f rdoc"
55
55
  Then the exit status should be 0
56
56
 
57
57
  Scenario: Subversion Release History in Markdown
58
58
  Given a suitable Subversion repository
59
- When I run "vclog -r -f markdown"
59
+ When I run "vclog rel -f markdown"
60
60
  Then the exit status should be 0
61
61
 
62
62
  Scenario: Subversion Release History in HTML
63
63
  Given a suitable Subversion repository
64
- When I run "vclog -r -f html"
64
+ When I run "vclog rel -f html"
65
65
  Then the exit status should be 0
66
66
 
67
67
  Scenario: Subversion Release History in XML
68
68
  Given a suitable Subversion repository
69
- When I run "vclog -r -f xml"
69
+ When I run "vclog rel -f xml"
70
70
  Then the exit status should be 0
71
71
 
72
72
  Scenario: Subversion Release History in Atom
73
73
  Given a suitable Subversion repository
74
- When I run "vclog -r -f atom"
74
+ When I run "vclog rel -f atom"
75
75
  Then the exit status should be 0
76
76
 
77
77
  Scenario: Subversion Release History in YAML
78
78
  Given a suitable Subversion repository
79
- When I run "vclog -r -f yaml"
79
+ When I run "vclog rel -f yaml"
80
80
  Then the exit status should be 0
81
81
 
82
82
  Scenario: Subversion Release History in JSON
83
83
  Given a suitable Subversion repository
84
- When I run "vclog -r -f json"
84
+ When I run "vclog rel -f json"
85
85
  Then the exit status should be 0
86
86
 
@@ -40,18 +40,23 @@ module Syckle::Plugins
40
40
  # Some formats can reference an optional stylesheet (namely +xml+ and +html+).
41
41
  attr_accessor :style
42
42
 
43
+ # Minimu change level to include.
44
+ attr_accessor :level
45
+
43
46
  #
44
47
  def initialize_defaults
45
48
  require 'vclog'
49
+
46
50
  @version = metadata.version
47
51
  @title = metadata.title
48
52
  @formats = ['atom']
49
53
  @type = 'log'
54
+ @level = 0
50
55
  end
51
56
 
52
57
  #
53
58
  def valid?
54
- return false unless format =~ /^(html|yaml|json|xml|rdoc|markdown|gnu|txt|atom)$/
59
+ return false unless format =~ /^(html|yaml|json|xml|rdoc|markdown|gnu|txt|atom|ansi)$/
55
60
  return false unless type =~ /^(log|rel|history|changelog)$/
56
61
  return true
57
62
  end
@@ -68,16 +73,12 @@ module Syckle::Plugins
68
73
  @type = f.to_s.downcase
69
74
  end
70
75
 
71
- # Generate changelog.
72
- def document
73
- document_changelog
74
- end
75
-
76
76
  #++
77
77
  # TODO: apply_naming_policy ?
78
78
  #--
79
79
 
80
- def document_changelog
80
+ #
81
+ def document
81
82
  formats.each do |format|
82
83
  case type
83
84
  when 'rel', 'history'
@@ -87,7 +88,7 @@ module Syckle::Plugins
87
88
  end
88
89
  #apply_naming_policy('changelog', log_format.downcase)
89
90
  if dryrun?
90
- report "# vclog --#{type} -f #{format} -o #{file}"
91
+ report "# vclog --#{type} -f #{format} >> #{file}"
91
92
  else
92
93
  changed = save(format, file)
93
94
  if changed
@@ -130,10 +131,18 @@ module Syckle::Plugins
130
131
  # )
131
132
  #end
132
133
 
134
+ def vclog_config
135
+ @vclog_config ||= (
136
+ vcf = VCLog::Config.new(project.root.to_s)
137
+ vcf.level = level
138
+ vcf
139
+ )
140
+ end
141
+
133
142
  # Access to version control system.
134
143
  def vcs
135
144
  #@vcs ||= VCLog::VCS.new #(self)
136
- @vcs ||= VCLog::Adapters.factory #(root)
145
+ @vcs ||= VCLog::Adapters.factory(vclog_config)
137
146
  end
138
147
 
139
148
  # Convert log to desired format.
@@ -148,6 +157,7 @@ module Syckle::Plugins
148
157
  :version => version,
149
158
  :title => title
150
159
  }
160
+
151
161
  vcs.display(doctype, format, options)
152
162
  end
153
163
 
@@ -2,6 +2,8 @@ module VCLog
2
2
  module Adapters
3
3
 
4
4
  require 'time'
5
+ require 'pathname'
6
+
5
7
  require 'vclog/formatter'
6
8
  require 'vclog/changelog'
7
9
  require 'vclog/history'
@@ -14,19 +16,40 @@ module Adapters
14
16
  # = Version Control System
15
17
  class Abstract
16
18
 
19
+ # Root location.
17
20
  attr :root
18
21
 
22
+ # Heuristics object.
23
+ attr :heuristics
24
+
25
+ # Minimu change level.
26
+ attr :level
27
+
19
28
  #
20
- def initialize(root)
21
- @root = File.expand_path(root)
29
+ def initialize(config)
30
+ @root = config.root # File.expand_path(config.root)
31
+ @heuristics = config.heuristics
32
+ @level = config.level.to_i
22
33
  end
23
34
 
35
+ #
24
36
  def tags
25
37
  @tags ||= extract_tags.map{ |t| Tag===t ? t : Tag.new(*t) }
26
38
  end
27
39
 
40
+ #
28
41
  def changes
29
- @changes ||= extract_changes.map{ |c| Change===c ? c : Change.new(*c) }
42
+ @changes ||= (
43
+ changes = []
44
+ extract_changes.each do |c|
45
+ raise "how did this happen?" if Change == c
46
+ rev, date, who, msg = *c
47
+ type, level, label = *heuristics.lookup(msg)
48
+ next if level < self.level
49
+ changes << Change.new(rev, date, who, msg, type, level, label)
50
+ end
51
+ changes
52
+ )
30
53
  end
31
54
 
32
55
  #
@@ -45,26 +68,42 @@ module Adapters
45
68
  end
46
69
 
47
70
  #
48
- def history(opts={})
49
- @history ||= History.new(self, opts)
71
+ def history
72
+ @history ||= History.new(self)
50
73
  end
51
74
 
52
75
  #
53
- def display(type, format, options={})
76
+ def display(type, format, options)
77
+ @options = options
54
78
  formatter = Formatter.new(self)
55
79
  formatter.display(type, format, options)
56
80
  end
57
81
 
82
+ # TODO: allow config of these levels thresholds ?
83
+ def bump
84
+ max = history.releases[0].changes.map{ |c| c.level }.max
85
+ if max > 1
86
+ bump_part('major')
87
+ elsif max >= 0
88
+ bump_part('minor')
89
+ else
90
+ bump_part('patch')
91
+ end
92
+ end
93
+
58
94
  # Provides a bumped version number.
59
- def bump(part=nil)
60
- return part unless ['major', 'minor', 'patch', ''].include?(part.to_s)
95
+ def bump_part(part=nil)
96
+ raise "bad version part - #{part}" unless ['major', 'minor', 'patch', 'build', ''].include?(part.to_s)
61
97
 
62
98
  if tags.last
63
- v = tags.last.name # TODO: ensure the latest version
99
+ v = tags[-1].name # TODO: ensure the latest version
100
+ v = tags[-2].name if v == 'HEAD'
64
101
  else
65
102
  v = '0.0.0'
66
103
  end
104
+
67
105
  v = v.split(/\W/) # TODO: preserve split chars
106
+
68
107
  case part.to_s
69
108
  when 'major'
70
109
  v[0] = v[0].succ
@@ -88,6 +127,17 @@ module Adapters
88
127
  end
89
128
  end
90
129
 
130
+ # Returns the current verion string.
131
+ def version
132
+ if tags.last
133
+ v = tags[-1].name # TODO: ensure the latest version
134
+ v = tags[-2].name if v == 'HEAD'
135
+ else
136
+ v = '0.0.0'
137
+ end
138
+ return v
139
+ end
140
+
91
141
  private
92
142
 
93
143
  #
@@ -157,6 +207,25 @@ module Adapters
157
207
  end
158
208
  =end
159
209
 
210
+ # Find vclog config directory. This searches up from the current
211
+ # working directory for the following paths (in order):
212
+ #
213
+ # .vclog/
214
+ # .config/vclog/
215
+ # config/vclog/
216
+ #
217
+ def lookup_config
218
+ conf = nil
219
+ Dir.ascend(Dir.pwd) do |path|
220
+ check = Dir['{.vclog/,.config/vclog/,config/vclog/}/'].first
221
+ if check
222
+ conf = path
223
+ break
224
+ end
225
+ end
226
+ conf
227
+ end
228
+
160
229
  public
161
230
 
162
231
  #
@@ -11,20 +11,20 @@ module Adapters
11
11
  #
12
12
  class Darcs < Abstract
13
13
 
14
- ### Is a darcs repository?
14
+ # Is a darcs repository?
15
15
  def repository?
16
16
  File.directory?('_darcs')
17
17
  end
18
18
 
19
- ### This is also a module function.
19
+ # This is also a module function.
20
20
  module_function :repository?
21
21
 
22
- ### Cached Changelog.
22
+ # Cached Changelog.
23
23
  def changelog
24
24
  @changelog ||= generate_changelog
25
25
  end
26
26
 
27
- ### Generate Changelog object.
27
+ # Generate Changelog object.
28
28
  def generate_changelog
29
29
  raise "not a darcs repository" unless repository?
30
30
 
@@ -48,7 +48,7 @@ module Adapters
48
48
  return log
49
49
  end
50
50
 
51
- ### Retrieve the "revision number" from the darcs tree.
51
+ # Retrieve the "revision number" from the darcs tree.
52
52
  def calculate_version
53
53
  raise "not a darcs repository" unless repository?
54
54
 
@@ -8,11 +8,10 @@ module VCLog
8
8
  module Adapters
9
9
 
10
10
  #
11
- def self.factory(root=nil)
12
- root = root || Dir.pwd
13
- type = read_type(root)
11
+ def self.factory(config) #, options={})
12
+ type = read_type(config.root)
14
13
  raise ArgumentError, "Not a recognized version control system." unless type
15
- const_get(type.capitalize).new(root)
14
+ const_get(type.capitalize).new(config) #, options)
16
15
  end
17
16
 
18
17
  #
data/lib/vclog/change.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'vclog/kernel'
2
+
1
3
  module VCLog
2
4
 
3
5
  # = Change Log Entry class
@@ -10,15 +12,20 @@ module VCLog
10
12
  attr_accessor :date
11
13
  attr_accessor :revision
12
14
  attr_accessor :message
15
+
13
16
  attr_accessor :type
17
+ attr_accessor :level
18
+ attr_accessor :label
14
19
 
15
20
  #
16
- def initialize(rev, date, author, message)
21
+ def initialize(rev, date, author, message, type, level, label)
17
22
  self.revision = rev
18
23
  self.date = date
19
24
  self.author = author
20
- self.type = type
21
25
  self.message = message
26
+ self.type = type
27
+ self.level = level
28
+ self.label = label
22
29
  end
23
30
 
24
31
  #
@@ -26,11 +33,6 @@ module VCLog
26
33
  @author = author.strip
27
34
  end
28
35
 
29
- #
30
- def message=(note)
31
- @message, @type = split_type(note)
32
- end
33
-
34
36
  #def clean_type(type)
35
37
  # case type.to_s
36
38
  # when 'maj', 'major' then :major
@@ -42,6 +44,7 @@ module VCLog
42
44
  # end
43
45
  #end
44
46
 
47
+ =begin
45
48
  #
46
49
  def type_phrase
47
50
  case type.to_s
@@ -56,27 +59,10 @@ module VCLog
56
59
  when '-'
57
60
  'Administrative Changes'
58
61
  else
59
- "#{type.capitalize} Enhancements"
60
- end
61
- end
62
-
63
- #
64
- def type_number
65
- case type.to_s.downcase
66
- when 'maj', 'major'
67
- 0
68
- when 'min', 'minor'
69
- 1
70
- when 'bug'
71
- 2
72
- when ''
73
- 4
74
- when '-'
75
- 5
76
- else # other
77
- 3
62
+ "#{type.to_s.capitalize} Enhancements"
78
63
  end
79
64
  end
65
+ =end
80
66
 
81
67
  #
82
68
  def <=>(other)
@@ -104,8 +90,7 @@ module VCLog
104
90
  # to_h.to_yaml(*args)
105
91
  #end
106
92
 
107
- private
108
-
93
+ =begin
109
94
  # Looks for a "[type]" indicator at the end of the commit message.
110
95
  # If that is not found, it looks at front of message for
111
96
  # "[type]" or "[type]:". Failing that it tries just "type:".
@@ -127,6 +112,7 @@ module VCLog
127
112
  n.gsub!(/^\s*?\n/m,'') # remove blank lines
128
113
  return n, t
129
114
  end
115
+ =end
130
116
 
131
117
  end #class Entry
132
118
 
@@ -17,24 +17,15 @@ module VCLog
17
17
 
18
18
  DIR = File.dirname(__FILE__)
19
19
 
20
+ # Seconds in a day.
20
21
  DAY = 24*60*60
21
22
 
23
+ #
22
24
  attr :changes
23
25
 
24
- attr_accessor :marker
25
-
26
- attr_accessor :title
27
-
28
- # Include revision id?
29
- attr_accessor :rev_id
30
-
31
26
  #
32
27
  def initialize(changes=nil)
33
28
  @changes = []
34
- @marker = "#"
35
- @title = "CHANGE LOG"
36
- @rev_id = false
37
-
38
29
  @changes = changes if changes
39
30
  end
40
31
 
@@ -55,6 +46,11 @@ module VCLog
55
46
  @changes << Change.new(rev, date, who, note, type)
56
47
  end
57
48
 
49
+ #
50
+ def sort!(&block)
51
+ changes.sort!(&block)
52
+ end
53
+
58
54
  #
59
55
  def each(&block)
60
56
  changes.each(&block)
@@ -384,7 +380,7 @@ end
384
380
  entries = groups[n]
385
381
  next if !entries
386
382
  next if entries.empty?
387
- string << "* #{entries.size} #{entries[0].type_phrase}\n\n"
383
+ string << "* #{entries.size} #{entries[0].label}\n\n"
388
384
  entries.sort!{|a,b| a.date <=> b.date }
389
385
  entries.each do |entry|
390
386
  #string << "== #{date} #{who}\n\n" # no email :(