comparison mercurial/state.py @ 38126:bdc4079ceb16

state: fix usage of an unassigned variable The variable iv was used in earlier iterations of the patches and was dropped since we made sure 'version' is always int. This usage of 'iv' should have been replaced by 'version' in the original patch only. Differential Revision: https://phab.mercurial-scm.org/D3640
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 22 May 2018 00:22:23 +0530
parents a0e4d654bceb
children b7e5c53a779e
comparison
equal deleted inserted replaced
38125:6ef01102ebff 38126:bdc4079ceb16
60 if not isinstance(version, int): 60 if not isinstance(version, int):
61 raise error.ProgrammingError("version of state file should be" 61 raise error.ProgrammingError("version of state file should be"
62 " an integer") 62 " an integer")
63 63
64 with self._repo.vfs(self.fname, 'wb', atomictemp=True) as fp: 64 with self._repo.vfs(self.fname, 'wb', atomictemp=True) as fp:
65 fp.write('%d\n' % iv) 65 fp.write('%d\n' % version)
66 cbor.dump(self.opts, fp, canonical=True) 66 cbor.dump(self.opts, fp, canonical=True)
67 67
68 def _read(self): 68 def _read(self):
69 """reads the state file and returns a dictionary which contain 69 """reads the state file and returns a dictionary which contain
70 data in the same format as it was before storing""" 70 data in the same format as it was before storing"""