svnx 2.7.2 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/svnx/base/action.rb +2 -4
- data/lib/svnx/base/cmdline.rb +0 -5
- data/lib/svnx/base/command.rb +8 -0
- data/lib/svnx/base/command_factory.rb +1 -1
- data/lib/svnx/base/entries.rb +3 -3
- data/lib/svnx/base/entry.rb +12 -2
- data/lib/svnx/base/options.rb +14 -0
- data/lib/svnx/log/entry.rb +5 -1
- data/lib/svnx/log/options.rb +4 -5
- data/lib/svnx/project.rb +5 -4
- data/lib/svnx/propset/options.rb +1 -1
- data/lib/svnx/update/options.rb +4 -2
- data/lib/svnx/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee2f457c3e6d933420b413b096eedae95a3decbc
|
4
|
+
data.tar.gz: bf37347ef5a34295118aad381c99989654f691b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bb4a5fb1970c4f169b8127980535f15ce625fc197b750cf6b630802c43e3cc8976605f44e56bd645bd0d2ed6c0a9cabcc6c4903fe73f3037d541c5cc54ef2fc
|
7
|
+
data.tar.gz: 5e5460362594822a2e48a1b59ab1b72523c1de289348568a9b80a42071fa41c59cc100a0416375a5ea9a1f14a968db1930f9fd9a34cdeab801f0ed3a411f1930
|
data/lib/svnx/base/action.rb
CHANGED
@@ -11,7 +11,7 @@ module Svnx
|
|
11
11
|
super
|
12
12
|
else
|
13
13
|
type = args.first
|
14
|
-
types = constants
|
14
|
+
types = constants false
|
15
15
|
types.each do |t|
|
16
16
|
tc = const_get t
|
17
17
|
if tc.type == type.to_sym || tc.abbrev == type
|
@@ -53,9 +53,7 @@ module Svnx
|
|
53
53
|
Action.const_set str.upcase, action
|
54
54
|
methname = str + '?'
|
55
55
|
define_method methname do
|
56
|
-
|
57
|
-
@type.to_sym == sym
|
58
|
-
end
|
56
|
+
@type.to_sym == sym
|
59
57
|
end
|
60
58
|
end
|
61
59
|
end
|
data/lib/svnx/base/cmdline.rb
CHANGED
@@ -19,24 +19,19 @@ module Svnx::Base
|
|
19
19
|
attr_reader :status
|
20
20
|
|
21
21
|
def initialize subcommand: nil, xml: true, caching: false, args: Array.new
|
22
|
-
debug "subcommand: #{subcommand}"
|
23
|
-
debug "args: #{args}"
|
24
22
|
@subcommand = subcommand
|
25
23
|
@xml = xml
|
26
24
|
@caching = caching
|
27
25
|
@args = args
|
28
|
-
debug "@args: #{@args}"
|
29
26
|
end
|
30
27
|
|
31
28
|
def execute
|
32
29
|
cmdargs = [ 'svn', @subcommand ]
|
33
30
|
cmdargs << '--xml' if @xml
|
34
31
|
cmdargs.concat @args
|
35
|
-
debug "cmdargs: #{cmdargs}"
|
36
32
|
|
37
33
|
cmdline = command_line cmdargs
|
38
34
|
cmdline.execute
|
39
|
-
debug "cmdline: #{cmdline}"
|
40
35
|
|
41
36
|
@output = cmdline.output
|
42
37
|
@error = cmdline.error
|
data/lib/svnx/base/command.rb
CHANGED
@@ -29,22 +29,30 @@ module Svnx::Base
|
|
29
29
|
attr_reader :options
|
30
30
|
|
31
31
|
def initialize options, cmdlinecls: nil, optcls: nil, xml: false, caching: caching?
|
32
|
+
debug "options: #{options}"
|
32
33
|
factory = CommandFactory.new
|
33
34
|
|
34
35
|
params = factory.create self.class, cmdlinecls: cmdlinecls, optcls: optcls
|
35
36
|
|
36
37
|
optcls ||= params.options
|
38
|
+
debug "optcls: #{optcls}"
|
37
39
|
|
38
40
|
@options = optcls.new options
|
39
41
|
cmdargs = @options.to_args
|
42
|
+
debug "cmdargs: #{cmdargs}"
|
40
43
|
|
41
44
|
subcommand = params.subcommand
|
42
45
|
|
43
46
|
cmdlinecls ||= params.cmdline
|
47
|
+
|
48
|
+
debug "subcommand: #{subcommand}"
|
44
49
|
|
45
50
|
@cmdline = cmdlinecls.new(subcommand: subcommand, xml: xml, caching: caching, args: cmdargs)
|
51
|
+
debug "@cmdline: #{@cmdline}"
|
46
52
|
|
47
53
|
@output = @cmdline.execute
|
54
|
+
debug "@output: #{@output}"
|
55
|
+
|
48
56
|
@error = @cmdline.error
|
49
57
|
@status = @cmdline.status
|
50
58
|
end
|
data/lib/svnx/base/entries.rb
CHANGED
@@ -42,14 +42,14 @@ module Svnx::Base
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def [] idx
|
45
|
-
if entry = @entries[idx]
|
46
|
-
return entry
|
47
|
-
end
|
48
45
|
if idx >= size
|
49
46
|
raise "error: index #{idx} is not in range(0 .. #{size})"
|
50
47
|
elsif idx < 0
|
51
48
|
idx = size + idx
|
52
49
|
end
|
50
|
+
if entry = @entries[idx]
|
51
|
+
return entry
|
52
|
+
end
|
53
53
|
@entries[idx] = create_entry @elements[idx]
|
54
54
|
end
|
55
55
|
|
data/lib/svnx/base/entry.rb
CHANGED
@@ -21,8 +21,18 @@ module Svnx::Base
|
|
21
21
|
raise "must be implemented"
|
22
22
|
end
|
23
23
|
|
24
|
-
def set_attr_var xmlelement, varname, attrname = varname
|
25
|
-
|
24
|
+
def set_attr_var xmlelement, varname, attrname = varname, convert: nil
|
25
|
+
value = if xmlelement
|
26
|
+
val = attribute_value xmlelement, attrname
|
27
|
+
if convert
|
28
|
+
val = val.send convert
|
29
|
+
end
|
30
|
+
val
|
31
|
+
else
|
32
|
+
nil
|
33
|
+
end
|
34
|
+
|
35
|
+
set_var varname, value
|
26
36
|
end
|
27
37
|
|
28
38
|
def set_attr_vars xmlelement, *varnames
|
data/lib/svnx/base/options.rb
CHANGED
@@ -54,6 +54,20 @@ module Svnx::Base
|
|
54
54
|
tag
|
55
55
|
end
|
56
56
|
end
|
57
|
+
|
58
|
+
def has_tag_field name
|
59
|
+
has_field name, to_tag(name)
|
60
|
+
end
|
61
|
+
|
62
|
+
def has_tag_fields(*names)
|
63
|
+
names.each do |name|
|
64
|
+
has_tag_field name
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def has_tag_argument tagname, methname
|
69
|
+
has_field methname, to_args(tagname, methname)
|
70
|
+
end
|
57
71
|
end
|
58
72
|
|
59
73
|
def initialize args
|
data/lib/svnx/log/entry.rb
CHANGED
@@ -11,7 +11,7 @@ module Svnx::Log
|
|
11
11
|
attr_reader :revision, :reverse_merge, :author, :date, :paths, :msg, :entries
|
12
12
|
|
13
13
|
def set_from_element elmt
|
14
|
-
set_attr_var elmt, 'revision'
|
14
|
+
set_attr_var elmt, 'revision', convert: :to_i
|
15
15
|
@reverse_merge = attribute_value elmt, 'reverse-merge'
|
16
16
|
|
17
17
|
set_elmt_vars elmt, 'author', 'date', 'msg'
|
@@ -33,6 +33,10 @@ module Svnx::Log
|
|
33
33
|
[ @revision, @author, @date, @msg ].collect { |x| x.to_s }.join " "
|
34
34
|
end
|
35
35
|
|
36
|
+
def inspect
|
37
|
+
to_s
|
38
|
+
end
|
39
|
+
|
36
40
|
def match action, filter
|
37
41
|
paths.select do |path|
|
38
42
|
path.match? action, filter
|
data/lib/svnx/log/options.rb
CHANGED
@@ -11,11 +11,10 @@ end
|
|
11
11
|
|
12
12
|
module Svnx::Log
|
13
13
|
class Options < Svnx::Base::Options
|
14
|
-
has_fields limit:
|
15
|
-
verbose:
|
16
|
-
|
17
|
-
|
18
|
-
depth: to_args("--depth", :depth)
|
14
|
+
has_fields limit: to_args("--limit", :limit),
|
15
|
+
verbose: "-v",
|
16
|
+
depth: to_args("--depth", :depth)
|
17
|
+
has_tag_fields :stop_on_copy, :use_merge_history
|
19
18
|
has :revision, :url, :path
|
20
19
|
end
|
21
20
|
end
|
data/lib/svnx/project.rb
CHANGED
@@ -35,8 +35,9 @@ class Svnx::Project
|
|
35
35
|
require "svnx/#{cmd}/command"
|
36
36
|
require "svnx/#{cmd}/options"
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
modname = Kernel.const_get "Svnx::" + cmd.to_s.capitalize
|
39
|
+
initargs = { url: "@url", path: "@dir", paths: "[ @dir ]" }
|
40
|
+
optcls = modname::Options
|
40
41
|
opts = optcls.new Hash.new
|
41
42
|
fields = opts.fields.keys
|
42
43
|
params = fields.collect { |key| key.to_s + ": " + (initargs[key] || "nil") }.join ", "
|
@@ -44,8 +45,8 @@ class Svnx::Project
|
|
44
45
|
|
45
46
|
src = Array.new.tap do |a|
|
46
47
|
a << "def #{cmd} #{params}, cmdlinecls: @cmdlinecls"
|
47
|
-
a << "
|
48
|
-
a << "
|
48
|
+
a << " svncmd = #{modname}::Command.new({ #{cmdargs} }, cmdlinecls: cmdlinecls)"
|
49
|
+
a << " svncmd.respond_to?(:entries) ? svncmd.entries : svncmd.output"
|
49
50
|
a << "end"
|
50
51
|
end.join "\n"
|
51
52
|
|
data/lib/svnx/propset/options.rb
CHANGED
data/lib/svnx/update/options.rb
CHANGED
@@ -10,7 +10,9 @@ end
|
|
10
10
|
|
11
11
|
module Svnx::Update
|
12
12
|
class Options < Svnx::Base::Options
|
13
|
-
has :revision
|
14
|
-
|
13
|
+
has :revision, :paths
|
14
|
+
has_tag_argument "--depth", :depth
|
15
|
+
has_tag_argument "--set-depth", :set_depth
|
16
|
+
has_tag_field :ignore_externals
|
15
17
|
end
|
16
18
|
end
|
data/lib/svnx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svnx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Pace
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: command-cacheable
|