10 Util.set_constants(Ext::Wc, self)
11 Util.set_methods(Ext::Wc, self)
12 self.swig_init_asp_dot_net_hack()
14 @@alias_targets = %w(parse_externals_description
17 @@alias_targets.each do |target|
18 alias_method "_#{target}", target
21 @@alias_targets.each do |target|
22 alias_method "_#{target}", target
32 AdmAccess.ensure(*args)
35 # For backward compatibility
36 def parse_externals_description(*args)
37 ExternalsDescription.parse(*args)
40 def actual_target(path)
41 Wc.get_actual_target(path)
44 def normal_prop?(name)
45 Wc.is_normal_prop(name)
53 Wc.is_entry_prop(name)
56 def pristine_copy_path(path)
57 Wc.get_pristine_copy_path(path)
60 def default_ignores(config)
61 Wc.get_default_ignores(config)
64 def cleanup(path, diff3_cmd=nil, cancel_func=nil)
65 Wc.cleanup2(path, diff3_cmd, cancel_func)
68 def ignore?(path, patterns)
69 Wc.match_ignore_list(path, patterns)
72 module ExternalsDescription
74 def parse(parent_dir, desc, canonicalize_url=true)
75 Wc.parse_externals_description3(parent_dir, desc, canonicalize_url)
85 AdmAccess = SWIG::TYPE_p_svn_wc_adm_access_t
88 def ensure(path, uuid, url, repos, revision, depth=nil)
89 Wc.ensure_adm3(path, uuid, url, repos, revision, depth)
92 def open(associated, path, write_lock=true,
93 depth=-1, cancel_func=nil, &block)
94 _open(:adm_open3, associated, path, write_lock,
95 depth, cancel_func, &block)
98 def probe_open(associated, path, write_lock=true, depth=-1,
99 cancel_func=nil, &block)
100 _open(:adm_probe_open3, associated, path, write_lock,
101 depth, cancel_func, &block)
104 def open_anchor(path, write_lock=true, depth=-1,
105 cancel_func=nil, &block)
106 _open(:adm_open_anchor, path, write_lock, depth,
111 def _open(name, *args, &block)
112 results = Wc.__send__(name, *args, &block)
127 attr_accessor :traversal_info
129 def open(*args, &block)
130 self.class.open(self, *args, &block)
133 def probe_open(*args, &block)
134 self.class.probe_open(self, *args, &block)
138 Wc.adm_retrieve(self, path)
141 def probe_retrieve(path)
142 Wc.adm_probe_retrieve(self, path)
145 def probe_try(path, write_lock, depth, &cancel_func)
146 Wc.adm_probe_try3(self, path, write_lock, depth, cancel_func)
154 Wc.adm_access_path(self)
161 def has_binary_prop?(path)
162 Wc.has_binary_prop(path, self)
165 def text_modified?(filename, force=false)
166 Wc.text_modified_p(filename, force, self)
169 def props_modified?(path)
170 Wc.props_modified_p(path, self)
173 def entry(path, show_hidden=false)
174 Entry.new(path, self, show_hidden, Svn::Core::Pool.new)
177 def read_entries(show_hidden=false)
178 Wc.entries_read(self, show_hidden, Svn::Core::Pool.new)
182 Wc.get_ancestry(path, self)
185 def walk_entries(path, callbacks, show_hidden=false, cancel_func=nil,
187 Wc.walk_entries3(path, self, callbacks, depth, show_hidden,
191 def mark_missing_deleted(path)
192 Wc.mark_missing_deleted(path, self)
195 def maybe_set_repos_root(path, repos)
196 Wc.maybe_set_repos_root(self, path, repos)
200 Wc.status2(path, self)
203 def status_editor(target, config, recurse=true,
204 get_all=true, no_ignore=true,
205 cancel_func=nil, traversal_info=nil)
206 traversal_info ||= _traversal_info
207 status_func = Proc.new do |path, status|
210 ret = Wc.get_status_editor2(self, target, config, recurse,
211 get_all, no_ignore, status_func,
212 cancel_func, traversal_info)
213 editor, editor_baton, set_lock_baton = *ret
214 editor.instance_variable_set("@__status_fun__", status_func)
215 editor.baton = editor_baton
216 def set_lock_baton.set_repos_locks(locks, repos_root)
217 Wc.status_set_repos_locks(self, locks, repos_root)
219 [editor, set_lock_baton]
222 def copy(src, dst_basename, cancel_func=nil, notify_func=nil)
223 Wc.copy2(src, self, dst_basename, cancel_func, notify_func)
226 def delete(path, cancel_func=nil, notify_func=nil, keep_local=false)
227 Wc.delete3(path, self, cancel_func, notify_func, keep_local)
230 def add(path, copyfrom_url=nil, copyfrom_rev=0,
231 cancel_func=nil, notify_func=nil)
232 Wc.add2(path, self, copyfrom_url, copyfrom_rev,
233 cancel_func, notify_func)
236 def add_repos_file(dst_path, new_text_path, new_props,
237 copyfrom_url=nil, copyfrom_rev=0)
238 Wc.add_repos_file(dst_path, self, new_text_path,
239 new_props, copyfrom_url, copyfrom_rev)
242 def add_repos_file2(dst_path, new_text_base_path, new_base_props,
243 new_text_path=nil, new_props=nil,
244 copyfrom_url=nil, copyfrom_rev=0)
245 Wc.add_repos_file2(dst_path, self,
246 new_text_base_path, new_text_path,
247 new_base_props, new_props,
248 copyfrom_url, copyfrom_rev)
251 def remove_from_revision_control(name, destroy_wf=true,
254 Wc.remove_from_revision_control(self, name,
260 def resolved_conflict(path, resolve_text=true,
261 resolve_props=true, recurse=true,
262 notify_func=nil, cancel_func=nil)
263 Wc.resolved_conflict2(path, self, resolve_text,
264 resolve_props, recurse,
265 notify_func, cancel_func)
268 def process_committed(path, new_revnum, rev_date=nil, rev_author=nil,
269 wcprop_changes=[], recurse=true,
270 remove_lock=true, digest=nil,
271 remove_changelist=false)
272 Wc.process_committed4(path, self, recurse,
273 new_revnum, rev_date,
274 rev_author, wcprop_changes,
275 remove_lock, remove_changelist, digest)
278 def crawl_revisions(path, reporter, restore_files=true,
279 depth=nil, use_commit_times=true,
280 notify_func=nil, traversal_info=nil)
281 traversal_info ||= _traversal_info
282 Wc.crawl_revisions3(path, self, reporter, reporter.baton,
283 restore_files, depth, use_commit_times,
284 notify_func, traversal_info)
288 Wc.is_wc_root(path, self)
291 def update_editor(target, target_revision=nil, use_commit_times=nil,
292 depth=nil, allow_unver_obstruction=nil, diff3_cmd=nil,
293 notify_func=nil, cancel_func=nil, traversal_info=nil,
295 update_editor2(:target => target,
296 :target_revision => target_revision,
297 :use_commit_times => use_commit_times,
299 :allow_unver_obstruction => allow_unver_obstruction,
300 :diff3_cmd => diff3_cmd,
301 :notify_func => notify_func,
302 :cancel_func => cancel_func,
303 :traversal_info => traversal_info,
304 :preserved_exts => preserved_exts )
307 UPDATE_EDITOR2_REQUIRED_ARGUMENTS_KEYS = [:target]
308 def update_editor2(arguments={})
309 arguments = arguments.reject {|k, v| v.nil?}
310 optional_arguments_defaults = {
311 :target_revision => nil,
312 :use_commit_times => true,
314 :depth_is_sticky => false,
315 :allow_unver_obstruction => false,
319 :conflict_func => nil,
320 :traversal_info => _traversal_info,
321 :preserved_exts => []
324 arguments = optional_arguments_defaults.merge(arguments)
325 Util.validate_options(arguments,
326 optional_arguments_defaults.keys,
327 UPDATE_EDITOR2_REQUIRED_ARGUMENTS_KEYS)
329 # TODO(rb support fetch_fun): implement support for the fetch_func
331 arguments[:fetch_func] = nil
333 results = Wc.get_update_editor3(arguments[:target_revision], self,
335 arguments[:use_commit_times],
337 arguments[:depth_is_sticky],
338 arguments[:allow_unver_obstruction],
339 arguments[:notify_func],
340 arguments[:cancel_func],
341 arguments[:conflict_func],
342 arguments[:fetch_func],
343 arguments[:diff3_cmd],
344 arguments[:preserved_exts],
345 arguments[:traversal_info])
346 target_revision_address, editor, editor_baton = results
347 editor.__send__(:target_revision_address=, target_revision_address)
348 editor.baton = editor_baton
352 def switch_editor(target, switch_url, target_revision=nil,
353 use_commit_times=nil, depth=nil,
354 allow_unver_obstruction=nil, diff3_cmd=nil,
355 notify_func=nil, cancel_func=nil, traversal_info=nil,
357 switch_editor2(:target => target,
358 :switch_url => switch_url,
359 :target_revision => target_revision,
360 :use_commit_times => use_commit_times,
362 :allow_unver_obstruction => allow_unver_obstruction,
363 :diff3_cmd => diff3_cmd,
364 :notify_func => notify_func,
365 :cancel_func => cancel_func,
366 :traversal_info => traversal_info,
367 :preserved_exts => preserved_exts )
370 SWITCH_EDITOR2_REQUIRED_ARGUMENTS_KEYS = [:target, :switch_url]
371 def switch_editor2(arguments={})
372 arguments = arguments.reject {|k, v| v.nil?}
373 optional_arguments_defaults = {
374 :target_revision => nil,
375 :use_commit_times => true,
377 :depth_is_sticky => false,
378 :allow_unver_obstruction => false,
382 :conflict_func => nil,
383 :traversal_info => _traversal_info,
384 :preserved_exts => []
386 arguments = optional_arguments_defaults.merge(arguments)
387 Util.validate_options(arguments,
388 optional_arguments_defaults.keys,
389 SWITCH_EDITOR2_REQUIRED_ARGUMENTS_KEYS)
391 results = Wc.get_switch_editor3(arguments[:target_revision], self,
393 arguments[:switch_url],
394 arguments[:use_commit_times],
396 arguments[:depth_is_sticky],
397 arguments[:allow_unver_obstruction],
398 arguments[:notify_func],
399 arguments[:cancel_func],
400 arguments[:conflict_func],
401 arguments[:diff3_cmd],
402 arguments[:preserved_exts],
403 arguments[:traversal_info])
404 target_revision_address, editor, editor_baton = results
405 editor.__send__(:target_revision_address=, target_revision_address)
406 editor.baton = editor_baton
411 Wc.prop_list(path, self)
415 Wc.prop_get(name, path, self)
418 def set_prop(name, value, path, skip_checks=false)
419 Wc.prop_set2(name, value, path, self, skip_checks)
422 def diff_editor(target, callbacks, depth=nil,
423 ignore_ancestry=true, use_text_base=false,
424 reverse_order=false, cancel_func=nil)
425 callbacks_wrapper = DiffCallbacksWrapper.new(callbacks)
426 args = [target, callbacks_wrapper, depth, ignore_ancestry,
427 use_text_base, reverse_order, cancel_func]
431 def diff_editor2(target, callbacks, depth=nil,
432 ignore_ancestry=true, use_text_base=false,
433 reverse_order=false, cancel_func=nil, changelists=nil)
434 editor, editor_baton = Wc.get_diff_editor4(self, target, callbacks,
435 depth, ignore_ancestry,
436 use_text_base, reverse_order,
437 cancel_func, changelists)
438 editor.baton = editor_baton
442 def diff(target, callbacks, recurse=true, ignore_ancestry=true)
443 callbacks_wrapper = DiffCallbacksWrapper.new(callbacks)
444 args = [target, callbacks_wrapper, recurse, ignore_ancestry]
448 def diff2(target, callbacks, recurse=true, ignore_ancestry=true)
449 Wc.diff3(self, target, callbacks, recurse, ignore_ancestry)
453 Wc.get_prop_diffs(path, self)
456 def merge(left, right, merge_target, left_label,
457 right_label, target_label, dry_run=false,
458 diff3_cmd=nil, merge_options=nil)
459 Wc.merge2(left, right, merge_target, self,
460 left_label, right_label, target_label,
461 dry_run, diff3_cmd, merge_options)
464 def merge_props(path, baseprops, propchanges, base_merge=true,
466 Wc.merge_props(path, self, baseprops, propchanges,
470 def merge_prop_diffs(path, propchanges, base_merge=true,
472 Wc.merge_prop_diffs(path, self, propchanges,
476 def relocate(path, from, to, recurse=true, old_validator=nil, &validator)
477 if validator.nil? and !old_validator.nil?
478 validator = Proc.new do |uuid, url, root_url|
479 old_validator.call(uuid,
480 root_url ? root_url : url,
481 root_url ? true : false)
484 Wc.relocate3(path, self, from, to, recurse, validator)
487 def revert(path, recurse=true, use_commit_times=true,
488 cancel_func=nil, notify_func=nil)
489 Wc.revert2(path, self, recurse, use_commit_times,
490 cancel_func, notify_func)
493 def translated_file(src, versioned_file, flags)
494 temp = Wc.translated_file2(src, versioned_file, self, flags)
497 path.instance_variable_set("@__temp__", temp)
501 def translated_file2(src, versioned_file, flags)
502 Wc.translated_file2(src, versioned_file, self, flags)
505 def translated_stream(path, versioned_file, flags)
506 Wc.translated_stream(path, versioned_file, self, flags)
509 def transmit_text_deltas(path, editor, file_baton, fulltext=false)
510 editor.baton = file_baton
511 Wc.transmit_text_deltas(path, self, fulltext, editor)
514 def transmit_text_deltas2(path, editor, fulltext=false)
515 Wc.transmit_text_deltas2(path, self, fulltext, editor)
518 def transmit_prop_deltas(path, entry, editor, baton=nil)
519 editor.baton = baton if baton
520 Wc.transmit_prop_deltas(path, self, entry, editor)
524 Wc.get_ignores(config, self)
527 def add_lock(path, lock)
528 Wc.add_lock(path, lock, self)
531 def remove_lock(path)
532 Wc.remove_lock(path, self)
535 def set_changelist(path, changelist_name, cancel_func=nil,
537 Wc.set_changelist(path, changelist_name, self, cancel_func,
543 @traversal_info ||= nil
547 class DiffCallbacksWrapper
548 def initialize(original)
552 def file_changed(access, path, tmpfile1, tmpfile2, rev1,
553 rev2, mimetype1, mimetype2,
554 prop_changes, original_props)
555 prop_changes = Util.hash_to_prop_array(prop_changes)
556 @original.file_changed(access, path, tmpfile1, tmpfile2, rev1,
557 rev2, mimetype1, mimetype2,
558 prop_changes, original_props)
561 def file_added(access, path, tmpfile1, tmpfile2, rev1,
562 rev2, mimetype1, mimetype2,
563 prop_changes, original_props)
564 prop_changes = Util.hash_to_prop_array(prop_changes)
565 @original.file_added(access, path, tmpfile1, tmpfile2, rev1,
566 rev2, mimetype1, mimetype2,
567 prop_changes, original_props)
570 def dir_props_changed(access, path, prop_changes, original_props)
571 prop_changes = Util.hash_to_prop_array(prop_changes)
572 @original.dir_props_changed(access, path, prop_changes, original_props)
575 def method_missing(method, *args, &block)
576 @original.__send__(method, *args, &block)
582 Wc.edited_externals(self)
588 Wc.entry_dup(self, Svn::Core::Pool.new)
591 def conflicted(dir_path)
592 Wc.conflicted_p(dir_path, self)
595 def conflicted?(dir_path)
596 conflicted(dir_path).any? {|x| x}
599 def text_conflicted?(dir_path)
600 conflicted(dir_path)[0]
603 def prop_conflicted?(dir_path)
604 conflicted(dir_path)[1]
608 kind == Core::NODE_DIR
612 kind == Core::NODE_FILE
616 schedule == SCHEDULE_ADD
620 schedule == SCHEDULE_NORMAL
626 Wc.dup_status2(self, Core::Pool.new)
630 text_status == STATUS_ADDED
634 text_status == STATUS_NORMAL
640 Wc.dup_notify(self, Core::Pool.new)
644 action == NOTIFY_COMMIT_ADDED
648 action == NOTIFY_COMMIT_DELETED
651 def commit_postfix_txdelta?
652 action == NOTIFY_COMMIT_POSTFIX_TXDELTA
660 lock_state = NOTIFY_LOCK_STATE_LOCKED
664 lock_state = NOTIFY_LOCK_STATE_UNLOCKED
669 alias _initialize initialize
670 def initialize(wc_path, trail_url, committed, cancel_func=nil)
671 _initialize(wc_path, trail_url, committed, cancel_func)
676 def push(access, path, recurse=true, wcprop_changes={}, remove_lock=true,
677 remove_changelist=false, digest=nil)
678 Wc.queue_committed(self, path, access, recurse, wcprop_changes,
679 remove_lock, remove_changelist, digest)
683 def process(access, new_rev, rev_date=nil, rev_author=nil)
684 rev_date = rev_date.to_svn_format if rev_date.is_a?(Time)
685 Wc.process_committed_queue(self, access, new_rev, rev_date, rev_author)