From: Catalin Marinas Date: Mon, 24 Mar 2008 18:30:25 +0000 (+0000) Subject: Remove the reordering side-effect of the latter sync changes X-Git-Tag: v0.14.2~10 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/386453020a7939cd7668da7666372017ef6a497c?ds=inline Remove the reordering side-effect of the latter sync changes 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 --- diff --git a/stgit/commands/sync.py b/stgit/commands/sync.py index cbacef7..ae9a5f8 100644 --- a/stgit/commands/sync.py +++ b/stgit/commands/sync.py @@ -136,15 +136,14 @@ def func(parser, options, args): 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] else: - popped = patches + to_pop = [] + popped = to_pop + [p for p in patches if p in unapplied] - for p in patches: + for p in [first_patch] + popped: if p in popped: # push this patch push_patches(crt_series, [p]) - popped.remove(p) if p not in sync_patches: # nothing to synchronise continue @@ -172,7 +171,3 @@ def func(parser, options, args): out.done('updated') else: out.done() - - # push the remaining patches - if popped: - push_patches(crt_series, popped)