From 386453020a7939cd7668da7666372017ef6a497c Mon Sep 17 00:00:00 2001 Message-Id: <386453020a7939cd7668da7666372017ef6a497c.1715146928.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 24 Mar 2008 18:30:25 +0000 Subject: [PATCH] Remove the reordering side-effect of the latter sync changes Organization: Straylight/Edgeware From: Catalin Marinas 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 --- stgit/commands/sync.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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) -- [mdw]