svnx 2.0.6 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.zshrc +2 -0
- data/Rakefile +2 -3
- data/lib/cmdline/arg.rb +12 -0
- data/lib/cmdline/cachefile.rb +37 -0
- data/lib/cmdline/caching.rb +25 -0
- data/lib/cmdline/filename.rb +16 -0
- data/lib/cmdline/gzpathname.rb +26 -0
- data/lib/cmdline/line.rb +57 -0
- data/lib/svnx/base/action.rb +31 -61
- data/lib/svnx/base/action_status.rb +37 -0
- data/lib/svnx/base/cmd.rb +20 -0
- data/lib/svnx/base/cmdline.rb +43 -37
- data/lib/svnx/base/command.rb +57 -50
- data/lib/svnx/base/command_factory.rb +24 -0
- data/lib/svnx/base/entries.rb +42 -40
- data/lib/svnx/base/entry.rb +46 -44
- data/lib/svnx/base/env.rb +14 -15
- data/lib/svnx/base/options.rb +22 -10
- data/lib/svnx/cat/command.rb +4 -2
- data/lib/svnx/cat/options.rb +11 -14
- data/lib/svnx/commit/command.rb +4 -2
- data/lib/svnx/commit/options.rb +11 -16
- data/lib/svnx/diff/command.rb +9 -7
- data/lib/svnx/diff/elements.rb +56 -54
- data/lib/svnx/diff/options.rb +14 -21
- data/lib/svnx/diff/parser.rb +73 -71
- data/lib/svnx/info/command.rb +4 -2
- data/lib/svnx/info/entries.rb +8 -6
- data/lib/svnx/info/entry.rb +23 -17
- data/lib/svnx/info/options.rb +11 -14
- data/lib/svnx/io/directory.rb +3 -1
- data/lib/svnx/io/element.rb +88 -86
- data/lib/svnx/log/command.rb +4 -2
- data/lib/svnx/log/entries.rb +14 -12
- data/lib/svnx/log/entry.rb +36 -58
- data/lib/svnx/log/entrypath.rb +35 -0
- data/lib/svnx/log/options.rb +14 -18
- data/lib/svnx/merge/command.rb +4 -2
- data/lib/svnx/merge/options.rb +17 -22
- data/lib/svnx/project.rb +27 -15
- data/lib/svnx/propget/command.rb +4 -2
- data/lib/svnx/propget/entries.rb +8 -6
- data/lib/svnx/propget/entry.rb +12 -10
- data/lib/svnx/propget/options.rb +13 -17
- data/lib/svnx/propset/command.rb +4 -2
- data/lib/svnx/propset/options.rb +14 -19
- data/lib/svnx/revision/argfactory.rb +6 -2
- data/lib/svnx/revision/argument.rb +22 -19
- data/lib/svnx/revision/date.rb +16 -16
- data/lib/svnx/revision/error.rb +4 -1
- data/lib/svnx/revision/range.rb +2 -1
- data/lib/svnx/status/command.rb +4 -2
- data/lib/svnx/status/entries.rb +13 -11
- data/lib/svnx/status/entry.rb +37 -39
- data/lib/svnx/status/options.rb +12 -15
- data/lib/svnx/update/command.rb +4 -2
- data/lib/svnx/update/options.rb +11 -12
- data/lib/svnx/util/classutil.rb +19 -0
- data/lib/svnx/util/dateutil.rb +1 -0
- data/lib/svnx/util/objutil.rb +36 -6
- data/lib/svnx/version.rb +1 -1
- data/repackage +1 -0
- data/svnx.gemspec +6 -5
- metadata +29 -6
- data/lib/system/command/arg.rb +0 -13
- data/lib/system/command/cachefile.rb +0 -58
- data/lib/system/command/caching.rb +0 -23
- data/lib/system/command/line.rb +0 -58
data/lib/svnx/revision/date.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
#!/usr/bin/ruby -w
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
|
-
require 'pathname'
|
5
|
-
|
6
4
|
module Svnx
|
7
5
|
module Revision
|
8
6
|
end
|
9
7
|
end
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
module Svnx::Revision
|
10
|
+
class DateToDate
|
11
|
+
attr_reader :from
|
12
|
+
attr_reader :to
|
13
|
+
|
14
|
+
def initialize from, to
|
15
|
+
@from = from
|
16
|
+
@to = to
|
17
|
+
end
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
def to_svn_str
|
20
|
+
[ @from, @to ].collect { |dt| "{" + to_svn_date(dt) + "}" }.join(":")
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_svn_date date
|
24
|
+
date.strftime "%Y-%m-%d"
|
25
|
+
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/svnx/revision/error.rb
CHANGED
data/lib/svnx/revision/range.rb
CHANGED
data/lib/svnx/status/command.rb
CHANGED
data/lib/svnx/status/entries.rb
CHANGED
@@ -4,18 +4,20 @@
|
|
4
4
|
require 'svnx/status/entry'
|
5
5
|
require 'svnx/base/entries'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
module Svnx::Status
|
8
|
+
class Entries < Svnx::Base::Entries
|
9
|
+
def initialize args = Hash.new
|
10
|
+
@rootpath = args[:rootpath]
|
11
|
+
super
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
def get_elements doc
|
15
|
+
# status/target
|
16
|
+
doc.elements['status'].elements['target'].elements
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
def create_entry xmlelement
|
20
|
+
Entry.new xmlelement: xmlelement, rootpath: @rootpath
|
21
|
+
end
|
20
22
|
end
|
21
23
|
end
|
data/lib/svnx/status/entry.rb
CHANGED
@@ -9,49 +9,47 @@ module Svnx
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
attr_reader :status
|
16
|
-
attr_reader :path
|
17
|
-
attr_reader :status_revision
|
18
|
-
attr_reader :action
|
19
|
-
attr_reader :commit_revision
|
20
|
-
attr_reader :name
|
21
|
-
|
22
|
-
def initialize xmlelement: nil, rootpath: nil
|
23
|
-
@rootpath = rootpath
|
24
|
-
super xmlelement: xmlelement
|
25
|
-
# @status is an Svnx::Action
|
26
|
-
@action = @status
|
27
|
-
end
|
28
|
-
|
29
|
-
def set_from_element elmt
|
30
|
-
set_attr_var elmt, 'path'
|
31
|
-
|
32
|
-
wcstatus = elmt.elements['wc-status']
|
33
|
-
@status = Svnx::Action.new(wcstatus.attributes['item'])
|
34
|
-
@status_revision = wcstatus.attributes['revision']
|
12
|
+
module Svnx::Status
|
13
|
+
class Entry < Svnx::Base::Entry
|
14
|
+
include Comparable
|
35
15
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
16
|
+
attr_reader :status
|
17
|
+
attr_reader :path
|
18
|
+
attr_reader :status_revision
|
19
|
+
attr_reader :action
|
20
|
+
attr_reader :commit_revision
|
21
|
+
attr_reader :name
|
22
|
+
|
23
|
+
def initialize xmlelement: nil, rootpath: nil
|
24
|
+
@rootpath = rootpath
|
25
|
+
super xmlelement: xmlelement
|
26
|
+
# @status is an Svnx::Action
|
27
|
+
@action = @status
|
28
|
+
end
|
43
29
|
|
44
|
-
|
45
|
-
|
46
|
-
|
30
|
+
def set_from_element elmt
|
31
|
+
set_attr_var elmt, 'path'
|
32
|
+
|
33
|
+
wcstatus = elmt.elements['wc-status']
|
34
|
+
@status = Svnx::Action.new(wcstatus.attributes['item'])
|
35
|
+
@status_revision = wcstatus.attributes['revision']
|
36
|
+
|
37
|
+
commit = wcstatus.elements['commit']
|
38
|
+
@commit_revision = commit && commit.attributes['revision']
|
39
|
+
@name = @path.dup
|
40
|
+
|
41
|
+
if @rootpath
|
42
|
+
# name is prefixed with directory unless '.' is used as the argument
|
43
|
+
@name.sub! Regexp.new('^' + @rootpath), ''
|
44
|
+
end
|
47
45
|
end
|
48
|
-
end
|
49
46
|
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
def to_s
|
48
|
+
"path: #{@path}; status: #{@status}"
|
49
|
+
end
|
53
50
|
|
54
|
-
|
55
|
-
|
51
|
+
def <=> other
|
52
|
+
path <=> other.path
|
53
|
+
end
|
56
54
|
end
|
57
55
|
end
|
data/lib/svnx/status/options.rb
CHANGED
@@ -2,27 +2,24 @@
|
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
4
|
require 'svnx/util/objutil'
|
5
|
-
require 'svnx/base/options'
|
6
5
|
|
7
6
|
module Svnx
|
8
7
|
module Status
|
9
8
|
end
|
10
9
|
end
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
optargs << [ :url, @url ]
|
25
|
-
optargs << [ :paths, @paths ]
|
11
|
+
module Svnx::Status
|
12
|
+
class Options < Svnx::Base::Options
|
13
|
+
FIELDS = [ :revision, :url, :paths ]
|
14
|
+
|
15
|
+
has_fields FIELDS
|
16
|
+
|
17
|
+
def options_to_args
|
18
|
+
Array.new.tap do |a|
|
19
|
+
a << [ :revision, [ "-r", revision ] ]
|
20
|
+
a << [ :url, url ]
|
21
|
+
a << [ :paths, paths ]
|
22
|
+
end
|
26
23
|
end
|
27
24
|
end
|
28
25
|
end
|
data/lib/svnx/update/command.rb
CHANGED
data/lib/svnx/update/options.rb
CHANGED
@@ -8,18 +8,17 @@ module Svnx
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
optargs << [ :paths, paths ]
|
11
|
+
module Svnx::Update
|
12
|
+
class Options < Svnx::Base::Options
|
13
|
+
FIELDS = [ :revision, :paths ]
|
14
|
+
|
15
|
+
has_fields FIELDS
|
16
|
+
|
17
|
+
def options_to_args
|
18
|
+
Array.new.tap do |a|
|
19
|
+
a << [ :revision, [ "-r", revision ] ]
|
20
|
+
a << [ :paths, paths ]
|
21
|
+
end
|
23
22
|
end
|
24
23
|
end
|
25
24
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/ruby -w
|
2
|
+
# -*- ruby -*-
|
3
|
+
|
4
|
+
module ClassUtil
|
5
|
+
module Util
|
6
|
+
def module_elements cls
|
7
|
+
mods = cls.name.split "::"
|
8
|
+
mods[0 .. -2]
|
9
|
+
end
|
10
|
+
|
11
|
+
def find_module cls
|
12
|
+
mod = module_elements(cls) * "::"
|
13
|
+
Kernel.const_get mod
|
14
|
+
end
|
15
|
+
|
16
|
+
module_function :module_elements
|
17
|
+
module_function :find_module
|
18
|
+
end
|
19
|
+
end
|
data/lib/svnx/util/dateutil.rb
CHANGED
data/lib/svnx/util/objutil.rb
CHANGED
@@ -2,13 +2,43 @@
|
|
2
2
|
# -*- ruby -*-
|
3
3
|
|
4
4
|
module Svnx
|
5
|
-
|
5
|
+
module ObjectUtil
|
6
|
+
# shortcut for "@var = args[:var]", for multiple variable names, which are symbols.
|
7
|
+
def assign args, symbols = Array.new
|
8
|
+
symbols.each do |symbol|
|
9
|
+
instance_variable_set "@" + symbol.to_s, args[symbol]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def validate args, valid = Array.new
|
14
|
+
invalid = args.keys.reject do |field|
|
15
|
+
valid.include? field
|
16
|
+
end
|
17
|
+
|
18
|
+
unless invalid.empty?
|
19
|
+
raise "invalid fields for #{self.class}: #{invalid.join(' ')}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
module ClassMethods
|
24
|
+
def attr_readers symbols = Array.new
|
25
|
+
attr_reader(*symbols)
|
26
|
+
end
|
27
|
+
|
28
|
+
def has_fields fields
|
29
|
+
attr_reader(*fields)
|
30
|
+
|
31
|
+
define_method :initialize do |args|
|
32
|
+
assign args, fields
|
33
|
+
validate args, fields
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
extend ClassMethods
|
6
39
|
|
7
|
-
|
8
|
-
|
9
|
-
def assign args, *symbols
|
10
|
-
symbols.each do |symbol|
|
11
|
-
instance_variable_set "@" + symbol.to_s, args[symbol]
|
40
|
+
def self.included other
|
41
|
+
other.extend ClassMethods
|
12
42
|
end
|
13
43
|
end
|
14
44
|
end
|
data/lib/svnx/version.rb
CHANGED
data/repackage
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rake && rm -rf pkg/svnx-2.0.8* && rake build && sudo gem uni svnx && sudo gem i ./pkg/svnx-2.0.8.gem
|
data/svnx.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
lib = File.expand_path
|
3
|
-
$LOAD_PATH.unshift
|
2
|
+
lib = File.expand_path '../lib', __FILE__
|
3
|
+
$LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
|
4
4
|
require 'svnx/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
@@ -16,19 +16,20 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
-
if spec.respond_to?
|
19
|
+
if spec.respond_to? :metadata
|
20
20
|
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
21
21
|
else
|
22
22
|
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
23
|
end
|
24
24
|
|
25
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match %r{^(test|spec|features)/} }
|
26
26
|
spec.bindir = "exe"
|
27
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename f }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.12"
|
31
31
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
32
|
spec.add_development_dependency "logue", "~> 1.0.6"
|
33
33
|
spec.add_development_dependency "test-unit", "~> 3.1.5"
|
34
|
+
spec.add_development_dependency "paramesan"
|
34
35
|
end
|
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.0
|
4
|
+
version: 2.1.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: 2017-
|
11
|
+
date: 2017-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 3.1.5
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: paramesan
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Bridges the Subversion command line, returning Ruby objects.
|
70
84
|
email:
|
71
85
|
- jeugenepace@gmail.com
|
@@ -75,6 +89,7 @@ extra_rdoc_files: []
|
|
75
89
|
files:
|
76
90
|
- ".gitignore"
|
77
91
|
- ".glarkrc"
|
92
|
+
- ".zshrc"
|
78
93
|
- Features.txt
|
79
94
|
- Gemfile
|
80
95
|
- History.txt
|
@@ -82,9 +97,18 @@ files:
|
|
82
97
|
- Manifest.txt
|
83
98
|
- README.md
|
84
99
|
- Rakefile
|
100
|
+
- lib/cmdline/arg.rb
|
101
|
+
- lib/cmdline/cachefile.rb
|
102
|
+
- lib/cmdline/caching.rb
|
103
|
+
- lib/cmdline/filename.rb
|
104
|
+
- lib/cmdline/gzpathname.rb
|
105
|
+
- lib/cmdline/line.rb
|
85
106
|
- lib/svnx/base/action.rb
|
107
|
+
- lib/svnx/base/action_status.rb
|
108
|
+
- lib/svnx/base/cmd.rb
|
86
109
|
- lib/svnx/base/cmdline.rb
|
87
110
|
- lib/svnx/base/command.rb
|
111
|
+
- lib/svnx/base/command_factory.rb
|
88
112
|
- lib/svnx/base/entries.rb
|
89
113
|
- lib/svnx/base/entry.rb
|
90
114
|
- lib/svnx/base/env.rb
|
@@ -106,6 +130,7 @@ files:
|
|
106
130
|
- lib/svnx/log/command.rb
|
107
131
|
- lib/svnx/log/entries.rb
|
108
132
|
- lib/svnx/log/entry.rb
|
133
|
+
- lib/svnx/log/entrypath.rb
|
109
134
|
- lib/svnx/log/options.rb
|
110
135
|
- lib/svnx/merge/command.rb
|
111
136
|
- lib/svnx/merge/options.rb
|
@@ -127,13 +152,11 @@ files:
|
|
127
152
|
- lib/svnx/status/options.rb
|
128
153
|
- lib/svnx/update/command.rb
|
129
154
|
- lib/svnx/update/options.rb
|
155
|
+
- lib/svnx/util/classutil.rb
|
130
156
|
- lib/svnx/util/dateutil.rb
|
131
157
|
- lib/svnx/util/objutil.rb
|
132
158
|
- lib/svnx/version.rb
|
133
|
-
-
|
134
|
-
- lib/system/command/cachefile.rb
|
135
|
-
- lib/system/command/caching.rb
|
136
|
-
- lib/system/command/line.rb
|
159
|
+
- repackage
|
137
160
|
- svnx.gemspec
|
138
161
|
homepage: https://github.com/jpace/svnx
|
139
162
|
licenses:
|