vclog 1.8.2 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/.ruby +4 -3
  2. data/.yardopts +7 -0
  3. data/HISTORY.rdoc +207 -0
  4. data/README.rdoc +44 -27
  5. data/bin/vclog +4 -2
  6. data/bin/vclog-autotag +6 -0
  7. data/bin/vclog-bump +6 -0
  8. data/bin/vclog-formats +6 -0
  9. data/bin/vclog-version +6 -0
  10. data/lib/vclog.rb +1 -1
  11. data/lib/vclog.yml +58 -0
  12. data/lib/vclog/adapters.rb +2 -1
  13. data/lib/vclog/adapters/abstract.rb +87 -232
  14. data/lib/vclog/adapters/darcs.rb +72 -67
  15. data/lib/vclog/adapters/git.rb +166 -140
  16. data/lib/vclog/adapters/hg.rb +98 -62
  17. data/lib/vclog/adapters/svn.rb +116 -113
  18. data/lib/vclog/change.rb +110 -81
  19. data/lib/vclog/change_point.rb +77 -0
  20. data/lib/vclog/changelog.rb +58 -296
  21. data/lib/vclog/cli.rb +6 -70
  22. data/lib/vclog/cli/abstract.rb +64 -81
  23. data/lib/vclog/cli/autotag.rb +1 -3
  24. data/lib/vclog/cli/bump.rb +3 -4
  25. data/lib/vclog/cli/formats.rb +4 -4
  26. data/lib/vclog/cli/log.rb +86 -0
  27. data/lib/vclog/cli/version.rb +3 -3
  28. data/lib/vclog/{facets.rb → core_ext.rb} +0 -0
  29. data/lib/vclog/heuristics.rb +112 -38
  30. data/lib/vclog/heuristics/rule.rb +52 -12
  31. data/lib/vclog/heuristics/{label.rb → type.rb} +2 -2
  32. data/lib/vclog/history_file.rb +2 -2
  33. data/lib/vclog/metadata.rb +13 -1
  34. data/lib/vclog/release.rb +26 -12
  35. data/lib/vclog/repo.rb +191 -27
  36. data/lib/vclog/report.rb +187 -0
  37. data/lib/vclog/tag.rb +66 -39
  38. data/lib/vclog/templates/changelog.ansi.rb +9 -26
  39. data/lib/vclog/templates/changelog.atom.erb +3 -3
  40. data/lib/vclog/templates/changelog.gnu.rb +4 -11
  41. data/lib/vclog/templates/changelog.html.erb +11 -2
  42. data/lib/vclog/templates/changelog.markdown.rb +4 -4
  43. data/lib/vclog/templates/changelog.rdoc.rb +4 -4
  44. data/lib/vclog/templates/changelog.rss.erb +2 -6
  45. data/lib/vclog/templates/changelog.xml.erb +14 -2
  46. data/lib/vclog/templates/history.ansi.rb +10 -17
  47. data/lib/vclog/templates/history.atom.erb +4 -4
  48. data/lib/vclog/templates/history.gnu.rb +5 -7
  49. data/lib/vclog/templates/history.html.erb +11 -4
  50. data/lib/vclog/templates/history.json.rb +1 -1
  51. data/lib/vclog/templates/history.markdown.rb +5 -7
  52. data/lib/vclog/templates/history.rdoc.rb +5 -9
  53. data/lib/vclog/templates/history.rss.erb +3 -5
  54. data/lib/vclog/templates/history.xml.erb +15 -3
  55. data/lib/vclog/templates/history.yaml.rb +1 -1
  56. data/man/man1/vclog-autotag.1 +1 -1
  57. data/man/man1/vclog-autotag.1.html +1 -1
  58. data/man/man1/vclog-bump.1 +1 -1
  59. data/man/man1/vclog-bump.1.html +1 -1
  60. data/man/man1/vclog-version.1 +1 -1
  61. data/man/man1/vclog-version.1.html +1 -1
  62. data/man/man1/vclog.1 +25 -13
  63. data/man/man1/vclog.1.html +29 -20
  64. data/man/man1/vclog.1.ronn +31 -18
  65. data/test/unit/case_metadata.rb +1 -1
  66. metadata +48 -34
  67. data/lib/vclog/cli/changelog.rb +0 -33
  68. data/lib/vclog/cli/help.rb +0 -42
  69. data/lib/vclog/cli/history.rb +0 -39
  70. data/lib/vclog/formatter.rb +0 -123
  71. data/lib/vclog/history.rb +0 -131
  72. data/lib/vclog/kernel.rb +0 -12
  73. data/man/man1/vclog-changelog.1 +0 -47
  74. data/man/man1/vclog-changelog.1.html +0 -123
  75. data/man/man1/vclog-changelog.1.ronn +0 -39
  76. data/man/man1/vclog-history.1 +0 -44
  77. data/man/man1/vclog-history.1.html +0 -122
  78. data/man/man1/vclog-history.1.ronn +0 -38
@@ -25,11 +25,20 @@
25
25
  <ul>
26
26
  <% changelog.changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
27
27
  <li class="commit">
28
+ <div class="id"><%= h entry.id %></div>
28
29
  <div class="date"><%= entry.date %></div>
29
30
  <div class="author"><%= h entry.author %></div>
30
31
  <div class="type"><%= h entry.type %></div>
31
- <div class="message"><%= h entry.message %></div>
32
- <div class="revision">#<%= h entry.revision %></div>
32
+ <div class="message">
33
+ <div class="summary"><%= h entry.summary %></div>
34
+ <% if entry.details.empty? %>
35
+ <div class="details"></div>
36
+ <% else %>
37
+ <div class="details">
38
+ <%= r entry.details %>
39
+ </div>
40
+ <% end %>
41
+ </div>
33
42
  </li>
34
43
  <% end %>
35
44
  </ul>
@@ -9,17 +9,17 @@ changelog.by_date.each do |date, date_changes|
9
9
  out << "\n## #{date} #{author}\n"
10
10
 
11
11
  author_changes.each do |entry|
12
+ msg = entry.to_s(:summary=>!options.detail)
12
13
 
13
- out << "* #{entry.message.strip}"
14
+ out << msg.tabto(2).sub(' ','* ')
14
15
 
15
16
  if entry.type
16
17
  out.last << " [#{entry.type}]"
17
18
  end
18
19
 
19
- if options.revision
20
- out.last << " (##{entry.revision})"
20
+ if options.reference
21
+ out.last << " (##{entry.id})"
21
22
  end
22
-
23
23
  end
24
24
 
25
25
  end
@@ -9,17 +9,17 @@ changelog.by_date.each do |date, date_changes|
9
9
  out << "\n== #{date} #{author}\n"
10
10
 
11
11
  author_changes.each do |entry|
12
+ msg = entry.to_s(:summary=>!options.detail)
12
13
 
13
- out << "* #{entry.message.strip}"
14
+ out << msg.tabto(2).sub(' ','* ')
14
15
 
15
16
  if entry.type
16
17
  out.last << " [#{entry.type}]"
17
18
  end
18
19
 
19
- if options.revision
20
- out.last << " (##{entry.revision})"
20
+ if options.reference
21
+ out.last << " (##{entry.id})"
21
22
  end
22
-
23
23
  end
24
24
 
25
25
  end
@@ -29,8 +29,7 @@
29
29
  <% changelog.changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
30
30
 
31
31
  <item>
32
-
33
- <title><%= h entry.message.lines.first.rstrip %></title>
32
+ <title><%= h entry.summary %></title>
34
33
 
35
34
  <author><%= entry.author %></author>
36
35
 
@@ -38,14 +37,11 @@
38
37
 
39
38
  <pubDate><%= entry.date.rfc822 %></pubDate>
40
39
 
41
- <guid><%= url %>#<%= entry.revision %></guid>
40
+ <guid><%= url %>#<%= entry.id %></guid>
42
41
 
43
42
  <description><![CDATA[
44
-
45
43
  <%= entry.message %><br/>
46
-
47
44
  <%= entry.author %> <%= entry.date.strftime('%Y-%m-%d %H:%M:%S') %>
48
-
49
45
  ]]></description>
50
46
 
51
47
  </item>
@@ -5,11 +5,23 @@
5
5
  <changelog title="<%= title %>">
6
6
  <% changelog.changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
7
7
  <commit>
8
- <revision>#<%= h entry.revision %></revision>
8
+ <id><%= h entry.id %></id>
9
9
  <date><%= entry.date %></date>
10
10
  <author><%= h entry.author %></author>
11
11
  <type><%= h entry.type %></type>
12
- <message><%= h entry.message %></message>
12
+ <message>
13
+ <summary><%= h entry.summary %></summary>
14
+ <% if entry.details.empty? %>
15
+ <details></details>
16
+ <% else %>
17
+ <details>
18
+ <![CDATA[
19
+ <%= h entry.details %>
20
+
21
+ ]]>
22
+ </details>
23
+ <% end %>
24
+ </message>
13
25
  </commit>
14
26
  <% end %>
15
27
  </changelog>
@@ -4,8 +4,7 @@ out = []
4
4
 
5
5
  out << "#{title.ansi(:bold)}"
6
6
 
7
- history.releases.sort.each do |release|
8
-
7
+ releases.sort.each do |release|
9
8
  tag = release.tag
10
9
 
11
10
  # TODO: support verbose option
@@ -17,7 +16,7 @@ history.releases.sort.each do |release|
17
16
 
18
17
  out << "\n#{tag.message.strip} (#{tag.author})"
19
18
 
20
- if options.extra && !release.changes.empty?
19
+ if !(options.summary or release.changes.empty?)
21
20
 
22
21
  #out << "\nChanges:".ansi(:green)
23
22
 
@@ -26,30 +25,26 @@ history.releases.sort.each do |release|
26
25
  out << "\n* " + "#{changes.size} #{changes[0].label}\n"
27
26
 
28
27
  changes.sort{|a,b| b.date <=> a.date}.each do |entry|
29
-
30
- line = "#{entry.message.strip}"
31
-
32
- if options.revision
33
- out.last << "(##{entry.revision})"
34
- end
28
+ msg = entry.to_s(:summary=>!options.detail)
35
29
 
36
30
  case entry.level
37
31
  when 1
38
- line = line.ansi(:yellow)
32
+ msg = msg.ansi(:yellow)
39
33
  when 0
40
- line = line.ansi(:green)
34
+ msg = msg.ansi(:green)
41
35
  when -1
42
- line = line.ansi(:cyan)
36
+ msg = msg.ansi(:cyan)
43
37
  else
44
38
  if entry.level > 1
45
- line = line.ansi(:red)
39
+ msg = msg.ansi(:red)
46
40
  else
47
- line = line.ansi(:blue)
41
+ msg = msg.ansi(:blue)
48
42
  end
49
43
  end
50
44
 
51
- out << " * " + line
45
+ msg << "\n(##{entry.id})" if options.reference
52
46
 
47
+ out << msg.tabto(6).sub(' ',' * ')
53
48
  end
54
49
 
55
50
  end
@@ -57,8 +52,6 @@ history.releases.sort.each do |release|
57
52
  end
58
53
 
59
54
  out << ""
60
-
61
55
  end
62
56
 
63
57
  out.join("\n") + "\n"
64
-
@@ -10,7 +10,7 @@
10
10
 
11
11
  <% if homepage %><link href="<%= homepage %>" /><% end %>
12
12
 
13
- <id><% if vcs.uuid %>urn:uuid:<%= vcs.uuid %><% else %><%= vcs.repository %><% end %></id>
13
+ <id><% if repo.uuid %>urn:uuid:<%= repo.uuid %><% else %><%= repo.repository %><% end %></id>
14
14
 
15
15
  <updated><%= Time.now.xmlschema %></updated>
16
16
 
@@ -22,7 +22,7 @@
22
22
 
23
23
  </author>
24
24
 
25
- <% history.releases.sort.each do |release| %>
25
+ <% releases.sort.each do |release| %>
26
26
 
27
27
  <% tag = release.tag %>
28
28
 
@@ -44,7 +44,7 @@
44
44
 
45
45
  <p><%= tag.message %></p>
46
46
 
47
- <% if options.extra %>
47
+ <% if !options.summary %>
48
48
 
49
49
  <% release.groups.each do |number, changes| %>
50
50
 
@@ -60,7 +60,7 @@
60
60
 
61
61
  <%= entry.author %> <%= entry.date.strftime('%Y-%m-%d %H:%M:%S') %>
62
62
 
63
- <% if options.revision %>(#<%= entry.revision %>)<% end %>
63
+ <% if options.reference %>(#<%= entry.id %>)<% end %>
64
64
 
65
65
  </li>
66
66
 
@@ -3,7 +3,7 @@ out = []
3
3
 
4
4
  out << "#{title}"
5
5
 
6
- history.releases.sort.each do |release|
6
+ releases.sort.each do |release|
7
7
 
8
8
  tag = release.tag
9
9
 
@@ -11,7 +11,7 @@ history.releases.sort.each do |release|
11
11
 
12
12
  out << "\n#{tag.message.strip} (#{tag.author})"
13
13
 
14
- if options.extra && !release.changes.empty?
14
+ if !(options.summary or release.changes.empty?)
15
15
 
16
16
  out << "\nChanges:"
17
17
 
@@ -20,13 +20,11 @@ history.releases.sort.each do |release|
20
20
  out << "\n* #{changes.size} #{changes[0].label }\n"
21
21
 
22
22
  changes.sort{|a,b| b.date <=> a.date}.each do |entry|
23
+ msg = entry.to_s(:summary=>!options.detail)
23
24
 
24
- out << " * #{entry.message.strip}"
25
-
26
- if options.revision
27
- out.last << "(##{entry.revision})"
28
- end
25
+ msg << "\n(##{entry.id})" if options.reference
29
26
 
27
+ out << msg.tabto(6).sub(' ',' * ')
30
28
  end
31
29
 
32
30
  end
@@ -21,12 +21,12 @@
21
21
  <div class="main">
22
22
  <div class="title"><%= title %></div>
23
23
  <div class="history">
24
- <% history.releases.sort.each do |release| %>
24
+ <% releases.sort.each do |release| %>
25
25
  <% tag = release.tag %>
26
26
 
27
27
  <h1><%= tag.name %> / <%= tag.date.strftime('%Y-%m-%d') %></h1>
28
28
  <p><%= tag.message %></p>
29
- <% if options.extra %>
29
+ <% if !options.summary %>
30
30
  <% release.groups.each do |number, changes| %>
31
31
 
32
32
  <h2><%= changes.size %> <%= changes[0].label %></h2>
@@ -34,10 +34,17 @@
34
34
  <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
35
35
  <li class="entry">
36
36
  <div class="message">
37
- <%= h entry.message.strip %>
37
+ <div class="summary"><%= h entry.summary %></summary>
38
+ <% if entry.details.empty? %>
39
+ <div class="details"></div>
40
+ <% else %>
41
+ <div class="details">
42
+ <%= r entry.details %>
43
+ </div>
44
+ <% end %>
38
45
  </div>
39
46
  <!-- <div class="type"><%= h entry.type %></div> -->
40
- <div class="revision">#<%= h entry.revision %></div>
47
+ <div class="id">#<%= h entry.id %></div>
41
48
  <div class="date"><%= entry.date %></div>
42
49
  <div class="author"><%= h entry.author %></div>
43
50
  </li>
@@ -1 +1 @@
1
- history.to_h.to_json
1
+ releases.map{ |r| r.to_h }.to_json
@@ -2,7 +2,7 @@ out = []
2
2
 
3
3
  out << "# #{title || 'RELEASE HISTORY'}"
4
4
 
5
- history.releases.sort.each do |release|
5
+ releases.sort.each do |release|
6
6
 
7
7
  tag = release.tag
8
8
 
@@ -10,7 +10,7 @@ history.releases.sort.each do |release|
10
10
 
11
11
  out << "\n#{tag.message.strip} (#{tag.author})"
12
12
 
13
- if options.extra && !release.changes.empty?
13
+ if !(options.summary or release.changes.empty?)
14
14
 
15
15
  out << "\nChanges:"
16
16
 
@@ -19,13 +19,11 @@ history.releases.sort.each do |release|
19
19
  out << "\n* #{changes.size} #{changes[0].label }\n"
20
20
 
21
21
  changes.sort{|a,b| b.date <=> a.date}.each do |entry|
22
+ msg = entry.to_s(:summary=>!options.detail)
22
23
 
23
- out << " * #{entry.message.strip}"
24
-
25
- if options.revision
26
- out.last << "(##{entry.revision})"
27
- end
24
+ msg << "\n(##{entry.id})" if options.reference
28
25
 
26
+ out << msg.tabto(6).sub(' ',' * ')
29
27
  end
30
28
 
31
29
  end
@@ -2,15 +2,14 @@ out = []
2
2
 
3
3
  out << "= #{title || 'Release History'}"
4
4
 
5
- history.releases.sort.each do |release|
6
-
5
+ releases.sort.each do |release|
7
6
  tag = release.tag
8
7
 
9
8
  out << "\n== #{tag.name} / #{tag.date.strftime('%Y-%m-%d')}"
10
9
 
11
10
  out << "\n#{tag.message.strip} (#{tag.author})"
12
11
 
13
- if options.extra && !release.changes.empty?
12
+ if !(options.summary or release.changes.empty?)
14
13
 
15
14
  out << "\nChanges:"
16
15
 
@@ -19,13 +18,11 @@ history.releases.sort.each do |release|
19
18
  out << "\n* #{changes.size} #{changes[0].label }\n"
20
19
 
21
20
  changes.sort{|a,b| b.date <=> a.date}.each do |entry|
21
+ msg = entry.to_s(:summary=>!options.detail)
22
22
 
23
- out << " * #{entry.message.strip}"
24
-
25
- if options.revision
26
- out.last << "(##{entry.revision})"
27
- end
23
+ msg << "\n(##{entry.id})" if options.reference
28
24
 
25
+ out << msg.tabto(6).sub(' ',' * ')
29
26
  end
30
27
 
31
28
  end
@@ -33,7 +30,6 @@ history.releases.sort.each do |release|
33
30
  end
34
31
 
35
32
  out << ""
36
-
37
33
  end
38
34
 
39
35
  out.join("\n") + "\n"
@@ -26,7 +26,7 @@
26
26
 
27
27
  <webMaster><%= email %> (<%= user %>)</webMaster>
28
28
 
29
- <% history.releases.sort.each do |release| %>
29
+ <% releases.sort.each do |release| %>
30
30
 
31
31
  <% tag = release.tag %>
32
32
 
@@ -46,7 +46,7 @@
46
46
 
47
47
  <p><%= tag.message %></p>
48
48
 
49
- <% if options.extra %>
49
+ <% if !options.summary %>
50
50
 
51
51
  <% release.groups.each do |number, changes| %>
52
52
 
@@ -57,13 +57,11 @@
57
57
  <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
58
58
 
59
59
  <li class="entry">
60
-
61
60
  <%= entry.message.rstrip %><br/>
62
61
 
63
62
  <%= entry.author %> <%= entry.date.strftime('%Y-%m-%d %H:%M:%S') %>
64
63
 
65
- <% if options.revision %>(#<%= h entry.revision %>)<% end %>
66
-
64
+ <% if options.reference %>(#<%= h entry.id %>)<% end %>
67
65
  </li>
68
66
 
69
67
  <% end %>
@@ -4,7 +4,7 @@
4
4
  <% end %>
5
5
  <history>
6
6
  <title><%= title %></title>
7
- <% history.releases.sort.each do |release| %>
7
+ <% releases.sort.each do |release| %>
8
8
  <tag>
9
9
  <% tag = release.tag %>
10
10
  <name><%= h tag.name %></name>
@@ -16,11 +16,23 @@
16
16
  <commit-group type="<%= changes[0].type %>" label="<%= changes[0].label %>">
17
17
  <% changes.sort{|a,b| b.date <=> a.date}.each do |entry| %>
18
18
  <commit>
19
- <revision>#<%= h entry.revision %></revision>
19
+ <id><%= h entry.revision %></id>
20
20
  <date><%= entry.date %></date>
21
21
  <author><%= h entry.author %></author>
22
22
  <type><%= h entry.type %></type>
23
- <message><%= h entry.message %></message>
23
+ <message>
24
+ <summary><%= h entry.summary %></summary>
25
+ <% if entry.details.empty? %>
26
+ <details></details>
27
+ <% else %>
28
+ <details>
29
+ <![CDATA[
30
+ <%= h entry.details %>
31
+
32
+ ]]>
33
+ </details>
34
+ <% end %>
35
+ </message>
24
36
  </commit>
25
37
  <% end %>
26
38
  </commit-group>
@@ -1 +1 @@
1
- history.to_h.to_yaml
1
+ releases.map{ |r| r.to_h }.to_yaml
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "VCLOG\-AUTOTAG" "1" "November 2010" "RubyWorks" "VCLog"
4
+ .TH "VCLOG\-AUTOTAG" "1" "December 2011" "RubyWorks" "VCLog"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBvclog\-autotag\fR \- tag history entries