comparison mercurial/context.py @ 22405:6f63c47cbb86

dirstate: wrap setparent calls with begin/endparentchange (issue4353) This wraps all the locations of dirstate.setparent with the appropriate begin/endparentchange calls. This will prevent exceptions during those calls from causing incoherent dirstates (issue4353).
author Durham Goode <durham@fb.com>
date Fri, 05 Sep 2014 11:36:20 -0700
parents 94f77624dbb5
children 5220c12c43fd
comparison
equal deleted inserted replaced
22404:12bc7f06fc41 22405:6f63c47cbb86
1171 workingctx have been committed. For example, it marks 1171 workingctx have been committed. For example, it marks
1172 modified and added files as normal in the dirstate. 1172 modified and added files as normal in the dirstate.
1173 1173
1174 """ 1174 """
1175 1175
1176 self._repo.dirstate.beginparentchange()
1176 for f in self.modified() + self.added(): 1177 for f in self.modified() + self.added():
1177 self._repo.dirstate.normal(f) 1178 self._repo.dirstate.normal(f)
1178 for f in self.removed(): 1179 for f in self.removed():
1179 self._repo.dirstate.drop(f) 1180 self._repo.dirstate.drop(f)
1180 self._repo.dirstate.setparents(node) 1181 self._repo.dirstate.setparents(node)
1182 self._repo.dirstate.endparentchange()
1181 1183
1182 def dirs(self): 1184 def dirs(self):
1183 return self._repo.dirstate.dirs() 1185 return self._repo.dirstate.dirs()
1184 1186
1185 class workingctx(committablectx): 1187 class workingctx(committablectx):