From: Catalin Marinas <catalin.marinas@arm.com>
To: git@vger.kernel.org, "Karl Hasselström" <kha@treskal.com>
Subject: [StGit PATCH 4/4] Use a default "hidden" argument in StackTransaction.reorder_patches
Date: Tue, 17 Mar 2009 11:09:10 +0000 [thread overview]
Message-ID: <20090317110910.27748.80312.stgit@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <20090317110721.27748.10295.stgit@pc1117.cambridge.arm.com>
This argument is rarely used so adding a default value simplifies the
calling code.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
stgit/commands/float.py | 3 +--
stgit/commands/sink.py | 4 +---
stgit/lib/transaction.py | 4 +++-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/stgit/commands/float.py b/stgit/commands/float.py
index 8410675..e561c39 100644
--- a/stgit/commands/float.py
+++ b/stgit/commands/float.py
@@ -71,7 +71,6 @@ def func(parser, options, args):
applied = [p for p in stack.patchorder.applied if p not in patches] + \
patches
unapplied = [p for p in stack.patchorder.unapplied if not p in patches]
- hidden = list(stack.patchorder.hidden)
iw = stack.repository.default_iw
clean_iw = (not options.keep and iw) or None
@@ -79,7 +78,7 @@ def func(parser, options, args):
check_clean_iw = clean_iw)
try:
- trans.reorder_patches(applied, unapplied, hidden, iw)
+ trans.reorder_patches(applied, unapplied, iw = iw)
except transaction.TransactionHalted:
pass
return trans.run(iw)
diff --git a/stgit/commands/sink.py b/stgit/commands/sink.py
index 641ab7b..63be461 100644
--- a/stgit/commands/sink.py
+++ b/stgit/commands/sink.py
@@ -81,9 +81,7 @@ def func(parser, options, args):
else:
insert_idx = 0
applied = applied[:insert_idx] + patches + applied[insert_idx:]
-
unapplied = [p for p in stack.patchorder.unapplied if p not in patches]
- hidden = list(stack.patchorder.hidden)
iw = stack.repository.default_iw
clean_iw = (not options.keep and iw) or None
@@ -91,7 +89,7 @@ def func(parser, options, args):
check_clean_iw = clean_iw)
try:
- trans.reorder_patches(applied, unapplied, hidden, iw)
+ trans.reorder_patches(applied, unapplied, iw = iw)
except transaction.TransactionHalted:
pass
return trans.run(iw)
diff --git a/stgit/lib/transaction.py b/stgit/lib/transaction.py
index 4b5398a..b146648 100644
--- a/stgit/lib/transaction.py
+++ b/stgit/lib/transaction.py
@@ -365,8 +365,10 @@ class StackTransaction(object):
# Update immediately.
update()
- def reorder_patches(self, applied, unapplied, hidden, iw = None):
+ def reorder_patches(self, applied, unapplied, hidden = None, iw = None):
"""Push and pop patches to attain the given ordering."""
+ if hidden is None:
+ hidden = self.hidden
common = len(list(it.takewhile(lambda (a, b): a == b,
zip(self.applied, applied))))
to_pop = set(self.applied[common:])
next prev parent reply other threads:[~2009-03-17 11:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 11:08 [StGit PATCH 0/4] Reposting udpated patches Catalin Marinas
2009-03-17 11:08 ` [StGit PATCH 1/4] Add mergetool support to the classic StGit infrastructure Catalin Marinas
2009-03-17 15:29 ` Karl Hasselström
2009-03-17 11:08 ` [StGit PATCH 2/4] Add automatic git-mergetool invocation to the new infrastructure Catalin Marinas
2009-03-17 15:30 ` Karl Hasselström
2009-03-17 11:09 ` [StGit PATCH 3/4] Convert "float" to the lib infrastructure Catalin Marinas
2009-03-17 16:34 ` Karl Hasselström
2009-03-17 11:09 ` Catalin Marinas [this message]
2009-03-17 16:38 ` [StGit PATCH 4/4] Use a default "hidden" argument in StackTransaction.reorder_patches Karl Hasselström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090317110910.27748.80312.stgit@pc1117.cambridge.arm.com \
--to=catalin.marinas@arm.com \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
--cc=kha@treskal.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox