pvn 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,73 +31,4 @@ module PVN::Subcommands::Pct
|
|
31
31
|
diff_counts
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
35
|
-
class RepositoryDiffer < Differ
|
36
|
-
### $$$ this belongs in Revision
|
37
|
-
def get_from_to_revisions rev
|
38
|
-
if rev.kind_of? Array
|
39
|
-
if rev.size == 1
|
40
|
-
if md = Regexp.new('(.+):(.+)').match(rev[0])
|
41
|
-
return [ md[1], md[2] ]
|
42
|
-
else
|
43
|
-
return [ (rev[0].to_i - 1).to_s, rev[0] ]
|
44
|
-
end
|
45
|
-
else
|
46
|
-
return [ rev[0], rev[1] ]
|
47
|
-
end
|
48
|
-
else
|
49
|
-
info "rev: #{rev}".bold.white.on_red
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def get_line_count path, revision
|
54
|
-
info "path: #{path}".yellow
|
55
|
-
cmdargs = SVNx::CatCommandArgs.new :path => path, :revision => revision
|
56
|
-
catcmd = SVNx::CatCommand.new cmdargs
|
57
|
-
catcmd.execute.size
|
58
|
-
end
|
59
|
-
|
60
|
-
def get_diff_counts path, options
|
61
|
-
diff_counts = Array.new
|
62
|
-
|
63
|
-
revision = options.revision
|
64
|
-
|
65
|
-
elmt = PVN::IO::Element.new :local => path
|
66
|
-
modified = elmt.find_modified_entries revision
|
67
|
-
|
68
|
-
modnames = modified.collect { |m| m.name }.sort.uniq
|
69
|
-
|
70
|
-
fromrev, torev = get_from_to_revisions revision
|
71
|
-
|
72
|
-
reporoot = elmt.repo_root
|
73
|
-
|
74
|
-
direlmt = PVN::IO::Element.new :local => '.'
|
75
|
-
svninfo = direlmt.get_info
|
76
|
-
|
77
|
-
filter = svninfo.url.dup
|
78
|
-
filter.slice! svninfo.root
|
79
|
-
info "filter: #{filter}"
|
80
|
-
filterre = Regexp.new '^' + filter + '/'
|
81
|
-
|
82
|
-
modnames.each do |mod|
|
83
|
-
fullpath = reporoot + mod
|
84
|
-
elmt = PVN::IO::Element.new :path => fullpath
|
85
|
-
|
86
|
-
next unless elmt.has_revision? fromrev
|
87
|
-
next unless elmt.has_revision? torev
|
88
|
-
next if elmt.get_info.kind == 'dir'
|
89
|
-
|
90
|
-
from_count = get_line_count fullpath, fromrev
|
91
|
-
to_count = get_line_count fullpath, torev
|
92
|
-
|
93
|
-
name = mod.dup
|
94
|
-
name.slice! filterre
|
95
|
-
|
96
|
-
dc = PVN::DiffCount.new from_count, to_count, name
|
97
|
-
diff_counts << dc
|
98
|
-
end
|
99
|
-
|
100
|
-
diff_counts
|
101
|
-
end
|
102
|
-
end
|
103
34
|
end
|
metadata
CHANGED