def METHOD_NAME():
    with hglib.open(self._encode_filename(path)) as subrepo:
        subrepo.pull()
        subrepo.update(self._encode(commit_hash), clean=True)
        subrepo.rawcommand([b"--config",
                            b"extensions.purge=",
                            b"purge",
                            b"--all"])