##// END OF EJS Templates
rebase: add storestatus support for transactions...
Durham Goode -
r31224:183eb1d7 default
parent child Browse files
Show More
@@ -159,10 +159,17 b' class rebaseruntime(object):'
159 self.keepopen = opts.get('keepopen', False)
159 self.keepopen = opts.get('keepopen', False)
160 self.obsoletenotrebased = {}
160 self.obsoletenotrebased = {}
161
161
162 def storestatus(self):
162 def storestatus(self, tr=None):
163 """Store the current status to allow recovery"""
163 """Store the current status to allow recovery"""
164 if tr:
165 tr.addfilegenerator('rebasestate', ('rebasestate',),
166 self._writestatus, location='plain')
167 else:
168 with self.repo.vfs("rebasestate", "w") as f:
169 self._writestatus(f)
170
171 def _writestatus(self, f):
164 repo = self.repo
172 repo = self.repo
165 f = repo.vfs("rebasestate", "w")
166 f.write(repo[self.originalwd].hex() + '\n')
173 f.write(repo[self.originalwd].hex() + '\n')
167 f.write(repo[self.target].hex() + '\n')
174 f.write(repo[self.target].hex() + '\n')
168 f.write(repo[self.external].hex() + '\n')
175 f.write(repo[self.external].hex() + '\n')
@@ -181,7 +188,6 b' class rebaseruntime(object):'
181 else:
188 else:
182 newrev = v
189 newrev = v
183 f.write("%s:%s\n" % (oldrev, newrev))
190 f.write("%s:%s\n" % (oldrev, newrev))
184 f.close()
185 repo.ui.debug('rebase status stored\n')
191 repo.ui.debug('rebase status stored\n')
186
192
187 def restorestatus(self):
193 def restorestatus(self):
General Comments 0
You need to be logged in to leave comments. Login now