Skip to content
Snippets Groups Projects
  • Simon Heimberg's avatar
    9155257e6330
    rebase: do not raise an UnboundLocalError when called wrong (issue4106) · 9155257e6330
    Simon Heimberg authored
    When the base is not found, we should not raise a traceback about a not defined
    variable. This hides the real problem: the function rebasenode was (probably)
    called wrong.
    
    An AssertionError is raised to highlight that the caller of the function did
    something wrong.
    
    An alternative approach is to only assign None to the variable "base" and let
    the merge mechanism raise an abort message. This was the behaviour for this
    case before ad9db007656f. But the only known case for this problem is when an
    extension calls this function wrong. An AssertionError makes this clearer than
    an abort message. When a different case is detected, the behaviour can be
    improved then.
    9155257e6330
    History
    rebase: do not raise an UnboundLocalError when called wrong (issue4106)
    Simon Heimberg authored
    When the base is not found, we should not raise a traceback about a not defined
    variable. This hides the real problem: the function rebasenode was (probably)
    called wrong.
    
    An AssertionError is raised to highlight that the caller of the function did
    something wrong.
    
    An alternative approach is to only assign None to the variable "base" and let
    the merge mechanism raise an abort message. This was the behaviour for this
    case before ad9db007656f. But the only known case for this problem is when an
    extension calls this function wrong. An AssertionError makes this clearer than
    an abort message. When a different case is detected, the behaviour can be
    improved then.