##// END OF EJS Templates
mergestate: initialize all properties in __init__()...
Martin von Zweigbergk -
r46068:ef3273ac default
parent child Browse files
Show More
@@ -195,8 +195,20 b' class mergestate(object):'
195
195
196 Do not use this directly! Instead call read() or clean()."""
196 Do not use this directly! Instead call read() or clean()."""
197 self._repo = repo
197 self._repo = repo
198 self._state = {}
199 self._stateextras = collections.defaultdict(dict)
200 self._local = None
201 self._other = None
202 self._labels = None
203 self._readmergedriver = None
204 self._mdstate = MERGE_DRIVER_STATE_UNMARKED
205 # contains a mapping of form:
206 # {filename : (merge_return_value, action_to_be_performed}
207 # these are results of re-running merge process
208 # this dict is used to perform actions on dirstate caused by re-running
209 # the merge
210 self._results = {}
198 self._dirty = False
211 self._dirty = False
199 self._labels = None
200
212
201 def reset(self):
213 def reset(self):
202 shutil.rmtree(self._repo.vfs.join(b'merge'), True)
214 shutil.rmtree(self._repo.vfs.join(b'merge'), True)
@@ -205,15 +217,8 b' class mergestate(object):'
205 self._local = node
217 self._local = node
206 self._other = other
218 self._other = other
207 self._labels = labels
219 self._labels = labels
208 self._state = {}
209 self._stateextras = collections.defaultdict(dict)
210 self._readmergedriver = None
211 if self.mergedriver:
220 if self.mergedriver:
212 self._mdstate = MERGE_DRIVER_STATE_SUCCESS
221 self._mdstate = MERGE_DRIVER_STATE_SUCCESS
213 else:
214 self._mdstate = MERGE_DRIVER_STATE_UNMARKED
215 self._results = {}
216 self._dirty = False
217
222
218 def _read(self):
223 def _read(self):
219 """Analyse each record content to restore a serialized state from disk
224 """Analyse each record content to restore a serialized state from disk
@@ -221,11 +226,6 b' class mergestate(object):'
221 This function process "record" entry produced by the de-serialization
226 This function process "record" entry produced by the de-serialization
222 of on disk file.
227 of on disk file.
223 """
228 """
224 self._state = {}
225 self._stateextras = collections.defaultdict(dict)
226 self._local = None
227 self._other = None
228 self._readmergedriver = None
229 self._mdstate = MERGE_DRIVER_STATE_SUCCESS
229 self._mdstate = MERGE_DRIVER_STATE_SUCCESS
230 unsupported = set()
230 unsupported = set()
231 records = self._readrecords()
231 records = self._readrecords()
@@ -277,13 +277,6 b' class mergestate(object):'
277 self._labels = [l for l in labels if len(l) > 0]
277 self._labels = [l for l in labels if len(l) > 0]
278 elif not rtype.islower():
278 elif not rtype.islower():
279 unsupported.add(rtype)
279 unsupported.add(rtype)
280 # contains a mapping of form:
281 # {filename : (merge_return_value, action_to_be_performed}
282 # these are results of re-running merge process
283 # this dict is used to perform actions on dirstate caused by re-running
284 # the merge
285 self._results = {}
286 self._dirty = False
287
280
288 if unsupported:
281 if unsupported:
289 raise error.UnsupportedMergeRecords(unsupported)
282 raise error.UnsupportedMergeRecords(unsupported)
General Comments 0
You need to be logged in to leave comments. Login now