Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 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 | 9f12d8665c7b |
children | 4e932dc5c113 |
comparison
equal
deleted
inserted
replaced
21260:aa3e56607675 | 21261:6ca05c46aa95 |
---|---|
53 self._dirty = False | 53 self._dirty = False |
54 self._read() | 54 self._read() |
55 | 55 |
56 def reset(self, node=None, other=None): | 56 def reset(self, node=None, other=None): |
57 self._state = {} | 57 self._state = {} |
58 self._local = None | |
59 self._other = None | |
58 if node: | 60 if node: |
59 self._local = node | 61 self._local = node |
60 self._other = other | 62 self._other = other |
61 shutil.rmtree(self._repo.join("merge"), True) | 63 shutil.rmtree(self._repo.join("merge"), True) |
62 self._dirty = False | 64 self._dirty = False |
66 | 68 |
67 This function process "record" entry produced by the de-serialization | 69 This function process "record" entry produced by the de-serialization |
68 of on disk file. | 70 of on disk file. |
69 """ | 71 """ |
70 self._state = {} | 72 self._state = {} |
73 self._local = None | |
74 self._other = None | |
71 records = self._readrecords() | 75 records = self._readrecords() |
72 for rtype, record in records: | 76 for rtype, record in records: |
73 if rtype == 'L': | 77 if rtype == 'L': |
74 self._local = bin(record) | 78 self._local = bin(record) |
75 elif rtype == 'O': | 79 elif rtype == 'O': |