subversion 1.6.6-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/licenses/apr/LICENSE +341 -0
- data/licenses/apr/NOTICE +15 -0
- data/licenses/apr-util/LICENSE +443 -0
- data/licenses/apr-util/NOTICE +14 -0
- data/licenses/bdb/LICENSE +102 -0
- data/licenses/cyrus-sasl/COPYING +44 -0
- data/licenses/neon/COPYING.LIB +482 -0
- data/licenses/openssl/LICENSE +127 -0
- data/licenses/serf/LICENSE +201 -0
- data/licenses/svn/COPYING +57 -0
- data/licenses/zlib/README +125 -0
- data/ruby/ext/svn/ext/client.dll +0 -0
- data/ruby/ext/svn/ext/core.dll +0 -0
- data/ruby/ext/svn/ext/delta.dll +0 -0
- data/ruby/ext/svn/ext/fs.dll +0 -0
- data/ruby/ext/svn/ext/intl3_svn.dll +0 -0
- data/ruby/ext/svn/ext/libapr-1.dll +0 -0
- data/ruby/ext/svn/ext/libaprutil-1.dll +0 -0
- data/ruby/ext/svn/ext/libdb44.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_client-1.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_delta-1.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_diff-1.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_fs-1.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_ra-1.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_repos-1.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_subr-1.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_swig_ruby-1.dll +0 -0
- data/ruby/ext/svn/ext/libsvn_wc-1.dll +0 -0
- data/ruby/ext/svn/ext/ra.dll +0 -0
- data/ruby/ext/svn/ext/repos.dll +0 -0
- data/ruby/ext/svn/ext/wc.dll +0 -0
- data/ruby/lib/svn/client.rb +771 -0
- data/ruby/lib/svn/core.rb +817 -0
- data/ruby/lib/svn/delta.rb +503 -0
- data/ruby/lib/svn/error.rb +74 -0
- data/ruby/lib/svn/fs.rb +628 -0
- data/ruby/lib/svn/info.rb +321 -0
- data/ruby/lib/svn/ra.rb +353 -0
- data/ruby/lib/svn/repos.rb +472 -0
- data/ruby/lib/svn/util.rb +129 -0
- data/ruby/lib/svn/wc.rb +689 -0
- metadata +96 -0
@@ -0,0 +1,321 @@
|
|
1
|
+
require "English"
|
2
|
+
require "time"
|
3
|
+
require "digest/sha2"
|
4
|
+
require "tempfile"
|
5
|
+
|
6
|
+
require "nkf"
|
7
|
+
begin
|
8
|
+
require "uconv"
|
9
|
+
rescue LoadError
|
10
|
+
module Uconv
|
11
|
+
class Error < StandardError
|
12
|
+
end
|
13
|
+
def self.u8toeuc(str)
|
14
|
+
raise Error
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
require "svn/core"
|
20
|
+
require "svn/repos"
|
21
|
+
require "svn/fs"
|
22
|
+
require "svn/delta"
|
23
|
+
|
24
|
+
module Svn
|
25
|
+
class Info
|
26
|
+
|
27
|
+
attr_reader :author, :log, :date, :changed_dirs
|
28
|
+
attr_reader :added_files, :deleted_files, :updated_files, :copied_files
|
29
|
+
attr_reader :added_dirs, :deleted_dirs, :updated_dirs, :copied_dirs
|
30
|
+
attr_reader :path, :revision, :diffs
|
31
|
+
attr_reader :sha256, :entire_sha256
|
32
|
+
|
33
|
+
def initialize(path, rev)
|
34
|
+
setup(path, rev)
|
35
|
+
get_info
|
36
|
+
get_dirs_changed
|
37
|
+
get_changed
|
38
|
+
get_diff
|
39
|
+
get_sha256
|
40
|
+
teardown
|
41
|
+
end
|
42
|
+
|
43
|
+
def paths
|
44
|
+
files + directories
|
45
|
+
end
|
46
|
+
|
47
|
+
def files
|
48
|
+
@added_files + @deleted_files + @updated_files + @copied_files
|
49
|
+
end
|
50
|
+
|
51
|
+
def directories
|
52
|
+
@added_dirs + @deleted_dirs + @updated_dirs + @copied_dirs
|
53
|
+
end
|
54
|
+
|
55
|
+
def sub_paths(prefix)
|
56
|
+
prefixes = prefix.split(/\/+/)
|
57
|
+
results = []
|
58
|
+
paths.each do |path,|
|
59
|
+
paths = path.split(/\/+/)
|
60
|
+
if prefixes.size < paths.size and prefixes == paths[0, prefixes.size]
|
61
|
+
results << paths[prefixes.size]
|
62
|
+
end
|
63
|
+
end
|
64
|
+
results
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
def setup(path, rev)
|
69
|
+
@path = path
|
70
|
+
@revision = Integer(rev)
|
71
|
+
@prev_rev = @revision - 1
|
72
|
+
@repos = Repos.open(@path)
|
73
|
+
@fs = @repos.fs
|
74
|
+
@root = @fs.root(@revision)
|
75
|
+
end
|
76
|
+
|
77
|
+
def teardown
|
78
|
+
@repos.close
|
79
|
+
@repos = @root = @fs = nil
|
80
|
+
end
|
81
|
+
|
82
|
+
def get_info
|
83
|
+
@author = force_to_utf8(prop(Core::PROP_REVISION_AUTHOR))
|
84
|
+
@date = prop(Core::PROP_REVISION_DATE)
|
85
|
+
@log = force_to_utf8(prop(Core::PROP_REVISION_LOG))
|
86
|
+
end
|
87
|
+
|
88
|
+
def get_dirs_changed
|
89
|
+
editor = traverse(Delta::ChangedDirsEditor)
|
90
|
+
@changed_dirs = editor.changed_dirs
|
91
|
+
end
|
92
|
+
|
93
|
+
def get_changed
|
94
|
+
editor = traverse(Delta::ChangedEditor, true)
|
95
|
+
@copied_files = editor.copied_files
|
96
|
+
@copied_dirs = editor.copied_dirs
|
97
|
+
@added_files = editor.added_files
|
98
|
+
@added_dirs = editor.added_dirs
|
99
|
+
@deleted_files = editor.deleted_files
|
100
|
+
@deleted_dirs = editor.deleted_dirs
|
101
|
+
@updated_files = editor.updated_files
|
102
|
+
@updated_dirs = editor.updated_dirs
|
103
|
+
end
|
104
|
+
|
105
|
+
def get_diff
|
106
|
+
tree = @repos.delta_tree(@root, @prev_rev)
|
107
|
+
@diffs = {}
|
108
|
+
get_diff_recurse(tree, @fs.root(@prev_rev), "", "")
|
109
|
+
@diffs.each do |key, values|
|
110
|
+
values.each do |type, diff|
|
111
|
+
diff.body = force_to_utf8(diff.body)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
TYPE_TABLE = [
|
117
|
+
[:copy?, :copied],
|
118
|
+
[:add?, :added],
|
119
|
+
[:delete?, :deleted],
|
120
|
+
[:replace?, :modified],
|
121
|
+
]
|
122
|
+
|
123
|
+
def get_type(node)
|
124
|
+
TYPE_TABLE.each do |meth, type|
|
125
|
+
return type if node.__send__(meth)
|
126
|
+
end
|
127
|
+
nil
|
128
|
+
end
|
129
|
+
|
130
|
+
def get_diff_recurse(node, base_root, path, base_path)
|
131
|
+
if node.copy?
|
132
|
+
base_path = node.copyfrom_path.sub(/\A\//, '')
|
133
|
+
base_root = base_root.fs.root(node.copyfrom_rev)
|
134
|
+
end
|
135
|
+
|
136
|
+
if node.file?
|
137
|
+
try_diff(node, base_root, path, base_path)
|
138
|
+
end
|
139
|
+
|
140
|
+
if node.prop_mod? and !node.delete?
|
141
|
+
get_prop_diff(node, base_root, path, base_path)
|
142
|
+
end
|
143
|
+
|
144
|
+
node = node.child
|
145
|
+
if node
|
146
|
+
get_diff_recurse(node, base_root,
|
147
|
+
"#{path}/#{node.name}",
|
148
|
+
"#{base_path}/#{node.name}")
|
149
|
+
while node.sibling
|
150
|
+
node = node.sibling
|
151
|
+
get_diff_recurse(node, base_root,
|
152
|
+
"#{path}/#{node.name}",
|
153
|
+
"#{base_path}/#{node.name}")
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def get_prop_diff(node, base_root, path, base_path)
|
159
|
+
local_props = @root.node_prop_list(path)
|
160
|
+
if node.add?
|
161
|
+
base_props = {}
|
162
|
+
else
|
163
|
+
base_props = base_root.node_prop_list(base_path)
|
164
|
+
end
|
165
|
+
prop_changes = Core::Property.diffs2(local_props, base_props)
|
166
|
+
prop_changes.each do |name, value|
|
167
|
+
entry = diff_entry(path, :property_changed)
|
168
|
+
entry.body << "Name: #{force_to_utf8(name)}\n"
|
169
|
+
orig_value = base_props[name]
|
170
|
+
entry.body << " - #{force_to_utf8(orig_value)}\n" if orig_value
|
171
|
+
entry.body << " + #{force_to_utf8(value)}\n" if value
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def try_diff(node, base_root, path, base_path)
|
176
|
+
if node.replace? and node.text_mod?
|
177
|
+
differ = Fs::FileDiff.new(base_root, base_path, @root, path)
|
178
|
+
do_diff(node, base_root, path, base_path, differ)
|
179
|
+
elsif node.add? and node.text_mod?
|
180
|
+
differ = Fs::FileDiff.new(nil, base_path, @root, path)
|
181
|
+
do_diff(node, base_root, path, base_path, differ)
|
182
|
+
elsif node.delete?
|
183
|
+
differ = Fs::FileDiff.new(base_root, base_path, nil, path)
|
184
|
+
do_diff(node, base_root, path, base_path, differ)
|
185
|
+
elsif node.copy?
|
186
|
+
diff_entry(path, get_type(node))
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
def do_diff(node, base_root, path, base_path, differ)
|
191
|
+
entry = diff_entry(path, get_type(node))
|
192
|
+
|
193
|
+
if differ.binary?
|
194
|
+
entry.body = "(Binary files differ)\n"
|
195
|
+
else
|
196
|
+
base_rev = base_root.revision
|
197
|
+
rev = @root.revision
|
198
|
+
base_date = base_root.fs.prop(Core::PROP_REVISION_DATE, base_rev)
|
199
|
+
date = @root.fs.prop(Core::PROP_REVISION_DATE, rev)
|
200
|
+
base_date = format_date(base_date)
|
201
|
+
date = format_date(date)
|
202
|
+
stripped_base_path = base_path.sub(/\A\//, '')
|
203
|
+
stripped_path = path.sub(/\A\//, '')
|
204
|
+
base_label = "#{stripped_base_path}\t#{base_date} (rev #{base_rev})"
|
205
|
+
label = "#{stripped_path}\t#{date} (rev #{rev})"
|
206
|
+
entry.body = differ.unified(base_label, label, "UTF-8")
|
207
|
+
parse_diff_unified(entry)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
def parse_diff_unified(entry)
|
212
|
+
in_content = false
|
213
|
+
entry.body.each do |line|
|
214
|
+
case line
|
215
|
+
when /^@@/
|
216
|
+
in_content = true
|
217
|
+
else
|
218
|
+
if in_content
|
219
|
+
case line
|
220
|
+
when /^\+/
|
221
|
+
entry.count_up_added_line!
|
222
|
+
when /^-/
|
223
|
+
entry.count_up_deleted_line!
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
def dump_contents(root, path)
|
231
|
+
root.file_contents(path) do |f|
|
232
|
+
if block_given?
|
233
|
+
yield f
|
234
|
+
else
|
235
|
+
f.read
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
def diff_entry(target, type)
|
241
|
+
target = target.sub(/\A\//, '')
|
242
|
+
@diffs[target] ||= {}
|
243
|
+
@diffs[target][type] ||= DiffEntry.new(type)
|
244
|
+
@diffs[target][type]
|
245
|
+
end
|
246
|
+
|
247
|
+
def get_sha256
|
248
|
+
sha = Digest::SHA256.new
|
249
|
+
@sha256 = {}
|
250
|
+
[
|
251
|
+
@added_files,
|
252
|
+
# @deleted_files,
|
253
|
+
@updated_files,
|
254
|
+
].each do |files|
|
255
|
+
files.each do |file|
|
256
|
+
content = dump_contents(@root, file)
|
257
|
+
sha << content
|
258
|
+
@sha256[file] = {
|
259
|
+
:file => file,
|
260
|
+
:revision => @revision,
|
261
|
+
:sha256 => Digest::SHA256.hexdigest(content),
|
262
|
+
}
|
263
|
+
end
|
264
|
+
end
|
265
|
+
@entire_sha256 = sha.hexdigest
|
266
|
+
end
|
267
|
+
|
268
|
+
def prop(name)
|
269
|
+
@fs.prop(name, @revision)
|
270
|
+
end
|
271
|
+
|
272
|
+
def force_to_utf8(str)
|
273
|
+
str = str.to_s
|
274
|
+
begin
|
275
|
+
# check UTF-8 or not
|
276
|
+
Uconv.u8toeuc(str)
|
277
|
+
str
|
278
|
+
rescue Uconv::Error
|
279
|
+
NKF.nkf("-w", str)
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
def traverse(editor_class, pass_root=false)
|
284
|
+
base_rev = @prev_rev
|
285
|
+
base_root = @fs.root(base_rev)
|
286
|
+
if pass_root
|
287
|
+
editor = editor_class.new(@root, base_root)
|
288
|
+
else
|
289
|
+
editor = editor_class.new
|
290
|
+
end
|
291
|
+
base_root.dir_delta("", "", @root, "", editor)
|
292
|
+
editor
|
293
|
+
end
|
294
|
+
|
295
|
+
def format_date(date)
|
296
|
+
formatted = date.strftime("%Y-%m-%d %H:%M:%S")
|
297
|
+
formatted << (" %+03d:00" % (date.hour - date.getutc.hour))
|
298
|
+
formatted
|
299
|
+
end
|
300
|
+
|
301
|
+
class DiffEntry
|
302
|
+
attr_reader :type, :added_line, :deleted_line
|
303
|
+
attr_accessor :body
|
304
|
+
|
305
|
+
def initialize(type)
|
306
|
+
@type = type
|
307
|
+
@added_line = 0
|
308
|
+
@deleted_line = 0
|
309
|
+
@body = ""
|
310
|
+
end
|
311
|
+
|
312
|
+
def count_up_added_line!
|
313
|
+
@added_line += 1
|
314
|
+
end
|
315
|
+
|
316
|
+
def count_up_deleted_line!
|
317
|
+
@deleted_line += 1
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
data/ruby/lib/svn/ra.rb
ADDED
@@ -0,0 +1,353 @@
|
|
1
|
+
require "English"
|
2
|
+
require "tempfile"
|
3
|
+
require "svn/error"
|
4
|
+
require "svn/util"
|
5
|
+
require "svn/core"
|
6
|
+
require "svn/repos"
|
7
|
+
require "svn/ext/ra"
|
8
|
+
|
9
|
+
module Svn
|
10
|
+
module Ra
|
11
|
+
Util.set_constants(Ext::Ra, self)
|
12
|
+
Util.set_methods(Ext::Ra, self)
|
13
|
+
|
14
|
+
@@ra_pool = Svn::Core::Pool.new
|
15
|
+
Ra.initialize(@@ra_pool)
|
16
|
+
|
17
|
+
class << self
|
18
|
+
def modules
|
19
|
+
print_modules("")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Session = SWIG::TYPE_p_svn_ra_session_t
|
24
|
+
|
25
|
+
class Session
|
26
|
+
class << self
|
27
|
+
def open(url, config=nil, callbacks=nil)
|
28
|
+
pool = Core::Pool.new
|
29
|
+
session = Ra.open2(url, callbacks, config || Svn::Core::Config.get, pool)
|
30
|
+
session.instance_variable_set(:@pool, pool)
|
31
|
+
return session unless block_given?
|
32
|
+
begin
|
33
|
+
yield session
|
34
|
+
ensure
|
35
|
+
session.close
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def close
|
41
|
+
@pool.destroy
|
42
|
+
end
|
43
|
+
|
44
|
+
def latest_revnum
|
45
|
+
Ra.get_latest_revnum(self)
|
46
|
+
end
|
47
|
+
alias latest_revision latest_revnum
|
48
|
+
|
49
|
+
def dated_revision(time)
|
50
|
+
Ra.get_dated_revision(self, time.to_apr_time)
|
51
|
+
end
|
52
|
+
|
53
|
+
def set_prop(name, value, rev=nil)
|
54
|
+
Ra.change_rev_prop(self, rev || latest_revnum, name, value)
|
55
|
+
end
|
56
|
+
|
57
|
+
def []=(name, *args)
|
58
|
+
value = args.pop
|
59
|
+
set_prop(name, value, *args)
|
60
|
+
value
|
61
|
+
end
|
62
|
+
|
63
|
+
def proplist(rev=nil)
|
64
|
+
Ra.rev_proplist(self, rev || latest_revnum)
|
65
|
+
end
|
66
|
+
alias properties proplist
|
67
|
+
|
68
|
+
def prop(name, rev=nil)
|
69
|
+
Ra.rev_prop(self, rev || latest_revnum, name)
|
70
|
+
end
|
71
|
+
alias [] prop
|
72
|
+
|
73
|
+
def commit_editor(log_msg, lock_tokens={}, keep_lock=false)
|
74
|
+
callback = Proc.new do |new_revision, date, author|
|
75
|
+
yield(new_revision, date, author)
|
76
|
+
end
|
77
|
+
editor, editor_baton = Ra.get_commit_editor(self, log_msg, callback,
|
78
|
+
lock_tokens, keep_lock)
|
79
|
+
editor.baton = editor_baton
|
80
|
+
[editor, editor_baton]
|
81
|
+
end
|
82
|
+
|
83
|
+
def commit_editor2(log_msg_or_rev_props, lock_tokens={},
|
84
|
+
keep_lock=false, &callback)
|
85
|
+
if log_msg_or_rev_props.is_a?(Hash)
|
86
|
+
rev_props = log_msg_or_rev_props
|
87
|
+
else
|
88
|
+
rev_props = {Svn::Core::PROP_REVISION_LOG => log_msg_or_rev_props}
|
89
|
+
end
|
90
|
+
editor, editor_baton = Ra.get_commit_editor3(self, rev_props, callback,
|
91
|
+
lock_tokens, keep_lock)
|
92
|
+
editor.baton = editor_baton
|
93
|
+
editor
|
94
|
+
end
|
95
|
+
|
96
|
+
def file(path, rev=nil)
|
97
|
+
output = StringIO.new
|
98
|
+
rev ||= latest_revnum
|
99
|
+
fetched_rev, props = Ra.get_file(self, path, rev, output)
|
100
|
+
output.rewind
|
101
|
+
props_filter(props)
|
102
|
+
[output.read, props]
|
103
|
+
end
|
104
|
+
|
105
|
+
def dir(path, rev=nil, fields=nil)
|
106
|
+
rev ||= latest_revnum
|
107
|
+
fields ||= Core::DIRENT_ALL
|
108
|
+
entries, fetched_rev, props = Ra.get_dir2(self, path, rev, fields)
|
109
|
+
props_filter(props)
|
110
|
+
[entries, props]
|
111
|
+
end
|
112
|
+
|
113
|
+
def update(revision_to_update_to, update_target,
|
114
|
+
editor, editor_baton, depth=nil, &block)
|
115
|
+
editor.baton = editor_baton
|
116
|
+
update2(revision_to_update_to, update_target,
|
117
|
+
editor, depth, &block)
|
118
|
+
end
|
119
|
+
|
120
|
+
def update2(revision_to_update_to, update_target, editor, depth=nil,
|
121
|
+
send_copyfrom_args=nil)
|
122
|
+
reporter, reporter_baton = Ra.do_update2(self, revision_to_update_to,
|
123
|
+
update_target, depth,
|
124
|
+
send_copyfrom_args, editor)
|
125
|
+
reporter.baton = reporter_baton
|
126
|
+
if block_given?
|
127
|
+
yield(reporter)
|
128
|
+
reporter.finish_report
|
129
|
+
nil
|
130
|
+
else
|
131
|
+
reporter
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def switch(revision_to_switch_to, switch_target, switch_url,
|
136
|
+
editor, editor_baton, depth=nil, &block)
|
137
|
+
editor.baton = editor_baton
|
138
|
+
switch2(revision_to_switch_to, switch_target, switch_url,
|
139
|
+
editor, depth, &block)
|
140
|
+
end
|
141
|
+
|
142
|
+
def switch2(revision_to_switch_to, switch_target, switch_url,
|
143
|
+
editor, depth=nil)
|
144
|
+
reporter, reporter_baton = Ra.do_switch2(self, revision_to_switch_to,
|
145
|
+
switch_target, depth,
|
146
|
+
switch_url, editor)
|
147
|
+
reporter.baton = reporter_baton
|
148
|
+
if block_given?
|
149
|
+
yield(reporter)
|
150
|
+
reporter.finish_report
|
151
|
+
nil
|
152
|
+
else
|
153
|
+
reporter
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
def status(revision, status_target, editor, editor_baton,
|
158
|
+
recurse=true, &block)
|
159
|
+
editor.baton = editor_baton
|
160
|
+
status2(revision, status_target, editor, recurse, &block)
|
161
|
+
end
|
162
|
+
|
163
|
+
def status2(revision, status_target, editor, recurse=true)
|
164
|
+
reporter, reporter_baton = Ra.do_status2(self, status_target,
|
165
|
+
revision, recurse, editor)
|
166
|
+
reporter.baton = reporter_baton
|
167
|
+
if block_given?
|
168
|
+
yield(reporter)
|
169
|
+
reporter.finish_report
|
170
|
+
nil
|
171
|
+
else
|
172
|
+
reporter
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
def diff(rev, target, versus_url, editor,
|
177
|
+
depth=nil, ignore_ancestry=true, text_deltas=true)
|
178
|
+
args = [self, rev, target, depth, ignore_ancestry,
|
179
|
+
text_deltas, versus_url, editor]
|
180
|
+
reporter, baton = Ra.do_diff3(*args)
|
181
|
+
reporter.baton = baton
|
182
|
+
reporter
|
183
|
+
end
|
184
|
+
|
185
|
+
def log(paths, start_rev, end_rev, limit,
|
186
|
+
discover_changed_paths=true,
|
187
|
+
strict_node_history=false)
|
188
|
+
paths = [paths] unless paths.is_a?(Array)
|
189
|
+
receiver = Proc.new do |changed_paths, revision, author, date, message|
|
190
|
+
yield(changed_paths, revision, author, date, message)
|
191
|
+
end
|
192
|
+
Ra.get_log(self, paths, start_rev, end_rev, limit,
|
193
|
+
discover_changed_paths, strict_node_history,
|
194
|
+
receiver)
|
195
|
+
end
|
196
|
+
|
197
|
+
def check_path(path, rev=nil)
|
198
|
+
Ra.check_path(self, path, rev || latest_revnum)
|
199
|
+
end
|
200
|
+
|
201
|
+
def stat(path, rev=nil)
|
202
|
+
Ra.stat(self, path, rev || latest_revnum)
|
203
|
+
end
|
204
|
+
|
205
|
+
def uuid
|
206
|
+
Ra.get_uuid(self)
|
207
|
+
end
|
208
|
+
|
209
|
+
def repos_root
|
210
|
+
Ra.get_repos_root(self)
|
211
|
+
end
|
212
|
+
|
213
|
+
def locations(path, location_revisions, peg_revision=nil)
|
214
|
+
peg_revision ||= latest_revnum
|
215
|
+
Ra.get_locations(self, path, peg_revision, location_revisions)
|
216
|
+
end
|
217
|
+
|
218
|
+
def file_revs(path, start_rev, end_rev=nil)
|
219
|
+
args = [path, start_rev, end_rev]
|
220
|
+
if block_given?
|
221
|
+
revs = file_revs2(*args) do |path, rev, rev_props, prop_diffs|
|
222
|
+
yield(path, rev, rev_props, Util.hash_to_prop_array(prop_diffs))
|
223
|
+
end
|
224
|
+
else
|
225
|
+
revs = file_revs2(*args)
|
226
|
+
end
|
227
|
+
revs.collect do |path, rev, rev_props, prop_diffs|
|
228
|
+
[path, rev, rev_props, Util.hash_to_prop_array(prop_diffs)]
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
def file_revs2(path, start_rev, end_rev=nil)
|
233
|
+
end_rev ||= latest_revnum
|
234
|
+
revs = []
|
235
|
+
handler = Proc.new do |path, rev, rev_props, prop_diffs|
|
236
|
+
revs << [path, rev, rev_props, prop_diffs]
|
237
|
+
yield(path, rev, rev_props, prop_diffs) if block_given?
|
238
|
+
end
|
239
|
+
Ra.get_file_revs(self, path, start_rev, end_rev, handler)
|
240
|
+
revs
|
241
|
+
end
|
242
|
+
|
243
|
+
def lock(path_revs, comment=nil, steal_lock=false)
|
244
|
+
lock_func = Proc.new do |path, do_lock, lock, ra_err|
|
245
|
+
yield(path, do_lock, lock, ra_err)
|
246
|
+
end
|
247
|
+
Ra.lock(self, path_revs, comment, steal_lock, lock_func)
|
248
|
+
end
|
249
|
+
|
250
|
+
def unlock(path_tokens, break_lock=false, &lock_func)
|
251
|
+
Ra.unlock(self, path_tokens, break_lock, lock_func)
|
252
|
+
end
|
253
|
+
|
254
|
+
def get_lock(path)
|
255
|
+
Ra.get_lock(self, path)
|
256
|
+
end
|
257
|
+
|
258
|
+
def get_locks(path)
|
259
|
+
Ra.get_locks(self, path)
|
260
|
+
end
|
261
|
+
|
262
|
+
def replay(rev, low_water_mark, editor, send_deltas=true)
|
263
|
+
Ra.replay(self, rev, low_water_mark, send_deltas, editor)
|
264
|
+
end
|
265
|
+
|
266
|
+
def reparent(url)
|
267
|
+
Ra.reparent(self, url)
|
268
|
+
end
|
269
|
+
|
270
|
+
def mergeinfo(paths, revision=nil, inherit=nil, include_descendants=false)
|
271
|
+
paths = [paths] unless paths.is_a?(Array)
|
272
|
+
revision ||= Svn::Core::INVALID_REVNUM
|
273
|
+
info = Ra.get_mergeinfo(self, paths, revision, inherit,
|
274
|
+
include_descendants)
|
275
|
+
unless info.nil?
|
276
|
+
info.each_key do |key|
|
277
|
+
info[key] = Core::MergeInfo.new(info[key])
|
278
|
+
end
|
279
|
+
end
|
280
|
+
info
|
281
|
+
end
|
282
|
+
|
283
|
+
private
|
284
|
+
def props_filter(props)
|
285
|
+
date_str = props[Svn::Core::PROP_ENTRY_COMMITTED_DATE]
|
286
|
+
if date_str
|
287
|
+
date = Time.parse_svn_format(date_str)
|
288
|
+
props[Svn::Core::PROP_ENTRY_COMMITTED_DATE] = date
|
289
|
+
end
|
290
|
+
props
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
class Reporter3
|
295
|
+
attr_accessor :baton
|
296
|
+
def set_path(path, revision, depth=nil, start_empty=true,
|
297
|
+
lock_token=nil)
|
298
|
+
Ra.reporter3_invoke_set_path(self, @baton, path, revision,
|
299
|
+
depth, start_empty, lock_token)
|
300
|
+
end
|
301
|
+
|
302
|
+
def delete_path(path)
|
303
|
+
Ra.reporter3_invoke_delete_path(self, @baton, path)
|
304
|
+
end
|
305
|
+
|
306
|
+
def link_path(path, url, revision, depth=nil,
|
307
|
+
start_empty=true, lock_token=nil)
|
308
|
+
Ra.reporter3_invoke_link_path(self, @baton, path, url,
|
309
|
+
revision, depth, start_empty, lock_token)
|
310
|
+
end
|
311
|
+
|
312
|
+
def finish_report
|
313
|
+
Ra.reporter3_invoke_finish_report(self, @baton)
|
314
|
+
end
|
315
|
+
|
316
|
+
def abort_report
|
317
|
+
Ra.reporter3_invoke_abort_report(self, @baton)
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
remove_const(:Callbacks)
|
322
|
+
class Callbacks
|
323
|
+
include Core::Authenticatable
|
324
|
+
|
325
|
+
def initialize(auth_baton=nil)
|
326
|
+
self.auth_baton = auth_baton || Core::AuthBaton.new
|
327
|
+
end
|
328
|
+
|
329
|
+
def open_tmp_file
|
330
|
+
tmp = Tempfile.new("Svn::Ra")
|
331
|
+
path = tmp.path
|
332
|
+
tmp.close(true)
|
333
|
+
path
|
334
|
+
end
|
335
|
+
|
336
|
+
def get_wc_prop(relpath, name)
|
337
|
+
nil
|
338
|
+
end
|
339
|
+
|
340
|
+
def set_wc_prop(path, name, value)
|
341
|
+
end
|
342
|
+
|
343
|
+
def push_wc_prop(path, name, value)
|
344
|
+
end
|
345
|
+
|
346
|
+
def invalidate_wc_props(path, name)
|
347
|
+
end
|
348
|
+
|
349
|
+
def progress_func(progress, total)
|
350
|
+
end
|
351
|
+
end
|
352
|
+
end
|
353
|
+
end
|