From: Karl Hasselström Date: Wed, 19 Dec 2007 18:00:11 +0000 (+0000) Subject: Write removed fields for backwards compatibility X-Git-Tag: v0.15-rc1~342 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/757c5455dd57c4178962f0920d7ccfdf617efa05?ds=inline Write removed fields for backwards compatibility 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 --- diff --git a/stgit/stack.py b/stgit/stack.py index bdc07a9..6db789a 100644 --- a/stgit/stack.py +++ b/stgit/stack.py @@ -196,6 +196,8 @@ class Patch(StgitObject): 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) @@ -214,8 +216,9 @@ class Patch(StgitObject): 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):