

def get_log_entries(self, from_tag, to_tag, skip_merges=False):
    revrange = ('%s:%s' % ((to_tag if to_tag else ''), (from_tag if from_tag else 'tip')))
    if to_tag:
        revrange += ('-%s' % to_tag)
    if from_tag:
        revrange += ('-%s' % from_tag)
    cmd = [self._executable, 'log', '-r', revrange, '--template', '{rev}\n']
    result = self._run_command(cmd)
    if result['returncode']:
        raise RuntimeError(('Could not fetch commit hashes:\n%s' % result['output']))
    tmp_base = tempfile.mkdtemp('-hg-style')
    try:
        style_file = os.path.join(tmp_base, 'hg-changeset-files-per-line.style')
        with open(style_file, 'w') as f:
            f.write("changeset = '{files}'\n")
            f.write("file = '{file}\\n'\n")
        log_entries = []
        if result['output']:
            revs = reversed(result['output'].splitlines())
            for rev in revs:
                cmd = [self._executable, 'log', '-r', rev, '-l', '1', '--template', '{desc}']
                result = self._run_command(cmd)
                if result['returncode']:
                    raise RuntimeError(('Could not fetch commit message:\n%s' % result['output']))
                if (result['output'] == from_tag):
                    continue
                msg = result['output']
                cmd = [self._executable, 'log', '-r', rev, '-l', '1', '--style', style_file]
                result = self._run_command(cmd)
                if result['returncode']:
                    raise RuntimeError(('Could not fetch affected paths:\n%s' % result['output']))
                affected_paths = result['output'].splitlines()
                log_entries.append(LogEntry(msg, affected_paths, self._get_author(rev)))
    finally:
        shutil.rmtree(tmp_base)
    return log_entries

dataset/ETHPy150Open ros-infrastructure/catkin_pkg/src/catkin_pkg/changelog_generator_vcs.py HgClient.get_log_entries/original