summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
64c097a)
This code adds some checks that the bottom is actually always the
parent of top.
It also checks that the top is the same as what the patch ref points
to.
This is only to ensure that the next patches are correct.
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
self.__update_top_ref(top)
def get_old_bottom(self):
self.__update_top_ref(top)
def get_old_bottom(self):
- return self._get_field('bottom.old')
+ old_bottom = self._get_field('bottom.old')
+ old_top = self.get_old_top()
+ assert old_bottom == git.get_commit(old_top).get_parent()
+ return old_bottom
+ bottom = self._get_field('bottom')
+ top = self.get_top()
+ assert bottom == git.get_commit(top).get_parent()
return self._get_field('bottom')
def set_bottom(self, value, backup = False):
return self._get_field('bottom')
def set_bottom(self, value, backup = False):
return self._get_field('top.old')
def get_top(self):
return self._get_field('top.old')
def get_top(self):
- return self._get_field('top')
+ top = self._get_field('top')
+ try:
+ ref = git.rev_parse(self.__top_ref)
+ except:
+ ref = None
+ assert not ref or top == ref
+ return top
def set_top(self, value, backup = False):
if backup:
def set_top(self, value, backup = False):
if backup:
self._set_field('top.old', curr)
self._set_field('top', value)
self.__update_top_ref(value)
self._set_field('top.old', curr)
self._set_field('top', value)
self.__update_top_ref(value)
+ self.get_bottom() # check the assert
def restore_old_boundaries(self):
bottom = self._get_field('bottom.old')
def restore_old_boundaries(self):
bottom = self._get_field('bottom.old')