def get_dates(self, resource):
        """
        Retrieve dates from mercurial
        """
        # Run hg log --template={date|isodatesec}
        try:
            commits = subprocess.check_output([
                "hg", "log", "--template={date|isodatesec}\n",
                resource.path]).split('\n')
            commits = commits[:-1]
        except subprocess.CalledProcessError:
            self.logger.warning("Unable to get mercurial history for [%s]"
                                % resource)
            commits = None

        if not commits:
            self.logger.warning("No mercurial history for [%s]" % resource)
            return None, None

        created = parse(commits[-1].strip())
        modified = parse(commits[0].strip())
        return created, modified
dataset/ETHPy150Open hyde/hyde/hyde/ext/plugins/vcs.py/MercurialDatesPlugin.get_dates/original