changeset 21261:6ca05c46aa95

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 08 May 2014 16:48:28 -0700
parents aa3e56607675
children edac098e6a55
files mercurial/merge.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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':