mercurial-ruby 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/mercurial-ruby.rb +3 -1
- data/lib/mercurial-ruby/commit.rb +14 -0
- data/mercurial-ruby.gemspec +2 -2
- data/test/test_blame.rb +1 -1
- data/test/test_blame_factory.rb +1 -1
- data/test/test_branch_factory.rb +1 -1
- data/test/test_changed_file.rb +1 -1
- data/test/test_changed_file_factory.rb +1 -1
- data/test/test_command.rb +1 -1
- data/test/test_commit.rb +10 -1
- data/test/test_commit_factory.rb +1 -1
- data/test/test_config_file.rb +1 -1
- data/test/test_configuration.rb +1 -1
- data/test/test_diff.rb +1 -1
- data/test/test_diff_factory.rb +1 -1
- data/test/test_file_index.rb +1 -1
- data/test/test_hook.rb +1 -1
- data/test/test_hook_factory.rb +1 -1
- data/test/test_manifest.rb +1 -1
- data/test/test_node.rb +1 -1
- data/test/test_node_factory.rb +1 -1
- data/test/test_repository.rb +1 -1
- data/test/test_shell.rb +1 -1
- data/test/test_tag_factory.rb +1 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.2
|
data/lib/mercurial-ruby.rb
CHANGED
@@ -91,6 +91,20 @@ module Mercurial
|
|
91
91
|
def short_hash_id
|
92
92
|
hash_id.to_s[0,12]
|
93
93
|
end
|
94
|
+
|
95
|
+
#
|
96
|
+
# Returns a Hash of diffstat-style summary of changes for the commit.
|
97
|
+
#
|
98
|
+
def stats(cmd_options={})
|
99
|
+
raw = hg(["log -r ? --stat --template '{node}\n'", hash_id], cmd_options)
|
100
|
+
result = raw.scan(/(\d+) files changed, (\d+) insertions\(\+\), (\d+) deletions\(\-\)$/).flatten.map{|r| r.to_i}
|
101
|
+
{
|
102
|
+
'files' => result[0],
|
103
|
+
'additions' => result[1],
|
104
|
+
'deletions' => result[2],
|
105
|
+
'total' => result[1] + result[2]
|
106
|
+
}
|
107
|
+
end
|
94
108
|
|
95
109
|
def to_hash
|
96
110
|
{
|
data/mercurial-ruby.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mercurial-ruby}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ilya Sabanin"]
|
12
|
-
s.date = %q{2012-03-
|
12
|
+
s.date = %q{2012-03-08}
|
13
13
|
s.description = %q{Ruby API for Mercurial DVCS.}
|
14
14
|
s.email = %q{ilya.sabanin@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/test/test_blame.rb
CHANGED
data/test/test_blame_factory.rb
CHANGED
data/test/test_branch_factory.rb
CHANGED
data/test/test_changed_file.rb
CHANGED
data/test/test_command.rb
CHANGED
data/test/test_commit.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'helper'
|
1
|
+
require File.dirname(__FILE__) + '/helper'
|
2
2
|
|
3
3
|
describe Mercurial::Commit do
|
4
4
|
|
@@ -62,5 +62,14 @@ describe Mercurial::Commit do
|
|
62
62
|
commit = @repository.commits.by_hash_id('cd9fa0c59c7f')
|
63
63
|
commit.exist_in_branches.map(&:name).sort.must_equal %w(default another-branch).sort
|
64
64
|
end
|
65
|
+
|
66
|
+
it "should fetch stats" do
|
67
|
+
commit = @repository.commits.by_hash_id('cd9fa0c59c7f')
|
68
|
+
stats = commit.stats
|
69
|
+
stats['files'].must_equal 3
|
70
|
+
stats['additions'].must_equal 85
|
71
|
+
stats['deletions'].must_equal 6
|
72
|
+
stats['total'].must_equal 91
|
73
|
+
end
|
65
74
|
|
66
75
|
end
|
data/test/test_commit_factory.rb
CHANGED
data/test/test_config_file.rb
CHANGED
data/test/test_configuration.rb
CHANGED
data/test/test_diff.rb
CHANGED
data/test/test_diff_factory.rb
CHANGED
data/test/test_file_index.rb
CHANGED
data/test/test_hook.rb
CHANGED
data/test/test_hook_factory.rb
CHANGED
data/test/test_manifest.rb
CHANGED
data/test/test_node.rb
CHANGED
data/test/test_node_factory.rb
CHANGED
data/test/test_repository.rb
CHANGED
data/test/test_shell.rb
CHANGED
data/test/test_tag_factory.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mercurial-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 2
|
10
|
+
version: 0.7.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ilya Sabanin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-03-
|
18
|
+
date: 2012-03-08 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|