From: Catalin Marinas Date: Mon, 24 Mar 2008 18:30:56 +0000 (+0000) Subject: Remove the reordering side-effect of the latter sync changes X-Git-Tag: v0.15-rc1~254 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/c70a7b27b0804ff978947be823effc6c954ea6a6?hp=-c 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 --- c70a7b27b0804ff978947be823effc6c954ea6a6 diff --git a/stgit/commands/sync.py b/stgit/commands/sync.py index 944a8c9..35c5c31 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 @@ -171,7 +170,3 @@ def func(parser, options, args): out.done('updated') else: out.done() - - # push the remaining patches - if popped: - push_patches(crt_series, popped)