##// END OF EJS Templates
mergestate: split up reset() for its two use cases...
Martin von Zweigbergk -
r46064:08c6d696 default
parent child Browse files
Show More
@@ -181,7 +181,8 b' class mergestate(object):'
181 """Initialize a brand new merge state, removing any existing state on
181 """Initialize a brand new merge state, removing any existing state on
182 disk."""
182 disk."""
183 ms = mergestate(repo)
183 ms = mergestate(repo)
184 ms.reset(node, other, labels)
184 ms.reset()
185 ms.start(node, other, labels)
185 return ms
186 return ms
186
187
187 @staticmethod
188 @staticmethod
@@ -199,12 +200,9 b' class mergestate(object):'
199 self._dirty = False
200 self._dirty = False
200 self._labels = None
201 self._labels = None
201
202
202 def reset(self, node=None, other=None, labels=None):
203 def reset(self):
203 self._state = {}
204 self._state = {}
204 self._stateextras = collections.defaultdict(dict)
205 self._stateextras = collections.defaultdict(dict)
205 self._local = node
206 self._other = other
207 self._labels = labels
208 for var in ('localctx', 'otherctx'):
206 for var in ('localctx', 'otherctx'):
209 if var in vars(self):
207 if var in vars(self):
210 delattr(self, var)
208 delattr(self, var)
@@ -217,6 +215,11 b' class mergestate(object):'
217 self._results = {}
215 self._results = {}
218 self._dirty = False
216 self._dirty = False
219
217
218 def start(self, node, other, labels=None):
219 self._local = node
220 self._other = other
221 self._labels = labels
222
220 def _read(self):
223 def _read(self):
221 """Analyse each record content to restore a serialized state from disk
224 """Analyse each record content to restore a serialized state from disk
222
225
General Comments 0
You need to be logged in to leave comments. Login now