D3653: state: removing remaining instances of opts class variable
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Thu May 24 17:00:57 EDT 2018
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
The cmdstate class used to have a class variable opts which used to be a dict
which stored all the data for the state. Recent cleanups removed the use of that
variable. There were couple of instances left which are removed by this patch.
diff --git a/mercurial/state.py b/mercurial/state.py
@@ -40,7 +40,7 @@
- def __init__(self, repo, fname, opts=None):
+ def __init__(self, repo, fname):
""" repo is the repo object
fname is the file name in which data should be stored in .hg directory
opts is a dictionary of data of the statefile
@@ -63,7 +63,7 @@
with self._repo.vfs(self.fname, 'wb', atomictemp=True) as fp:
fp.write('%d\n' % version)
- cbor.dump(self.opts, fp, canonical=True)
+ cbor.dump(data, fp, canonical=True)
"""reads the state file and returns a dictionary which contain
To: pulkit, #hg-reviewers
More information about the Mercurial-devel