def clean()

in libmozevent/mercurial.py [0:0]


    def clean(self):
        """
        Steps to clean the mercurial repo
        """
        logger.info("Remove uncommitted changes")
        self.repo.revert(self.dir.encode("utf-8"), all=True)

        logger.info("Remove all mercurial drafts")
        try:
            cmd = hglib.util.cmdbuilder(
                b"strip", rev=b"roots(outgoing())", force=True, backup=False
            )
            self.repo.rawcommand(cmd)
        except hglib.error.CommandError as e:
            if b"abort: empty revision set" not in e.err:
                raise

        logger.info("Pull updates from remote repo")
        self.repo.pull()