protected function initializeResouces()
    {
        if ($this->resources !== null) {
            return;
        }

        $this->resources = array();

        $contents = dir($this->root . $this->path);
        while (($path = $contents->read()) !== false) {
            if (in_array($path, array('.', '..', '.hg'))) {
                continue;
            }

            $this->resources[] = (is_dir($this->root . $this->path . $path) ?
                new \Arbit\VCSWrapper\HgCli\Directory($this->root, $this->path . $path . '/') :
                new \Arbit\VCSWrapper\HgCli\File($this->root, $this->path . $path)
            );
        }

        $contents->close();
    }