def find(path, revision=nil)
      revision ||= 'tip'
      return RootNode.new(:repository => repository, :revision => revision) if path == '/'
      entry = repository.manifest.scan_for_path(path, revision).first
      return unless entry
      if exact_path = entry[3].scan(/^(#{ Regexp.escape(path.without_trailing_slash) }\/)/).flatten.first
        name = exact_path.split('/').last + '/'
        build(
          :path     => exact_path,
          :name     => name,
          :revision => revision
        )
      else
        build(
          :path     => entry[3],
          :name     => entry[3].split('/').last,
          :revision => revision,
          :nodeid   => entry[0],
          :fmode    => entry[1],
          :exec     => entry[2]
        )
      end
    end
def find(path, revision=nil)
      revision ||= 'tip'
      return RootNode.new(:repository => repository, :revision => revision) if path == '/'
      entry = repository.manifest.scan_for_path(path, revision).first
      return unless entry
      if exact_path = entry[3].scan(/^(#{ Regexp.escape(path.without_trailing_slash) }\/)/).flatten.first
        name = exact_path.split('/').last + '/'
        build(
          :path     => exact_path,
          :name     => name,
          :revision => revision
        )
      else
        build(
          :path     => entry[3],
          :name     => entry[3].split('/').last,
          :revision => revision,
          :nodeid   => entry[0],
          :fmode    => entry[1],
          :exec     => entry[2]
        )
      end
    end
Finds a specified file or a directory in the repository at a specified revision.
 Returns an instance of {Mercurial::Node Node}.

 Will find node in the latest version of repo if revision is ommitted.
 Will return nil if node wasn't found.

 === Example:
  repository.nodes.find('/')
  repository.nodes.find('some-fancy-directory/Weird File Name.pdf', '291a498f04e9')
  repository.nodes.find('some-fancy-directory/subdirectory/', '291a498f04e9')