Start writing the "top", "bottom", and "bottom.old" fields again. The
last two patches mean we don't need them anymore, but old versions of
StGit still do.
At some later time, we'll want to change the stack on-disk format so
that these can be removed. But we'll probably want to do that as part
of a larger change.
Signed-off-by: Karl Hasselström <kha@treskal.com>
def __update_top_ref(self, ref):
git.set_ref(self.__top_ref, ref)
def __update_top_ref(self, ref):
git.set_ref(self.__top_ref, ref)
+ self._set_field('top', ref)
+ self._set_field('bottom', git.get_commit(ref).get_parent())
def __update_log_ref(self, ref):
git.set_ref(self.__log_ref, ref)
def __update_log_ref(self, ref):
git.set_ref(self.__log_ref, ref)
def set_top(self, value, backup = False):
if backup:
def set_top(self, value, backup = False):
if backup:
- curr = self.get_top()
- self._set_field('top.old', curr)
+ curr_top = self.get_top()
+ self._set_field('top.old', curr_top)
+ self._set_field('bottom.old', git.get_commit(curr_top).get_parent())
self.__update_top_ref(value)
def restore_old_boundaries(self):
self.__update_top_ref(value)
def restore_old_boundaries(self):