def entries_for(path, revision=nil, parent=nil)
      revision ||= 'tip'
      [].tap do |entries|
        manifest_entries = repository.manifest.scan_for_path(path, revision)
        manifest_entries.each do |me|
          path_without_source = me[3].gsub(/^#{ Regexp.escape(path.without_trailing_slash) }\//, '')
          entry_name = path_without_source.split('/').first
          entry_path = File.join(path, entry_name).gsub(/^\//, '')
          dir = me[3].scan(/^(#{ Regexp.escape(entry_path) }\/)/).flatten.first ? true : false
          entry_name << '/' if dir
          
          if entries.select{|item| item.name == entry_name}.size == 0
            entries << build(
              :path     => entry_path,
              :name     => entry_name,
              :revision => revision,
              :nodeid   => (me[0] unless dir),
              :fmode    => dir ? nil : me[1],
              :exec     => dir ? nil : me[2],
              :parent   => parent
            )
          end
        end
      end
    end
def entries_for(path, revision=nil, parent=nil)
      revision ||= 'tip'
      [].tap do |entries|
        manifest_entries = repository.manifest.scan_for_path(path, revision)
        manifest_entries.each do |me|
          path_without_source = me[3].gsub(/^#{ Regexp.escape(path.without_trailing_slash) }\//, '')
          entry_name = path_without_source.split('/').first
          entry_path = File.join(path, entry_name).gsub(/^\//, '')
          dir = me[3].scan(/^(#{ Regexp.escape(entry_path) }\/)/).flatten.first ? true : false
          entry_name << '/' if dir
          
          if entries.select{|item| item.name == entry_name}.size == 0
            entries << build(
              :path     => entry_path,
              :name     => entry_name,
              :revision => revision,
              :nodeid   => (me[0] unless dir),
              :fmode    => dir ? nil : me[1],
              :exec     => dir ? nil : me[2],
              :parent   => parent
            )
          end
        end
      end
    end
Find all entries (files and directories) inside a specified path and revision.
 Returns an array of {Mercurial::Node Node} instances.

 Will find node in the latest version of repo if revision is ommitted.

 === Example:
  repository.nodes.entries_for('/')
  repository.nodes.entries_for('some-fancy-directory/subdirectory/', '291a498f04e9')