If only some of the patches were specified for syncing, the command had the
side effect of reordering the patches in the stack.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
to_pop = applied[applied.index(first_patch) + 1:]
if to_pop:
pop_patches(crt_series, to_pop[::-1])
to_pop = applied[applied.index(first_patch) + 1:]
if to_pop:
pop_patches(crt_series, to_pop[::-1])
- popped = to_pop + [p for p in patches if p in unapplied]
+ to_pop = []
+ popped = to_pop + [p for p in patches if p in unapplied]
+ for p in [first_patch] + popped:
if p in popped:
# push this patch
push_patches(crt_series, [p])
if p in popped:
# push this patch
push_patches(crt_series, [p])
if p not in sync_patches:
# nothing to synchronise
continue
if p not in sync_patches:
# nothing to synchronise
continue
out.done('updated')
else:
out.done()
out.done('updated')
else:
out.done()
-
- # push the remaining patches
- if popped:
- push_patches(crt_series, popped)