This file is indexed.

/usr/lib/ruby/1.8/svn/wc.rb is in libsvn-ruby1.8 1.6.17dfsg-3ubuntu3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
require "English"
require "svn/error"
require "svn/util"
require "svn/core"
require "svn/delta"
require "svn/ext/wc"

module Svn
  module Wc
    Util.set_constants(Ext::Wc, self)
    Util.set_methods(Ext::Wc, self)
    self.swig_init_asp_dot_net_hack()

    @@alias_targets = %w(parse_externals_description
                         ensure_adm cleanup)
    class << self
      @@alias_targets.each do |target|
        alias_method "_#{target}", target
      end
    end
    @@alias_targets.each do |target|
      alias_method "_#{target}", target
    end
    @@alias_targets = nil

    module_function
    def locked?(path)
      Wc.locked(path)
    end

    def ensure_adm(*args)
      AdmAccess.ensure(*args)
    end

    # For backward compatibility
    def parse_externals_description(*args)
      ExternalsDescription.parse(*args)
    end

    def actual_target(path)
      Wc.get_actual_target(path)
    end

    def normal_prop?(name)
      Wc.is_normal_prop(name)
    end

    def wc_prop?(name)
      Wc.is_wc_prop(name)
    end

    def entry_prop?(name)
      Wc.is_entry_prop(name)
    end

    def pristine_copy_path(path)
      Wc.get_pristine_copy_path(path)
    end

    def default_ignores(config)
      Wc.get_default_ignores(config)
    end

    def cleanup(path, diff3_cmd=nil, cancel_func=nil)
      Wc.cleanup2(path, diff3_cmd, cancel_func)
    end

    def ignore?(path, patterns)
      Wc.match_ignore_list(path, patterns)
    end

    module ExternalsDescription
      module_function
      def parse(parent_dir, desc, canonicalize_url=true)
        Wc.parse_externals_description3(parent_dir, desc, canonicalize_url)
      end
    end

    class ExternalItem
      class << self
        undef new
      end
    end

    AdmAccess = SWIG::TYPE_p_svn_wc_adm_access_t
    class AdmAccess
      class << self
        def ensure(path, uuid, url, repos, revision, depth=nil)
          Wc.ensure_adm3(path, uuid, url, repos, revision, depth)
        end

        def open(associated, path, write_lock=true,
                 depth=-1, cancel_func=nil, &block)
          _open(:adm_open3, associated, path, write_lock,
                depth, cancel_func, &block)
        end

        def probe_open(associated, path, write_lock=true, depth=-1,
                       cancel_func=nil, &block)
          _open(:adm_probe_open3, associated, path, write_lock,
                depth, cancel_func, &block)
        end

        def open_anchor(path, write_lock=true, depth=-1,
                        cancel_func=nil, &block)
          _open(:adm_open_anchor, path, write_lock, depth,
                cancel_func, &block)
        end

        private
        def _open(name, *args, &block)
          results = Wc.__send__(name, *args, &block)
          adm, *rest = results

          if block_given?
            begin
              yield *results
            ensure
              adm.close
            end
          else
            results
          end
        end
      end

      attr_accessor :traversal_info

      def open(*args, &block)
        self.class.open(self, *args, &block)
      end

      def probe_open(*args, &block)
        self.class.probe_open(self, *args, &block)
      end

      def retrieve(path)
        Wc.adm_retrieve(self, path)
      end

      def probe_retrieve(path)
        Wc.adm_probe_retrieve(self, path)
      end

      def probe_try(path, write_lock, depth, &cancel_func)
        Wc.adm_probe_try3(self, path, write_lock, depth, cancel_func)
      end

      def close
        Wc.adm_close(self)
      end

      def path
        Wc.adm_access_path(self)
      end

      def locked?
        Wc.adm_locked(self)
      end

      def has_binary_prop?(path)
        Wc.has_binary_prop(path, self)
      end

      def text_modified?(filename, force=false)
        Wc.text_modified_p(filename, force, self)
      end

      def props_modified?(path)
        Wc.props_modified_p(path, self)
      end

      def entry(path, show_hidden=false)
        Entry.new(path, self, show_hidden, Svn::Core::Pool.new)
      end

      def read_entries(show_hidden=false)
        Wc.entries_read(self, show_hidden, Svn::Core::Pool.new)
      end

      def ancestry(path)
        Wc.get_ancestry(path, self)
      end

      def walk_entries(path, callbacks, show_hidden=false, cancel_func=nil,
                       depth=nil)
        Wc.walk_entries3(path, self, callbacks, depth, show_hidden,
                         cancel_func)
      end

      def mark_missing_deleted(path)
        Wc.mark_missing_deleted(path, self)
      end

      def maybe_set_repos_root(path, repos)
        Wc.maybe_set_repos_root(self, path, repos)
      end

      def status(path)
        Wc.status2(path, self)
      end

      def status_editor(target, config, recurse=true,
                        get_all=true, no_ignore=true,
                        cancel_func=nil, traversal_info=nil)
        traversal_info ||= _traversal_info
        status_func = Proc.new do |path, status|
          yield(path, status)
        end
        ret = Wc.get_status_editor2(self, target, config, recurse,
                                    get_all, no_ignore, status_func,
                                    cancel_func, traversal_info)
        editor, editor_baton, set_lock_baton = *ret
        editor.instance_variable_set("@__status_fun__", status_func)
        editor.baton = editor_baton
        def set_lock_baton.set_repos_locks(locks, repos_root)
          Wc.status_set_repos_locks(self, locks, repos_root)
        end
        [editor, set_lock_baton]
      end

      def copy(src, dst_basename, cancel_func=nil, notify_func=nil)
        Wc.copy2(src, self, dst_basename, cancel_func, notify_func)
      end

      def delete(path, cancel_func=nil, notify_func=nil, keep_local=false)
        Wc.delete3(path, self, cancel_func, notify_func, keep_local)
      end

      def add(path, copyfrom_url=nil, copyfrom_rev=0,
              cancel_func=nil, notify_func=nil)
        Wc.add2(path, self, copyfrom_url, copyfrom_rev,
                cancel_func, notify_func)
      end

      def add_repos_file(dst_path, new_text_path, new_props,
                         copyfrom_url=nil, copyfrom_rev=0)
        Wc.add_repos_file(dst_path, self, new_text_path,
                          new_props, copyfrom_url, copyfrom_rev)
      end

      def add_repos_file2(dst_path, new_text_base_path, new_base_props,
                          new_text_path=nil, new_props=nil,
                          copyfrom_url=nil, copyfrom_rev=0)
        Wc.add_repos_file2(dst_path, self,
                           new_text_base_path, new_text_path,
                           new_base_props, new_props,
                           copyfrom_url, copyfrom_rev)
      end

      def remove_from_revision_control(name, destroy_wf=true,
                                       instant_error=true,
                                       cancel_func=nil)
        Wc.remove_from_revision_control(self, name,
                                        destroy_wf,
                                        instant_error,
                                        cancel_func)
      end

      def resolved_conflict(path, resolve_text=true,
                            resolve_props=true, recurse=true,
                            notify_func=nil, cancel_func=nil)
        Wc.resolved_conflict2(path, self, resolve_text,
                              resolve_props, recurse,
                              notify_func, cancel_func)
      end

      def process_committed(path, new_revnum, rev_date=nil, rev_author=nil,
                            wcprop_changes=[], recurse=true,
                            remove_lock=true, digest=nil,
                            remove_changelist=false)
        Wc.process_committed4(path, self, recurse,
                              new_revnum, rev_date,
                              rev_author, wcprop_changes,
                              remove_lock, remove_changelist, digest)
      end

      def crawl_revisions(path, reporter, restore_files=true,
                          depth=nil, use_commit_times=true,
                          notify_func=nil, traversal_info=nil)
        traversal_info ||= _traversal_info
        Wc.crawl_revisions3(path, self, reporter, reporter.baton,
                            restore_files, depth, use_commit_times,
                            notify_func, traversal_info)
      end

      def wc_root?(path)
        Wc.is_wc_root(path, self)
      end

      def update_editor(target, target_revision=nil, use_commit_times=nil,
                        depth=nil, allow_unver_obstruction=nil, diff3_cmd=nil,
                        notify_func=nil, cancel_func=nil, traversal_info=nil,
                        preserved_exts=nil)
        update_editor2(:target => target,
                       :target_revision => target_revision,
                       :use_commit_times => use_commit_times,
                       :depth => depth,
                       :allow_unver_obstruction => allow_unver_obstruction,
                       :diff3_cmd => diff3_cmd,
                       :notify_func => notify_func,
                       :cancel_func => cancel_func,
                       :traversal_info => traversal_info,
                       :preserved_exts => preserved_exts )
      end

      UPDATE_EDITOR2_REQUIRED_ARGUMENTS_KEYS = [:target]
      def update_editor2(arguments={})
        arguments = arguments.reject {|k, v| v.nil?}
        optional_arguments_defaults = {
            :target_revision => nil,
            :use_commit_times => true,
            :depth => nil,
            :depth_is_sticky => false,
            :allow_unver_obstruction => false,
            :diff3_cmd => nil,
            :notify_func => nil,
            :cancel_func => nil,
            :conflict_func => nil,
            :traversal_info => _traversal_info,
            :preserved_exts => []
          }

        arguments = optional_arguments_defaults.merge(arguments)
        Util.validate_options(arguments,
                              optional_arguments_defaults.keys,
                              UPDATE_EDITOR2_REQUIRED_ARGUMENTS_KEYS)

        # TODO(rb support fetch_fun): implement support for the fetch_func
        # callback.
        arguments[:fetch_func] = nil

        results = Wc.get_update_editor3(arguments[:target_revision], self,
                                        arguments[:target],
                                        arguments[:use_commit_times],
                                        arguments[:depth],
                                        arguments[:depth_is_sticky],
                                        arguments[:allow_unver_obstruction],
                                        arguments[:notify_func],
                                        arguments[:cancel_func],
                                        arguments[:conflict_func],
                                        arguments[:fetch_func],
                                        arguments[:diff3_cmd],
                                        arguments[:preserved_exts],
                                        arguments[:traversal_info])
        target_revision_address, editor, editor_baton = results
        editor.__send__(:target_revision_address=, target_revision_address)
        editor.baton = editor_baton
        editor
      end

      def switch_editor(target, switch_url, target_revision=nil,
                        use_commit_times=nil, depth=nil,
                        allow_unver_obstruction=nil, diff3_cmd=nil,
                        notify_func=nil, cancel_func=nil, traversal_info=nil,
                        preserved_exts=nil)
        switch_editor2(:target => target,
                       :switch_url => switch_url,
                       :target_revision => target_revision,
                       :use_commit_times => use_commit_times,
                       :depth => depth,
                       :allow_unver_obstruction => allow_unver_obstruction,
                       :diff3_cmd => diff3_cmd,
                       :notify_func => notify_func,
                       :cancel_func => cancel_func,
                       :traversal_info => traversal_info,
                       :preserved_exts => preserved_exts )
       end

      SWITCH_EDITOR2_REQUIRED_ARGUMENTS_KEYS = [:target, :switch_url]
      def switch_editor2(arguments={})
        arguments = arguments.reject {|k, v| v.nil?}
        optional_arguments_defaults = {
          :target_revision => nil,
          :use_commit_times => true,
          :depth => nil,
          :depth_is_sticky => false,
          :allow_unver_obstruction => false,
          :diff3_cmd => nil,
          :notify_func => nil,
          :cancel_func => nil,
          :conflict_func => nil,
          :traversal_info => _traversal_info,
          :preserved_exts => []
        }
        arguments = optional_arguments_defaults.merge(arguments)
        Util.validate_options(arguments,
                              optional_arguments_defaults.keys,
                              SWITCH_EDITOR2_REQUIRED_ARGUMENTS_KEYS)

        results = Wc.get_switch_editor3(arguments[:target_revision], self,
                                        arguments[:target],
                                        arguments[:switch_url],
                                        arguments[:use_commit_times],
                                        arguments[:depth],
                                        arguments[:depth_is_sticky],
                                        arguments[:allow_unver_obstruction],
                                        arguments[:notify_func],
                                        arguments[:cancel_func],
                                        arguments[:conflict_func],
                                        arguments[:diff3_cmd],
                                        arguments[:preserved_exts],
                                        arguments[:traversal_info])
        target_revision_address, editor, editor_baton = results
        editor.__send__(:target_revision_address=, target_revision_address)
        editor.baton = editor_baton
        editor
      end

      def prop_list(path)
        Wc.prop_list(path, self)
      end

      def prop(name, path)
        Wc.prop_get(name, path, self)
      end

      def set_prop(name, value, path, skip_checks=false)
        Wc.prop_set2(name, value, path, self, skip_checks)
      end

      def diff_editor(target, callbacks, depth=nil,
                      ignore_ancestry=true, use_text_base=false,
                      reverse_order=false, cancel_func=nil)
        callbacks_wrapper = DiffCallbacksWrapper.new(callbacks)
        args = [target, callbacks_wrapper, depth, ignore_ancestry,
                use_text_base, reverse_order, cancel_func]
        diff_editor2(*args)
      end

      def diff_editor2(target, callbacks, depth=nil,
                       ignore_ancestry=true, use_text_base=false,
                       reverse_order=false, cancel_func=nil, changelists=nil)
        editor, editor_baton = Wc.get_diff_editor4(self, target, callbacks,
                                                   depth, ignore_ancestry,
                                                   use_text_base, reverse_order,
                                                   cancel_func, changelists)
        editor.baton = editor_baton
        editor
      end

      def diff(target, callbacks, recurse=true, ignore_ancestry=true)
        callbacks_wrapper = DiffCallbacksWrapper.new(callbacks)
        args = [target, callbacks_wrapper, recurse, ignore_ancestry]
        diff2(*args)
      end

      def diff2(target, callbacks, recurse=true, ignore_ancestry=true)
        Wc.diff3(self, target, callbacks, recurse, ignore_ancestry)
      end

      def prop_diffs(path)
        Wc.get_prop_diffs(path, self)
      end

      def merge(left, right, merge_target, left_label,
                right_label, target_label, dry_run=false,
                diff3_cmd=nil, merge_options=nil)
        Wc.merge2(left, right, merge_target, self,
                  left_label, right_label, target_label,
                  dry_run, diff3_cmd, merge_options)
      end

      def merge_props(path, baseprops, propchanges, base_merge=true,
                      dry_run=false)
        Wc.merge_props(path, self, baseprops, propchanges,
                      base_merge, dry_run)
      end

      def merge_prop_diffs(path, propchanges, base_merge=true,
                           dry_run=false)
        Wc.merge_prop_diffs(path, self, propchanges,
                           base_merge, dry_run)
      end

      def relocate(path, from, to, recurse=true, old_validator=nil, &validator)
        if validator.nil? and !old_validator.nil?
          validator = Proc.new do |uuid, url, root_url|
            old_validator.call(uuid,
                               root_url ? root_url : url,
                               root_url ? true : false)
          end
        end
        Wc.relocate3(path, self, from, to, recurse, validator)
      end

      def revert(path, recurse=true, use_commit_times=true,
                 cancel_func=nil, notify_func=nil)
        Wc.revert2(path, self, recurse, use_commit_times,
                   cancel_func, notify_func)
      end

      def translated_file(src, versioned_file, flags)
        temp = Wc.translated_file2(src, versioned_file, self, flags)
        temp.close
        path = temp.path
        path.instance_variable_set("@__temp__", temp)
        path
      end

      def translated_file2(src, versioned_file, flags)
        Wc.translated_file2(src, versioned_file, self, flags)
      end

      def translated_stream(path, versioned_file, flags)
        Wc.translated_stream(path, versioned_file, self, flags)
      end

      def transmit_text_deltas(path, editor, file_baton, fulltext=false)
        editor.baton = file_baton
        Wc.transmit_text_deltas(path, self, fulltext, editor)
      end

      def transmit_text_deltas2(path, editor, fulltext=false)
        Wc.transmit_text_deltas2(path, self, fulltext, editor)
      end

      def transmit_prop_deltas(path, entry, editor, baton=nil)
        editor.baton = baton if baton
        Wc.transmit_prop_deltas(path, self, entry, editor)
      end

      def ignores(config)
        Wc.get_ignores(config, self)
      end

      def add_lock(path, lock)
        Wc.add_lock(path, lock, self)
      end

      def remove_lock(path)
        Wc.remove_lock(path, self)
      end

      def set_changelist(path, changelist_name, cancel_func=nil,
                         notify_func=nil)
        Wc.set_changelist(path, changelist_name, self, cancel_func,
                          notify_func)
      end

      private
      def _traversal_info
        @traversal_info ||= nil
      end
    end

    class DiffCallbacksWrapper
      def initialize(original)
        @original = original
      end

      def file_changed(access, path, tmpfile1, tmpfile2, rev1,
                       rev2, mimetype1, mimetype2,
                       prop_changes, original_props)
        prop_changes = Util.hash_to_prop_array(prop_changes)
        @original.file_changed(access, path, tmpfile1, tmpfile2, rev1,
                               rev2, mimetype1, mimetype2,
                               prop_changes, original_props)
      end

      def file_added(access, path, tmpfile1, tmpfile2, rev1,
                     rev2, mimetype1, mimetype2,
                     prop_changes, original_props)
        prop_changes = Util.hash_to_prop_array(prop_changes)
        @original.file_added(access, path, tmpfile1, tmpfile2, rev1,
                             rev2, mimetype1, mimetype2,
                             prop_changes, original_props)
      end

      def dir_props_changed(access, path, prop_changes, original_props)
        prop_changes = Util.hash_to_prop_array(prop_changes)
        @original.dir_props_changed(access, path, prop_changes, original_props)
      end

      def method_missing(method, *args, &block)
        @original.__send__(method, *args, &block)
      end
    end

    class TraversalInfo
      def edited_externals
        Wc.edited_externals(self)
      end
    end

    class Entry
      def dup
        Wc.entry_dup(self, Svn::Core::Pool.new)
      end

      def conflicted(dir_path)
        Wc.conflicted_p(dir_path, self)
      end

      def conflicted?(dir_path)
        conflicted(dir_path).any? {|x| x}
      end

      def text_conflicted?(dir_path)
        conflicted(dir_path)[0]
      end

      def prop_conflicted?(dir_path)
        conflicted(dir_path)[1]
      end

      def dir?
        kind == Core::NODE_DIR
      end

      def file?
        kind == Core::NODE_FILE
      end

      def add?
        schedule == SCHEDULE_ADD
      end

      def normal?
        schedule == SCHEDULE_NORMAL
      end
    end

    class Status2
      def dup
        Wc.dup_status2(self, Core::Pool.new)
      end

      def text_added?
        text_status == STATUS_ADDED
      end

      def text_normal?
        text_status == STATUS_NORMAL
      end
    end

    class Notify
      def dup
        Wc.dup_notify(self, Core::Pool.new)
      end

      def commit_added?
        action == NOTIFY_COMMIT_ADDED
      end

      def commit_deleted?
        action == NOTIFY_COMMIT_DELETED
      end

      def commit_postfix_txdelta?
        action == NOTIFY_COMMIT_POSTFIX_TXDELTA
      end

      def add?
        action == NOTIFY_ADD
      end

      def locked?
        lock_state = NOTIFY_LOCK_STATE_LOCKED
      end

      def unlocked?
        lock_state = NOTIFY_LOCK_STATE_UNLOCKED
      end
    end

    class RevisionStatus
      alias _initialize initialize
      def initialize(wc_path, trail_url, committed, cancel_func=nil)
        _initialize(wc_path, trail_url, committed, cancel_func)
      end
    end

    class CommittedQueue
      def push(access, path, recurse=true, wcprop_changes={}, remove_lock=true,
               remove_changelist=false, digest=nil)
        Wc.queue_committed(self, path, access, recurse, wcprop_changes,
                           remove_lock, remove_changelist, digest)
        self
      end

      def process(access, new_rev, rev_date=nil, rev_author=nil)
        rev_date = rev_date.to_svn_format if rev_date.is_a?(Time)
        Wc.process_committed_queue(self, access, new_rev, rev_date, rev_author)
      end
    end
  end
end