# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1517305295 -19800 # Node ID 152daa6967af4f17dcb14ab95208b5d13334d39f # Parent dae819761c0e2379a8f174d52e02be1da96b4d06 evolve: add comptability to read old evolvestate files When a user runs `hg evolve` with old evolve where we used to write evolvestate the old ways i.e. without using cbor, and faces conflicts, the evolve is interrupted. If the user updates evolve before completing the evolve, that can result in traceback as the new evolve cannot read the old evolvestate file. The previous patch added function to read old evolvestate file and this patch uses that when we encounter the above mentioned case. diff -r dae819761c0e -r 152daa6967af hgext3rd/evolve/state.py --- a/hgext3rd/evolve/state.py Tue Jan 30 15:02:40 2018 +0530 +++ b/hgext3rd/evolve/state.py Tue Jan 30 15:11:35 2018 +0530 @@ -51,7 +51,12 @@ def load(self): """load the existing evolvestate file into the class object""" op = self._read() - self.opts.update(op) + if isinstance(op, dict): + self.opts.update(op) + elif self.path == 'evolvestate': + # it is the old evolvestate file + oldop = _oldevolvestateread(self._repo) + self.opts.update(oldop) def addopts(self, opts): """add more key-value pairs to the data stored by the object"""