svnx 2.9.0 → 2.11.0
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.
- checksums.yaml +4 -4
- data/lib/svnx/base/action.rb +1 -0
- data/lib/svnx/base/entries.rb +24 -21
- data/lib/svnx/base/fields.rb +4 -1
- data/lib/svnx/base/tags.rb +12 -0
- data/lib/svnx/commit/options.rb +1 -1
- data/lib/svnx/log/options.rb +2 -4
- data/lib/svnx/propget/options.rb +3 -3
- data/lib/svnx/status/entry.rb +31 -8
- data/lib/svnx/update/options.rb +1 -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: 1122bd68ff487bab49f705895f6055e7515fd976
|
4
|
+
data.tar.gz: fdaa77e7db8b9f74096297b900db7dbc4d17d323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b023f779f02aacba414699568ac6056fc62cf06c7c26729723034e8e4c16c40709dd062c10cadd37a4121a9aa694485169292df4a3a3e7e617ef61818a12e4f3
|
7
|
+
data.tar.gz: 6b81673dcaad702f88bbb826c2e609014dbe0599103e308a04d21d08192beb68e2b594574cc8ab2016ee6c4180bd006727393e2bc222048f33decfd846333b75
|
data/lib/svnx/base/action.rb
CHANGED
data/lib/svnx/base/entries.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
|
4
4
|
require 'rexml/document'
|
5
5
|
require 'nokogiri'
|
6
|
-
require 'logue/loggable'
|
7
6
|
|
8
7
|
module Svnx
|
9
8
|
module Base
|
@@ -17,7 +16,7 @@ $use_nokogiri = true
|
|
17
16
|
|
18
17
|
module Svnx::Base
|
19
18
|
class Entries
|
20
|
-
include
|
19
|
+
include Enumerable
|
21
20
|
|
22
21
|
attr_reader :size
|
23
22
|
|
@@ -41,29 +40,33 @@ module Svnx::Base
|
|
41
40
|
raise "create_entry must be implemented for: #{self.class}"
|
42
41
|
end
|
43
42
|
|
44
|
-
def
|
45
|
-
|
46
|
-
raise "error: index #{idx} is not in range(0 .. #{size})"
|
47
|
-
elsif idx < 0
|
48
|
-
idx = size + idx
|
49
|
-
end
|
50
|
-
if entry = @entries[idx]
|
51
|
-
return entry
|
52
|
-
end
|
53
|
-
@entries[idx] = create_entry @elements[idx]
|
43
|
+
def to_index idx
|
44
|
+
idx < 0 ? size + idx : idx
|
54
45
|
end
|
55
46
|
|
56
|
-
def
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
47
|
+
def [] idx
|
48
|
+
if idx.kind_of? Range
|
49
|
+
fridx = to_index idx.first
|
50
|
+
toidx = to_index idx.last
|
51
|
+
rg = Range.new fridx, toidx, idx.exclude_end?
|
52
|
+
rg.collect { |x| self[x] }
|
53
|
+
else
|
54
|
+
if idx >= size
|
55
|
+
raise "error: index #{idx} is not in range(0 .. #{size})"
|
56
|
+
else
|
57
|
+
idx = to_index idx
|
61
58
|
end
|
62
|
-
|
63
|
-
|
59
|
+
if entry = @entries[idx]
|
60
|
+
return entry
|
61
|
+
end
|
62
|
+
@entries[idx] = create_entry @elements[idx]
|
64
63
|
end
|
65
|
-
|
66
|
-
|
64
|
+
end
|
65
|
+
|
66
|
+
def each(&blk)
|
67
|
+
(0 ... size).collect do |idx|
|
68
|
+
@entries[idx] ||= create_entry @elements[idx]
|
69
|
+
end.each(&blk)
|
67
70
|
end
|
68
71
|
end
|
69
72
|
end
|
data/lib/svnx/base/fields.rb
CHANGED
data/lib/svnx/base/tags.rb
CHANGED
@@ -61,6 +61,18 @@ module Svnx::Base
|
|
61
61
|
def has_tag_argument tagname, methname
|
62
62
|
has_field methname, to_args(tagname, methname)
|
63
63
|
end
|
64
|
+
|
65
|
+
def has_tag_arg name
|
66
|
+
has_field name, to_args(to_tag(name), name)
|
67
|
+
end
|
68
|
+
|
69
|
+
def has_tag_arguments(*names)
|
70
|
+
names.each do |name|
|
71
|
+
tag = to_tag name
|
72
|
+
args = to_args tag, name
|
73
|
+
has_field name, args
|
74
|
+
end
|
75
|
+
end
|
64
76
|
end
|
65
77
|
|
66
78
|
extend ClassMethods
|
data/lib/svnx/commit/options.rb
CHANGED
data/lib/svnx/log/options.rb
CHANGED
@@ -11,10 +11,8 @@ end
|
|
11
11
|
|
12
12
|
module Svnx::Log
|
13
13
|
class Options < Svnx::Base::Options
|
14
|
-
|
15
|
-
|
16
|
-
depth: to_args("--depth", :depth)
|
17
|
-
has_tag_fields :stop_on_copy, :use_merge_history
|
14
|
+
has_tag_arguments :limit, :depth
|
15
|
+
has_tag_fields :verbose, :stop_on_copy, :use_merge_history
|
18
16
|
has :revision, :url, :path
|
19
17
|
end
|
20
18
|
end
|
data/lib/svnx/propget/options.rb
CHANGED
@@ -9,9 +9,9 @@ module Svnx
|
|
9
9
|
end
|
10
10
|
|
11
11
|
module Svnx::Propget
|
12
|
-
class Options < Svnx::Base::Options
|
13
|
-
|
14
|
-
name: nil
|
12
|
+
class Options < Svnx::Base::Options
|
13
|
+
has_tag_field :revprop
|
15
14
|
has :revision, :url, :path
|
15
|
+
has_fields name: nil
|
16
16
|
end
|
17
17
|
end
|
data/lib/svnx/status/entry.rb
CHANGED
@@ -10,14 +10,40 @@ module Svnx
|
|
10
10
|
end
|
11
11
|
|
12
12
|
module Svnx::Status
|
13
|
+
class Commit
|
14
|
+
attr_reader :revision
|
15
|
+
attr_reader :author
|
16
|
+
attr_reader :date
|
17
|
+
|
18
|
+
def initialize elmt
|
19
|
+
rev = elmt['revision']
|
20
|
+
@revision = rev.nil? ? rev : rev.to_i
|
21
|
+
@author = elmt.at_xpath('author').text
|
22
|
+
@date = elmt.at_xpath('date').text
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class WorkingCopy
|
27
|
+
attr_reader :properties
|
28
|
+
attr_reader :status
|
29
|
+
attr_reader :revision
|
30
|
+
attr_reader :commit
|
31
|
+
|
32
|
+
def initialize wcstatus
|
33
|
+
@properties = wcstatus['props']
|
34
|
+
@status = Svnx::Action.new wcstatus['item']
|
35
|
+
@revision = (n = wcstatus['revision']) && n.to_i
|
36
|
+
commit = wcstatus.at_xpath 'commit'
|
37
|
+
@commit = commit && Commit.new(commit)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
13
41
|
class Entry < Svnx::Base::Entry
|
14
42
|
include Comparable
|
15
43
|
|
16
|
-
attr_reader :commit_revision
|
17
44
|
attr_reader :name
|
18
45
|
attr_reader :path
|
19
|
-
attr_reader :
|
20
|
-
attr_reader :status_revision
|
46
|
+
attr_reader :working_copy
|
21
47
|
|
22
48
|
def initialize xmlelement, rootpath: nil
|
23
49
|
@rootpath = rootpath
|
@@ -26,15 +52,12 @@ module Svnx::Status
|
|
26
52
|
|
27
53
|
def set_from_element elmt
|
28
54
|
set_attr_var elmt, 'path'
|
29
|
-
|
30
55
|
wcstatus = elmt.at_xpath 'wc-status'
|
31
|
-
@status = Svnx::Action.new wcstatus['item']
|
32
|
-
set_attr_var wcstatus, 'status_revision', 'revision'
|
33
56
|
|
34
|
-
commit = wcstatus.at_xpath 'commit'
|
35
|
-
set_attr_var commit, 'commit_revision', 'revision'
|
36
57
|
@name = @path.dup
|
37
58
|
|
59
|
+
@working_copy = WorkingCopy.new wcstatus
|
60
|
+
|
38
61
|
if @rootpath
|
39
62
|
# name is prefixed with directory unless '.' is used as the argument
|
40
63
|
@name.sub! Regexp.new('^' + @rootpath), ''
|
data/lib/svnx/update/options.rb
CHANGED
@@ -11,8 +11,7 @@ end
|
|
11
11
|
module Svnx::Update
|
12
12
|
class Options < Svnx::Base::Options
|
13
13
|
has :revision, :paths
|
14
|
-
|
15
|
-
has_tag_argument "--set-depth", :set_depth
|
14
|
+
has_tag_arguments :depth, :set_depth
|
16
15
|
has_tag_field :ignore_externals
|
17
16
|
end
|
18
17
|
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.11.0
|
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-
|
11
|
+
date: 2019-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: command-cacheable
|