mergestate: consistently set variables to None
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 08 May 2014 16:48:28 -0700
changeset 21261 6ca05c46aa95
parent 21260 aa3e56607675
child 21262 edac098e6a55
mergestate: consistently set variables to None Some code branches and exceptional circumstances such as empty mergestate files could result in mergestate._local and mergestate._other not being defined or reset to None. These variables are now correctly set to None when they should be.
mercurial/merge.py
--- a/mercurial/merge.py	Wed May 07 17:22:34 2014 -0700
+++ b/mercurial/merge.py	Thu May 08 16:48:28 2014 -0700
@@ -55,6 +55,8 @@
 
     def reset(self, node=None, other=None):
         self._state = {}
+        self._local = None
+        self._other = None
         if node:
             self._local = node
             self._other = other
@@ -68,6 +70,8 @@
         of on disk file.
         """
         self._state = {}
+        self._local = None
+        self._other = None
         records = self._readrecords()
         for rtype, record in records:
             if rtype == 'L':