Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 44525:6c906eaedd0d
nodemap: track the tip_node for validation
Differential Revision: https://phab.mercurial-scm.org/D8184
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 27 Feb 2020 16:32:43 +0100 |
parents | e7fff9c3cdac |
children | 64e2f603de9d |
comparison
equal
deleted
inserted
replaced
44524:15a033cabc19 | 44525:6c906eaedd0d |
---|---|
641 and util.safehasattr(index, 'update_nodemap_data') | 641 and util.safehasattr(index, 'update_nodemap_data') |
642 ) | 642 ) |
643 if use_nodemap: | 643 if use_nodemap: |
644 nodemap_data = nodemaputil.persisted_data(self) | 644 nodemap_data = nodemaputil.persisted_data(self) |
645 if nodemap_data is not None: | 645 if nodemap_data is not None: |
646 self._nodemap_docket = nodemap_data[0] | 646 docket = nodemap_data[0] |
647 index.update_nodemap_data(*nodemap_data) | 647 if d[0][docket.tip_rev][7] == docket.tip_node: |
648 # no changelog tampering | |
649 self._nodemap_docket = docket | |
650 index.update_nodemap_data(*nodemap_data) | |
648 except (ValueError, IndexError): | 651 except (ValueError, IndexError): |
649 raise error.RevlogError( | 652 raise error.RevlogError( |
650 _(b"index %s is corrupted") % self.indexfile | 653 _(b"index %s is corrupted") % self.indexfile |
651 ) | 654 ) |
652 self.index, self._chunkcache = d | 655 self.index, self._chunkcache = d |