def _grab_history(self):
default_location = None<EOL>config = self.setup_cfg.config<EOL>if config and config.has_option('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>default_location = config.get('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>history_file = self.vcs.history_file(location=default_location)<EOL>if not history_file:<EOL><INDENT>logger.warn("<STR_LIT>")<EOL>self.data['<STR_LIT>'] = None<EOL>self.data['<STR_LIT>'] = None<EOL>return<EOL><DEDENT>logger.debug("<STR_LIT>", history_file)<EOL>history_lines = open(history_file).read().split('<STR_LIT:\n>')<EOL>headings = utils.extract_headings_from_history(history_lines)<EOL>if not len(headings):<EOL><INDENT>logger.error("<STR_LIT>"<EOL>"<STR_LIT>", history_file)<EOL>sys.exit()<EOL><DEDENT>good_heading = self.data['<STR_LIT>'] % self.data<EOL>line = headings[<NUM_LIT:0>]['<STR_LIT>']<EOL>previous = history_lines[line]<EOL>history_lines[line] = good_heading<EOL>logger.debug("<STR_LIT>", previous, good_heading)<EOL>history_lines[line + <NUM_LIT:1>] = utils.fix_rst_heading(<EOL>heading=good_heading,<EOL>below=history_lines[line + <NUM_LIT:1>])<EOL>logger.debug("<STR_LIT>",<EOL>history_lines[line + <NUM_LIT:1>])<EOL>self.data['<STR_LIT>'] = history_lines<EOL>self.data['<STR_LIT>'] = history_file<EOL>
Calculate the needed history/changelog changes

        Every history heading looks like '1.0 b4 (1972-12-25)'. Extract them,
        check if the first one matches the version and whether it has a the
        current date.