pvn 0.0.5 → 0.0.6
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.
- data/README.markdown +3 -2
- data/bin/modify_timestamps.rb +31 -0
- data/bin/populate.rb +231 -0
- data/bin/quote.rb +206 -0
- data/lib/pvn/app.rb +4 -1
- data/lib/pvn/io/element.rb +9 -0
- data/lib/pvn/subcommands/base/command.rb +15 -15
- data/lib/pvn/subcommands/base/options.rb +4 -0
- data/lib/pvn/subcommands/diff/command.rb +46 -0
- data/lib/pvn/subcommands/diff/differ.rb +65 -0
- data/lib/pvn/subcommands/diff/local_differ.rb +103 -0
- data/lib/pvn/subcommands/diff/options.rb +28 -0
- data/lib/pvn/subcommands/diff/repository_differ.rb +145 -0
- data/lib/pvn/subcommands/log/command.rb +29 -11
- data/lib/pvn/subcommands/log/options.rb +0 -4
- data/lib/pvn/subcommands/pct/command.rb +10 -176
- data/lib/pvn/subcommands/pct/diffcount.rb +4 -2
- data/lib/pvn/subcommands/pct/differ.rb +34 -0
- data/lib/pvn/subcommands/pct/local_differ.rb +103 -0
- data/lib/pvn/subcommands/pct/options.rb +0 -4
- data/lib/pvn/subcommands/pct/repository_differ.rb +78 -0
- data/lib/pvn/subcommands/revision/base_option.rb +48 -0
- data/lib/pvn/subcommands/revision/revision_option.rb +2 -37
- data/lib/pvn/subcommands/status/command.rb +13 -8
- data/lib/pvn/subcommands/status/options.rb +0 -4
- data/lib/svnx/cat/command.rb +2 -0
- data/lib/svnx/info/entry.rb +3 -0
- data/lib/synoption/exception.rb +12 -0
- data/lib/synoption/set.rb +26 -0
- data/test/integration/pvn/subcommands/diff/command_test.rb +153 -0
- data/test/integration/svnx/log/test.rb +1 -1
- data/test/unit/pvn/revision/entry_test.rb +0 -13
- data/test/unit/svnx/info/entries_test.rb +3 -3
- data/test/unit/svnx/info/entry_test.rb +3 -2
- data/test/unit/svnx/status/entries_test.rb +1 -1
- data/test/unit/synoption/set_test.rb +34 -18
- metadata +20 -4
@@ -0,0 +1,103 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# -*- ruby -*-
|
3
|
+
|
4
|
+
require 'pvn/io/element'
|
5
|
+
require 'svnx/cat/command'
|
6
|
+
require 'pvn/subcommands/pct/diffcount'
|
7
|
+
require 'pvn/subcommands/pct/differ'
|
8
|
+
|
9
|
+
module PVN::Subcommands::Pct
|
10
|
+
class LocalDiffer < Differ
|
11
|
+
def get_diff_counts path, options
|
12
|
+
elmt = PVN::IO::Element.new :local => path
|
13
|
+
modified = elmt.find_modified_files
|
14
|
+
|
15
|
+
total = PVN::DiffCount.new
|
16
|
+
|
17
|
+
modified = modified.sort_by { |n| n.path }
|
18
|
+
|
19
|
+
diff_counts = Array.new
|
20
|
+
|
21
|
+
modified.each do |entry|
|
22
|
+
info "entry.path: #{entry.path}"
|
23
|
+
catcmd = SVNx::CatCommand.new entry.path
|
24
|
+
svn_count = catcmd.execute.size
|
25
|
+
local_count = Pathname.new(entry.path).readlines.size
|
26
|
+
|
27
|
+
dc = PVN::DiffCount.new svn_count, local_count, entry.path
|
28
|
+
diff_counts << dc
|
29
|
+
end
|
30
|
+
|
31
|
+
diff_counts
|
32
|
+
end
|
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
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# -*- ruby -*-
|
3
|
+
|
4
|
+
require 'pvn/io/element'
|
5
|
+
require 'svnx/cat/command'
|
6
|
+
require 'pvn/subcommands/pct/diffcount'
|
7
|
+
require 'pvn/subcommands/pct/differ'
|
8
|
+
|
9
|
+
module PVN::Subcommands::Pct
|
10
|
+
class RepositoryDiffer < Differ
|
11
|
+
### $$$ this belongs in Revision
|
12
|
+
def get_from_to_revisions rev
|
13
|
+
if rev.kind_of? Array
|
14
|
+
if rev.size == 1
|
15
|
+
if md = Regexp.new('(.+):(.+)').match(rev[0])
|
16
|
+
return [ md[1], md[2] ]
|
17
|
+
else
|
18
|
+
return [ (rev[0].to_i - 1).to_s, rev[0] ]
|
19
|
+
end
|
20
|
+
else
|
21
|
+
return [ rev[0], rev[1] ]
|
22
|
+
end
|
23
|
+
else
|
24
|
+
info "rev: #{rev}".bold.white.on_red
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_line_count path, revision
|
29
|
+
info "path: #{path}".yellow
|
30
|
+
cmdargs = SVNx::CatCommandArgs.new :path => path, :revision => revision
|
31
|
+
catcmd = SVNx::CatCommand.new cmdargs
|
32
|
+
catcmd.execute.size
|
33
|
+
end
|
34
|
+
|
35
|
+
def get_diff_counts path, options
|
36
|
+
diff_counts = Array.new
|
37
|
+
|
38
|
+
revision = options.revision
|
39
|
+
|
40
|
+
elmt = PVN::IO::Element.new :local => path
|
41
|
+
modified = elmt.find_modified_entries revision
|
42
|
+
|
43
|
+
modnames = modified.collect { |m| m.name }.sort.uniq
|
44
|
+
|
45
|
+
fromrev, torev = get_from_to_revisions revision
|
46
|
+
|
47
|
+
reporoot = elmt.repo_root
|
48
|
+
|
49
|
+
direlmt = PVN::IO::Element.new :local => '.'
|
50
|
+
svninfo = direlmt.get_info
|
51
|
+
|
52
|
+
filter = svninfo.url.dup
|
53
|
+
filter.slice! svninfo.root
|
54
|
+
info "filter: #{filter}"
|
55
|
+
filterre = Regexp.new '^' + filter + '/'
|
56
|
+
|
57
|
+
modnames.each do |mod|
|
58
|
+
fullpath = reporoot + mod
|
59
|
+
elmt = PVN::IO::Element.new :path => fullpath
|
60
|
+
|
61
|
+
next unless elmt.has_revision? fromrev
|
62
|
+
next unless elmt.has_revision? torev
|
63
|
+
next if elmt.get_info.kind == 'dir'
|
64
|
+
|
65
|
+
from_count = get_line_count fullpath, fromrev
|
66
|
+
to_count = get_line_count fullpath, torev
|
67
|
+
|
68
|
+
name = mod.dup
|
69
|
+
name.slice! filterre
|
70
|
+
|
71
|
+
dc = PVN::DiffCount.new from_count, to_count, name
|
72
|
+
diff_counts << dc
|
73
|
+
end
|
74
|
+
|
75
|
+
diff_counts
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# -*- ruby -*-
|
3
|
+
|
4
|
+
require 'riel'
|
5
|
+
require 'rubygems'
|
6
|
+
require 'synoption/option'
|
7
|
+
require 'svnx/log/command'
|
8
|
+
require 'pvn/revision/entry'
|
9
|
+
|
10
|
+
module PVN
|
11
|
+
class BaseRevisionOption < Option
|
12
|
+
REVISION_DESCRIPTION = [ "revision to apply.",
|
13
|
+
"ARG can be relative, of the form:",
|
14
|
+
" +N : N revisions from the BASE",
|
15
|
+
" -N : N revisions from the HEAD,",
|
16
|
+
" when -1 is the previous revision" ,
|
17
|
+
]
|
18
|
+
|
19
|
+
def head?
|
20
|
+
value.nil? || value == 'HEAD'
|
21
|
+
end
|
22
|
+
|
23
|
+
def resolve_value optset, unprocessed
|
24
|
+
val = value
|
25
|
+
if PVN::Revision::RELATIVE_REVISION_RE.match val
|
26
|
+
@value = relative_to_absolute val, unprocessed[0]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def relative_to_absolute rel, path
|
31
|
+
limit = rel[0, 1] == '-' ? rel.to_i.abs : nil
|
32
|
+
xmllines = run_log_command limit, path
|
33
|
+
|
34
|
+
reventry = PVN::Revision::Entry.new :value => rel, :xmllines => xmllines
|
35
|
+
revval = reventry.value.to_s
|
36
|
+
revval
|
37
|
+
end
|
38
|
+
|
39
|
+
def run_log_command limit, path
|
40
|
+
cmdargs = SVNx::LogCommandArgs.new :limit => limit, :path => path, :use_cache => false
|
41
|
+
cmd = SVNx::LogCommand.new cmdargs
|
42
|
+
cmd.execute
|
43
|
+
end
|
44
|
+
|
45
|
+
def entry
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -1,14 +1,10 @@
|
|
1
1
|
#!/usr/bin/ruby -w
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
|
-
require '
|
5
|
-
require 'rubygems'
|
6
|
-
require 'synoption/option'
|
7
|
-
require 'svnx/log/command'
|
8
|
-
require 'pvn/revision/entry'
|
4
|
+
require 'pvn/subcommands/revision/base_option'
|
9
5
|
|
10
6
|
module PVN
|
11
|
-
class RevisionOption <
|
7
|
+
class RevisionOption < BaseRevisionOption
|
12
8
|
attr_accessor :fromdate
|
13
9
|
attr_accessor :todate
|
14
10
|
|
@@ -18,8 +14,6 @@ module PVN
|
|
18
14
|
" -N : N revisions from the HEAD,",
|
19
15
|
" when -1 is the previous revision" ,
|
20
16
|
]
|
21
|
-
|
22
|
-
POS_NEG_NUMERIC_RE = Regexp.new('^[\-\+]\d+$')
|
23
17
|
|
24
18
|
def initialize revargs = Hash.new
|
25
19
|
@fromdate = nil
|
@@ -48,34 +42,5 @@ module PVN
|
|
48
42
|
super
|
49
43
|
end
|
50
44
|
end
|
51
|
-
|
52
|
-
def head?
|
53
|
-
value.nil? || value == 'HEAD'
|
54
|
-
end
|
55
|
-
|
56
|
-
def resolve_value optset, unprocessed
|
57
|
-
val = value
|
58
|
-
if POS_NEG_NUMERIC_RE.match val
|
59
|
-
@value = relative_to_absolute val, unprocessed[0]
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
def relative_to_absolute rel, path
|
64
|
-
limit = rel[0, 1] == '-' ? rel.to_i.abs : nil
|
65
|
-
xmllines = run_log_command limit, path
|
66
|
-
|
67
|
-
reventry = PVN::Revision::Entry.new :value => rel, :xmllines => xmllines
|
68
|
-
revval = reventry.value.to_s
|
69
|
-
revval
|
70
|
-
end
|
71
|
-
|
72
|
-
def run_log_command limit, path
|
73
|
-
cmdargs = SVNx::LogCommandArgs.new :limit => limit, :path => path, :use_cache => false
|
74
|
-
cmd = SVNx::LogCommand.new cmdargs
|
75
|
-
cmd.execute
|
76
|
-
end
|
77
|
-
|
78
|
-
def entry
|
79
|
-
end
|
80
45
|
end
|
81
46
|
end
|
@@ -24,18 +24,23 @@ module PVN::Subcommands::Status
|
|
24
24
|
example "pvn status", "Prints the status for locally changed files."
|
25
25
|
example "pvn status --no-color", "Prints the status, uncolorized, for locally changed files."
|
26
26
|
|
27
|
-
def
|
28
|
-
|
27
|
+
def init options
|
28
|
+
paths = options.paths
|
29
29
|
|
30
|
-
|
31
|
-
path = options.paths[0] || '.'
|
30
|
+
paths = %w{ . } if paths.empty?
|
32
31
|
|
33
|
-
|
34
|
-
entries = elmt.find_files_by_status
|
32
|
+
allentries = Array.new
|
35
33
|
|
36
|
-
|
34
|
+
# we sort only the sub-entries, so the order in which paths were specified is preserved
|
37
35
|
|
38
|
-
|
36
|
+
paths.each do |path|
|
37
|
+
elmt = PVN::IO::Element.new :local => path
|
38
|
+
entries = elmt.find_files_by_status
|
39
|
+
|
40
|
+
allentries.concat entries.sort_by { |n| n.path }
|
41
|
+
end
|
42
|
+
|
43
|
+
fmtr = PVN::Status::EntriesFormatter.new options.color, allentries
|
39
44
|
puts fmtr.format
|
40
45
|
end
|
41
46
|
end
|
data/lib/svnx/cat/command.rb
CHANGED
data/lib/svnx/info/entry.rb
CHANGED
@@ -11,12 +11,14 @@ module SVNx::Info
|
|
11
11
|
attr_reader :root
|
12
12
|
attr_reader :kind
|
13
13
|
attr_reader :path
|
14
|
+
attr_reader :revision
|
14
15
|
|
15
16
|
def set_from_xml xmldoc
|
16
17
|
entry = xmldoc.elements['info/entry']
|
17
18
|
|
18
19
|
set_attr_var entry, 'kind'
|
19
20
|
set_attr_var entry, 'path'
|
21
|
+
set_attr_var entry, 'revision'
|
20
22
|
set_elmt_var entry, 'url'
|
21
23
|
|
22
24
|
repo = entry.elements['repository']
|
@@ -26,6 +28,7 @@ module SVNx::Info
|
|
26
28
|
def set_from_element elmt
|
27
29
|
set_attr_var elmt, 'kind'
|
28
30
|
set_attr_var elmt, 'path'
|
31
|
+
set_attr_var elmt, 'revision'
|
29
32
|
set_elmt_var elmt, 'url'
|
30
33
|
|
31
34
|
repo = elmt.elements['repository']
|
data/lib/synoption/set.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
require 'rubygems'
|
5
5
|
require 'riel'
|
6
6
|
require 'synoption/option'
|
7
|
+
require 'synoption/exception'
|
7
8
|
|
8
9
|
module PVN
|
9
10
|
class OptionSet
|
@@ -80,9 +81,18 @@ module PVN
|
|
80
81
|
options_processed = Array.new
|
81
82
|
|
82
83
|
@unprocessed = args
|
84
|
+
|
85
|
+
aborted = false
|
83
86
|
|
84
87
|
while !@unprocessed.empty?
|
88
|
+
if @unprocessed[0] == '--'
|
89
|
+
@unprocessed.delete_at 0
|
90
|
+
aborted = true
|
91
|
+
break
|
92
|
+
end
|
93
|
+
|
85
94
|
processed = false
|
95
|
+
|
86
96
|
options.each do |opt|
|
87
97
|
if opt.process @unprocessed
|
88
98
|
processed = true
|
@@ -93,6 +103,22 @@ module PVN
|
|
93
103
|
break unless processed
|
94
104
|
end
|
95
105
|
|
106
|
+
unless aborted
|
107
|
+
check_for_valid_options
|
108
|
+
end
|
109
|
+
|
110
|
+
post_process_all options_processed
|
111
|
+
end
|
112
|
+
|
113
|
+
def check_for_valid_options
|
114
|
+
@unprocessed.each do |opt|
|
115
|
+
if opt.start_with? '-'
|
116
|
+
raise OptionException.new "error: option: #{opt} invalid for #{name}"
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def post_process_all options_processed
|
96
122
|
options_processed.each do |opt|
|
97
123
|
opt.post_process self, @unprocessed
|
98
124
|
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# -*- ruby -*-
|
3
|
+
|
4
|
+
require 'tc'
|
5
|
+
require 'pvn/subcommands/diff/command'
|
6
|
+
require 'resources'
|
7
|
+
require 'stringio'
|
8
|
+
|
9
|
+
module PVN::Subcommands::Diff
|
10
|
+
class CommandTest < PVN::TestCase
|
11
|
+
|
12
|
+
def assert_arrays_equal expected, actual
|
13
|
+
(0 ... [ expected.size, actual.size ].max).each do |idx|
|
14
|
+
assert_equal expected[idx], actual[idx]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def assert_diff_command args, explines
|
19
|
+
orig_dir = Dir.pwd
|
20
|
+
|
21
|
+
Dir.chdir '/Programs/wiquery/trunk'
|
22
|
+
|
23
|
+
strio = StringIO.new
|
24
|
+
|
25
|
+
$io = strio
|
26
|
+
|
27
|
+
dc = Command.new args
|
28
|
+
info "dc: #{dc}".yellow
|
29
|
+
|
30
|
+
strio.close
|
31
|
+
# puts strio.string
|
32
|
+
|
33
|
+
actlines = strio.string.split("\n")
|
34
|
+
|
35
|
+
assert_arrays_equal explines, actlines
|
36
|
+
|
37
|
+
$io = $stdout
|
38
|
+
Dir.chdir orig_dir
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_local_to_head
|
42
|
+
explines = Array.new
|
43
|
+
|
44
|
+
explines << "Index: AddedFile.txt"
|
45
|
+
explines << "==================================================================="
|
46
|
+
explines << "--- AddedFile.txt (revision 0)"
|
47
|
+
explines << "+++ AddedFile.txt (revision 0)"
|
48
|
+
explines << "@@ -0,0 +1,17 @@"
|
49
|
+
explines << "+THE KNIGHT'S TALE"
|
50
|
+
explines << "+WHILOM, as olde stories tellen us,"
|
51
|
+
explines << "+There was a duke that highte Theseus. was called"
|
52
|
+
explines << "+Of Athens he was lord and governor,"
|
53
|
+
explines << "+And in his time such a conqueror"
|
54
|
+
explines << "+That greater was there none under the sun."
|
55
|
+
explines << "+Full many a riche country had he won."
|
56
|
+
explines << "+What with his wisdom and his chivalry,"
|
57
|
+
explines << "+He conquer'd all the regne of Feminie,"
|
58
|
+
explines << "+That whilom was y-cleped Scythia;"
|
59
|
+
explines << "+And weddede the Queen Hippolyta"
|
60
|
+
explines << "+And brought her home with him to his country"
|
61
|
+
explines << "+With muchel glory and great solemnity,"
|
62
|
+
explines << "+And eke her younge sister Emily,"
|
63
|
+
explines << "+And thus with vict'ry and with melody"
|
64
|
+
explines << "+Let I this worthy Duke to Athens ride,"
|
65
|
+
explines << "+And all his host, in armes him beside."
|
66
|
+
explines << "Index: LICENSE"
|
67
|
+
explines << "==================================================================="
|
68
|
+
explines << "--- LICENSE (revision 1950)"
|
69
|
+
explines << "+++ LICENSE (working copy)"
|
70
|
+
explines << "@@ -1,19 +0,0 @@"
|
71
|
+
explines << "-Copyright (c) 2009 WiQuery team"
|
72
|
+
explines << "-"
|
73
|
+
explines << "-Permission is hereby granted, free of charge, to any person obtaining a copy"
|
74
|
+
explines << "-of this software and associated documentation files (the \"Software\"), to deal"
|
75
|
+
explines << "-in the Software without restriction, including without limitation the rights"
|
76
|
+
explines << "-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell"
|
77
|
+
explines << "-copies of the Software, and to permit persons to whom the Software is"
|
78
|
+
explines << "-furnished to do so, subject to the following conditions:"
|
79
|
+
explines << "-"
|
80
|
+
explines << "-The above copyright notice and this permission notice shall be included in"
|
81
|
+
explines << "-all copies or substantial portions of the Software."
|
82
|
+
explines << "-"
|
83
|
+
explines << "-THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"
|
84
|
+
explines << "-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"
|
85
|
+
explines << "-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"
|
86
|
+
explines << "-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"
|
87
|
+
explines << "-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"
|
88
|
+
explines << "-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN"
|
89
|
+
explines << "-THE SOFTWARE."
|
90
|
+
# because we're reading the lines, then puts-ing them, each line gets a "\n"
|
91
|
+
# explines << ""
|
92
|
+
explines << "Index: pom.xml"
|
93
|
+
explines << "==================================================================="
|
94
|
+
explines << "--- pom.xml (revision 1950)"
|
95
|
+
explines << "+++ pom.xml (working copy)"
|
96
|
+
explines << "@@ -7,7 +7,7 @@"
|
97
|
+
explines << " <packaging>pom</packaging>"
|
98
|
+
explines << " <version>1.5-SNAPSHOT</version>"
|
99
|
+
explines << " <name>WiQuery Parent</name>"
|
100
|
+
explines << "-"
|
101
|
+
explines << "+ <!-- inserted comment -->"
|
102
|
+
explines << " <scm>"
|
103
|
+
explines << " <developerConnection>scm:svn:https://wiquery.googlecode.com/svn/branches/wicket-1.5</developerConnection>"
|
104
|
+
explines << " </scm>"
|
105
|
+
explines << "Index: wiquery-core/src/main/java/org/odlabs/wiquery/core/effects/EffectBehavior.java"
|
106
|
+
explines << "==================================================================="
|
107
|
+
explines << "--- wiquery-core/src/main/java/org/odlabs/wiquery/core/effects/EffectBehavior.java (revision 1950)"
|
108
|
+
explines << "+++ wiquery-core/src/main/java/org/odlabs/wiquery/core/effects/EffectBehavior.java (working copy)"
|
109
|
+
explines << "@@ -38,7 +38,6 @@"
|
110
|
+
explines << " */"
|
111
|
+
explines << " public class EffectBehavior extends WiQueryAbstractBehavior"
|
112
|
+
explines << " {"
|
113
|
+
explines << "-"
|
114
|
+
explines << " private static final long serialVersionUID = 3597955113451275208L;"
|
115
|
+
explines << " "
|
116
|
+
explines << " /**"
|
117
|
+
explines << "@@ -49,17 +48,19 @@"
|
118
|
+
explines << " /**"
|
119
|
+
explines << " * Builds a new instance of {@link EffectBehavior}."
|
120
|
+
explines << " */"
|
121
|
+
explines << "- public EffectBehavior(Effect effect)"
|
122
|
+
explines << "- {"
|
123
|
+
explines << "- super();"
|
124
|
+
explines << "+ public EffectBehavior(Effect effect) {"
|
125
|
+
explines << " this.effect = effect;"
|
126
|
+
explines << " }"
|
127
|
+
explines << " "
|
128
|
+
explines << "+ public void newMethod() {"
|
129
|
+
explines << "+ // a new method"
|
130
|
+
explines << "+ }"
|
131
|
+
explines << "+"
|
132
|
+
explines << " @Override"
|
133
|
+
explines << " public JsStatement statement()"
|
134
|
+
explines << " {"
|
135
|
+
explines << "- JsQuery query = new JsQuery(getComponent());"
|
136
|
+
explines << "- query.$().chain(this.effect);"
|
137
|
+
explines << "- return query.getStatement();"
|
138
|
+
explines << "+ JsQuery queryx = new JsQuery(getComponent());"
|
139
|
+
explines << "+ queryx.$().chain(this.effect);"
|
140
|
+
explines << "+ return queryx.getStatement();"
|
141
|
+
explines << " }"
|
142
|
+
explines << " }"
|
143
|
+
|
144
|
+
assert_diff_command %w{ }, explines
|
145
|
+
end
|
146
|
+
|
147
|
+
def test_remote
|
148
|
+
explines = Array.new
|
149
|
+
|
150
|
+
assert_diff_command %w{ -r923:926 }, explines
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -29,7 +29,7 @@ module SVNx::Log
|
|
29
29
|
|
30
30
|
lc.execute
|
31
31
|
output = lc.output
|
32
|
-
info "output: #{output}"
|
32
|
+
# info "output: #{output}"
|
33
33
|
|
34
34
|
expdata = '1947', 'reiern70', '2011-11-14T12:24:45.757124Z', 'added a convenience method to set the range'
|
35
35
|
expdata << { :kind => 'file', :action => 'M', :name => '/trunk/wiquery-jquery-ui/src/test/java/org/odlabs/wiquery/ui/slider/SliderTestCase.java' }
|
@@ -106,18 +106,5 @@ module PVN::Revision
|
|
106
106
|
def xxxtest_range_svn_word_to_number
|
107
107
|
assert_revision_entry 'BASE:1', 'BASE:1'
|
108
108
|
end
|
109
|
-
|
110
|
-
# def test_end
|
111
|
-
# class File
|
112
|
-
# def initialize args
|
113
|
-
# rev = args[:revision]
|
114
|
-
# reventry = Revision.new name, rev
|
115
|
-
# @revision = reventry.number
|
116
|
-
# end
|
117
|
-
# end
|
118
|
-
|
119
|
-
# dir = PVN::IO::File :name => "pom.xml", :revision => "-3"
|
120
|
-
# assert_equal 190, dir.revision
|
121
|
-
# end
|
122
109
|
end
|
123
110
|
end
|
@@ -8,15 +8,15 @@ module SVNx::Info
|
|
8
8
|
class EntriesTestCase < SVNx::Info::TestCase
|
9
9
|
|
10
10
|
def test_create_from_xml
|
11
|
-
entries = Entries.new :xmllines =>
|
11
|
+
entries = Entries.new :xmllines => Resources::WIQTR_INFO_POM_XML_ADDED_FILE_TXT.readlines
|
12
12
|
info "entries: #{entries}"
|
13
13
|
|
14
14
|
assert_equal 2, entries.size
|
15
15
|
|
16
16
|
exproot = 'file:///home/jpace/Programs/Subversion/Repositories/wiquery'
|
17
17
|
|
18
|
-
assert_entry_equals entries[0], :path => 'pom.xml', :kind => 'file', :url => exproot + '/trunk/pom.xml', :root => exproot
|
19
|
-
assert_entry_equals entries[1], :path => '
|
18
|
+
assert_entry_equals entries[0], :path => 'pom.xml', :kind => 'file', :url => exproot + '/trunk/pom.xml', :root => exproot, :revision => '1950'
|
19
|
+
assert_entry_equals entries[1], :path => 'AddedFile.txt', :kind => 'file', :url => exproot + '/trunk/AddedFile.txt', :root => exproot, :revision => '0'
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -8,13 +8,14 @@ module SVNx::Info
|
|
8
8
|
class EntryTestCase < SVNx::Info::TestCase
|
9
9
|
include Loggable
|
10
10
|
def test_entry_from_xml
|
11
|
-
xmllines =
|
11
|
+
xmllines = Resources::WIQTR_INFO_WIQUERY_CORE_POM_XML.readlines
|
12
12
|
|
13
13
|
expdata = {
|
14
14
|
:url => 'file:///home/jpace/Programs/Subversion/Repositories/wiquery/trunk/wiquery-core/pom.xml',
|
15
15
|
:kind => 'file',
|
16
16
|
:path => 'wiquery-core/pom.xml',
|
17
|
-
:root => 'file:///home/jpace/Programs/Subversion/Repositories/wiquery'
|
17
|
+
:root => 'file:///home/jpace/Programs/Subversion/Repositories/wiquery',
|
18
|
+
:revision => '1950'
|
18
19
|
}
|
19
20
|
|
20
21
|
entry = Entry.new :xmllines => xmllines
|
@@ -11,7 +11,7 @@ module SVNx::Status
|
|
11
11
|
entries = Entries.new :xmllines => get_test_lines_all
|
12
12
|
|
13
13
|
assert_equal 4, entries.size
|
14
|
-
assert_status_entry_equals 'added', '
|
14
|
+
assert_status_entry_equals 'added', 'AddedFile.txt', entries[0]
|
15
15
|
assert_status_entry_equals 'deleted', 'LICENSE', entries[1]
|
16
16
|
assert_status_entry_equals 'modified', 'pom.xml', entries[2]
|
17
17
|
assert_status_entry_equals 'modified', 'wiquery-core/src/main/java/org/odlabs/wiquery/core/effects/EffectBehavior.java', entries[3]
|