return [m for m in forwards if m not in done]
def to_unapply(backwards, done):
- return [m for m in backwards if m in done]
+ return [m for m in backwards if m in done]
def problems(pending, done):
def get_dependencies(target, migrations):
forwards = lambda allow_rebase=False: list()
+ backwards = list
backwards = migrations.backwards_plan
forwards, backwards = get_dependencies(target, migrations)
# Is the whole forward branch applied?
- forwards = forwards(allow_rebase=not applied)
- workplan = to_apply(forwards, applied)
+ forwards = forwards(allow_rebase = not [x for x in applied if x.migrations is target.migrations])
+ workplan = to_apply(forwards, applied)
+ # See if there's some forward work to be done.
# If they're all applied, we only know it's not backwards
direction = Forwards(verbosity=verbosity, interactive=interactive)
# What about the whole backward trace then?
- backwards = backwards()
+ backwards = backwards()
missing_backwards = to_apply(backwards, applied)
if missing_backwards != backwards:
# If what's missing is a strict left segment of backwards (i.e.
# all the higher migrations) then we need to go backwards
workplan = to_unapply(backwards, applied)
- problems = backwards_problems(backwards, applied, verbosity)
+ problems = backwards_problems(
+ [x for x in backwards if not x.is_rebase()],
direction = Backwards(verbosity=verbosity, interactive=interactive)
return direction, problems, workplan