vclog 1.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/vclog/vcs/svn.rb CHANGED
@@ -4,35 +4,39 @@ module VCLog
4
4
 
5
5
  # = SVN
6
6
  #
7
- # SVN's raw log format:
8
- #
9
- # ------------------------------------------------------------------------
10
- # r34 | transami | 2006-08-02 22:10:11 -0400 (Wed, 02 Aug 2006) | 2 lines
11
- #
12
- # change foo to work better
7
+ # NOTE: Unfortunately the SVN adapater is very slow. If hits the server
8
+ # every time the 'svn log' command is issued. When generating a History
9
+ # that's one hit for every tag. If anyone knows a better way please have
10
+ # at it --maybe future versions of SVN will improve the situation.
13
11
  #
14
12
  class SVN < VCS
15
13
 
14
+ def initialize(root)
15
+ begin
16
+ require 'xmlsimple'
17
+ rescue LoadError
18
+ "VCLog requires xmlsimple for SVN support"
19
+ end
20
+ super(root)
21
+ end
22
+
16
23
  #
17
24
  def extract_changes
18
25
  log = []
19
26
 
20
- txt = `svn log`.strip
27
+ xml = `svn log --xml`.strip
21
28
 
22
- com = txt.split(/^[-]+$/)
29
+ commits = XmlSimple.xml_in(xml, {'KeyAttr' => 'rev'})
30
+ commits = commits['logentry']
23
31
 
24
- com.each do |msg|
25
- msg = msg.strip
32
+ commits.each do |com|
33
+ rev = com["revision"]
34
+ msg = [com["msg"]].flatten.compact.join('').strip
35
+ who = [com["author"]].flatten.compact.join('').strip
36
+ date = [com["date"]].flatten.compact.join('').strip
26
37
 
27
38
  next if msg.empty?
28
-
29
- idx = msg.index("\n")
30
- head = msg.slice!(0...idx)
31
- rev, who, date, cnt = *head.split('|')
32
-
33
- rev = rev.strip
34
- who = who.strip
35
- msg = msg.strip
39
+ next if msg == "*** empty log message ***"
36
40
 
37
41
  date = Time.parse(date)
38
42
 
@@ -58,6 +62,7 @@ module VCLog
58
62
  tags.each do |path|
59
63
  dir = File.join(tagdir, path)
60
64
 
65
+ # using yaml, but maybe use xml instead?
61
66
  info = `svn info #{dir}`
62
67
  info = YAML.load(info)
63
68
  md = /(\d.*)$/.match(info['Path'])
@@ -66,8 +71,13 @@ module VCLog
66
71
  who = info['Last Changed Author']
67
72
  rev = info['Revision']
68
73
 
69
- commit = `svn log -r BASE #{dir}`
70
- msg = commit.lines.to_a[2..-2].join("\n").strip
74
+ # get last commit
75
+ xml = `svn log -l1 --xml #{dir}`
76
+ commits = XmlSimple.xml_in(xml, {'KeyAttr' => 'rev'})
77
+ commit = commits['logentry'].first
78
+
79
+ msg = [commit["msg"]].flatten.compact.join('').strip
80
+ date = [commit["date"]].flatten.compact.join('').strip
71
81
 
72
82
  list << [name, date, who, msg]
73
83
  end
data/lib/vclog/vcs.rb CHANGED
@@ -97,12 +97,21 @@ module VCLog
97
97
 
98
98
  private
99
99
 
100
- # Looks for a "[type]" indicator at the end of the message.
100
+ # Looks for a "[type]" indicator at the end of the commit message.
101
+ # If that is not found, it looks at front of message for
102
+ # "[type]" or "[type]:". Failing that it tries just "type:".
103
+ #
101
104
  def split_type(note)
102
105
  note = note.strip
103
- if md = /\A.*?\[(.*?)\]\s*$/.match(note)
106
+ if md = /\[(.*?)\]\Z/.match(note)
107
+ t = md[1].strip.downcase
108
+ n = note[0...(md.begin(0))]
109
+ elsif md = /\A\[(.*?)\]\:?/.match(note)
110
+ t = md[1].strip.downcase
111
+ n = note[md.end(0)..-1]
112
+ elsif md = /\A(\w+?)\:/.match(note)
104
113
  t = md[1].strip.downcase
105
- n = note.sub(/\[#{md[1]}\]\s*$/, "")
114
+ n = note[md.end(0)..-1]
106
115
  else
107
116
  n, t = note, nil
108
117
  end
data/lib/vclog.rb ADDED
@@ -0,0 +1 @@
1
+ require 'vclog/vcs'
File without changes
File without changes
data/meta/version CHANGED
@@ -1 +1 @@
1
- 1.2
1
+ 1.4.0
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vclog
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.2"
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 4
8
+ - 0
9
+ version: 1.4.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Thomas Sawyer
@@ -9,66 +14,83 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-10-26 00:00:00 -04:00
17
+ date: 2010-05-26 00:00:00 -04:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: facets
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">"
22
26
  - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
27
+ segments:
28
+ - 2
29
+ - 4
30
+ version: "2.4"
31
+ type: :runtime
32
+ version_requirements: *id001
25
33
  description: VCLog is a cross-VCS/SCM ChangeLog generator.
26
- email: http://googlegroups.com/group/proutils
34
+ email:
27
35
  executables:
28
36
  - vclog
29
37
  extensions: []
30
38
 
31
39
  extra_rdoc_files:
32
- - README
33
- - MANIFEST
34
- - TODO
35
- - LICENSE
36
- - HISTORY.md
40
+ - README.rdoc
37
41
  files:
38
- - HISTORY.md
39
- - LICENSE
40
- - MANIFEST
41
- - README
42
- - TODO
43
42
  - bin/vclog
43
+ - lib/plugins/syckle/vclog.rb
44
44
  - lib/vclog/change.rb
45
45
  - lib/vclog/changelog.rb
46
46
  - lib/vclog/cli.rb
47
47
  - lib/vclog/facets.rb
48
+ - lib/vclog/heuristics.rb
48
49
  - lib/vclog/history.rb
49
50
  - lib/vclog/release.rb
50
51
  - lib/vclog/tag.rb
51
- - lib/vclog/vcs.rb
52
+ - lib/vclog/templates/changelog.gnu
53
+ - lib/vclog/templates/changelog.html
54
+ - lib/vclog/templates/changelog.markdown
55
+ - lib/vclog/templates/changelog.rdoc
56
+ - lib/vclog/templates/changelog.xml
57
+ - lib/vclog/templates/changelog.xsl
58
+ - lib/vclog/templates/history.html
59
+ - lib/vclog/templates/history.markdown
60
+ - lib/vclog/templates/history.rdoc
61
+ - lib/vclog/templates/history.xml
52
62
  - lib/vclog/vcs/darcs.rb
53
63
  - lib/vclog/vcs/git.rb
54
64
  - lib/vclog/vcs/hg.rb
55
65
  - lib/vclog/vcs/svn.rb
66
+ - lib/vclog/vcs.rb
67
+ - lib/vclog.rb
68
+ - features/history.feature
69
+ - features/step_definitions/history_steps.rb
70
+ - features/support/ae.rb
71
+ - features/support/loadpath.rb
56
72
  - meta/authors
57
73
  - meta/contact
58
74
  - meta/created
59
75
  - meta/description
60
76
  - meta/homepage
61
77
  - meta/license
62
- - meta/loadpath
63
- - meta/parent
64
- - meta/project
78
+ - meta/name
65
79
  - meta/repository
66
80
  - meta/requires
67
81
  - meta/ruby
68
82
  - meta/sitemap
83
+ - meta/suite
69
84
  - meta/summary
70
85
  - meta/title
71
86
  - meta/version
87
+ - HISTORY.rdoc
88
+ - PROFILE
89
+ - LICENSE
90
+ - README.rdoc
91
+ - ROADMAP.rdoc
92
+ - REQUIRE
93
+ - VERSION
72
94
  has_rdoc: true
73
95
  homepage: http://proutils.rubyforge.org/vclog
74
96
  licenses: []
@@ -78,26 +100,27 @@ rdoc_options:
78
100
  - --title
79
101
  - VCLog API
80
102
  - --main
81
- - README
103
+ - README.rdoc
82
104
  require_paths:
83
105
  - lib
84
- - plug
85
106
  required_ruby_version: !ruby/object:Gem::Requirement
86
107
  requirements:
87
108
  - - ">="
88
109
  - !ruby/object:Gem::Version
110
+ segments:
111
+ - 0
89
112
  version: "0"
90
- version:
91
113
  required_rubygems_version: !ruby/object:Gem::Requirement
92
114
  requirements:
93
115
  - - ">="
94
116
  - !ruby/object:Gem::Version
117
+ segments:
118
+ - 0
95
119
  version: "0"
96
- version:
97
120
  requirements: []
98
121
 
99
122
  rubyforge_project: proutils
100
- rubygems_version: 1.3.5
123
+ rubygems_version: 1.3.6
101
124
  signing_key:
102
125
  specification_version: 3
103
126
  summary: Cross-VCS/SCM ChangeLog Generator
data/HISTORY.md DELETED
@@ -1,55 +0,0 @@
1
- # RELEASE HISTORY
2
-
3
- ## 1.2 / 2009-10-26
4
-
5
- Version 1.2 overhuals the internals so that History
6
- output is based on scm tags, not on a pre-existing history file.
7
- This is really the proper way to go about it and those
8
- who use it will, I think, be happily surprised at how it
9
- promotes good practices for the maintenance of History files.
10
- This overhaul led to substantial changes in the command-line
11
- interface.
12
-
13
- Changes:
14
-
15
- * 2 Major Enhancements
16
-
17
- * Rewrote History class.
18
- * Changed command-line interface.
19
-
20
-
21
- ## 1.1 / 2009-10-23
22
-
23
- This release adds yaml and json formats an improves
24
- the command.
25
-
26
- Changes:
27
-
28
- * 2 Major Enhancements
29
-
30
- * Added YAML format.
31
- * Added JSON format.
32
-
33
- * 1 Minor Enhancements
34
-
35
- * Use OptionParser instead of GetoptLong.
36
-
37
-
38
- ## 1.0.0 / 2009-10-13
39
-
40
- This is the first "production" release of VCLog.
41
-
42
- * 2 Major Enhancements
43
-
44
- * Improved command line interface.
45
- * Added output option to save changelog.
46
-
47
-
48
- ## 0.1.0 / 2009-08-17
49
-
50
- This is the initial version of vclog.
51
-
52
- * 1 Major Enhancement
53
-
54
- * Happy Birthday
55
-
data/MANIFEST DELETED
@@ -1,36 +0,0 @@
1
- HISTORY.md
2
- LICENSE
3
- MANIFEST
4
- README
5
- TODO
6
- bin/vclog
7
- lib/vclog
8
- lib/vclog/change.rb
9
- lib/vclog/changelog.rb
10
- lib/vclog/cli.rb
11
- lib/vclog/facets.rb
12
- lib/vclog/history.rb
13
- lib/vclog/release.rb
14
- lib/vclog/tag.rb
15
- lib/vclog/vcs
16
- lib/vclog/vcs.rb
17
- lib/vclog/vcs/darcs.rb
18
- lib/vclog/vcs/git.rb
19
- lib/vclog/vcs/hg.rb
20
- lib/vclog/vcs/svn.rb
21
- meta/authors
22
- meta/contact
23
- meta/created
24
- meta/description
25
- meta/homepage
26
- meta/license
27
- meta/loadpath
28
- meta/parent
29
- meta/project
30
- meta/repository
31
- meta/requires
32
- meta/ruby
33
- meta/sitemap
34
- meta/summary
35
- meta/title
36
- meta/version
data/meta/loadpath DELETED
@@ -1,2 +0,0 @@
1
- lib
2
- plug