Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/bindings/swig/ruby/svn/fs.rb  view on Meta::CPAN

          yield(lock) if block_given?
        end
        Fs.get_locks(self, path, receiver)
        locks
      end

      def history(path, start_rev, end_rev,
                  cross_copies=true, authz_read_func=nil)
        hist = []
        history_func = Proc.new do |path, revision|
          yield(path, revision) if block_given?
          hist << [path, revision]
        end
        Repos.history2(self, path, history_func,
                       authz_read_func, start_rev, end_rev,
                       cross_copies)
        hist
      end

      def trace_node_locations(fs_path, location_revisions,
                               peg_rev=nil, &authz_read_func)
        peg_rev ||= youngest_rev
        Repos.trace_node_locations(self, fs_path, peg_rev,
                                   location_revisions,
                                   authz_read_func)
      end
    end

    Access = SWIG::TYPE_p_svn_fs_access_t
    class Access
      class << self
        def new(username)
          Fs.create_access(username)
        end
      end

      def username
        Fs.access_get_username(self)
      end

      def add_lock_token(token)
        Fs.access_add_lock_token(self, token)
      end
    end

    Transaction = SWIG::TYPE_p_svn_fs_txn_t
    class Transaction

      def name
        Fs.txn_name(self)
      end

      def prop(name)
        value = Fs.txn_prop(self, name)
        if name == Svn::Core::PROP_REVISION_DATE and value
          value = Time.parse_svn_format(value)
        end
        value
      end

      def set_prop(name, value, validate=true)
        if validate
          Repos.fs_change_txn_prop(self, name, value)
        else
          Fs.change_txn_prop(self, name, value)
        end
      end

      def base_revision
        Fs.txn_base_revision(self)
      end

      def root
        Fs.txn_root(self)
      end

      def proplist
        list = Fs.txn_proplist(self)
        date_str = list[Svn::Core::PROP_REVISION_DATE]
        if list[Svn::Core::PROP_REVISION_DATE]
          list[Svn::Core::PROP_REVISION_DATE] = Time.parse_svn_format(date_str)
        end
        list
      end

      def abort
        Fs.abort_txn(self)
      end

      def commit
        result = Fs.commit_txn(self)
        if result.is_a?(Array)
          result
        else
          [nil, result]
        end
      end
    end


    Root = SWIG::TYPE_p_svn_fs_root_t
    class Root
      attr_reader :editor

      def dir?(path)
        Fs.is_dir(self, path)
      end

      def file?(path)
        Fs.is_file(self, path)
      end

      def base_revision
        Fs.txn_root_base_revision(self)
      end

      def revision
        Fs.revision_root_revision(self)
      end

      def name
        Fs.txn_root_name(self)
      end

      def fs
        Fs.root_fs_wrapper(self)
      end

      def node_id(path)
        Fs.node_id(self, path)
      end

      def node_created_rev(path)
        Fs.node_created_rev(self, path)
      end

      def node_created_path(path)
        Fs.node_created_path(self, path)
      end

      def node_prop(path, key)
        Fs.node_prop(self, path, key)
      end

      def set_node_prop(path, key, value, validate=true)
        if validate
          Repos.fs_change_node_prop(self, path, key, value)
        else
          Fs.change_node_prop(self, path, key, value)
        end
      end

      def node_proplist(path)
        Fs.node_proplist(self, path)
      end
      alias node_prop_list node_proplist

      def check_path(path)
        Fs.check_path(self, path)
      end

      def file_length(path)
        Fs.file_length(self, path)
      end

      def file_md5_checksum(path)
        Fs.file_md5_checksum(self, path)
      end

      def file_contents(path)
        stream = Fs.file_contents(self, path)
        if block_given?
          begin
            yield stream
          ensure
            stream.close
          end
        else
          stream
        end
      end

      def close
        Fs.close_root(self)
      end

      def dir_entries(path)
        entries = {}
        Fs.dir_entries(self, path).each do |name, entry|
          entries[name] = entry
        end
        entries
      end

      def dir_delta(src_path, src_entry, tgt_root, tgt_path,
                    editor, text_deltas=false, recurse=true,
                    entry_props=false, ignore_ancestry=false,
                    &authz_read_func)
        Repos.dir_delta(self, src_path, src_entry, tgt_root,
                        tgt_path, editor, authz_read_func,
                        text_deltas, recurse, entry_props,
                        ignore_ancestry)
      end

      def replay(editor, base_dir=nil, low_water_mark=nil, send_deltas=true,
                 &callback)



( run in 0.549 second using v1.01-cache-2.11-cpan-39bf76dae61 )