TQ\Svn\Repository\Repository::reset PHP Method

reset() public method

Resets the working directory and/or the staging area and discards all changes
public reset ( )
    public function reset()
    {
        /** @var $result CallResult */
        $result = $this->getSvn()->{'revert'}($this->getRepositoryPath(), array('--recursive', '--', '.'));
        $result->assertSuccess(sprintf('Cannot reset "%s"', $this->getRepositoryPath()));
        $status = $this->getStatus();
        foreach ($status as $item) {
            $file = $this->resolveFullPath($item['file']);
            if (@unlink($file) !== true || $item['status'] !== 'unversioned') {
                throw new \RuntimeException('Cannot delete file "' . $item['file'] . '"');
            }
        }
    }