Eliminate temp variable that's used just once
authorKarl Hasselström <kha@treskal.com>
Mon, 28 Jan 2008 21:20:09 +0000 (22:20 +0100)
committerKarl Hasselström <kha@treskal.com>
Tue, 29 Jan 2008 03:26:13 +0000 (04:26 +0100)
Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/lib/transaction.py

index 809eabf..6a2ed81 100644 (file)
@@ -174,7 +174,6 @@ class StackTransaction(object):
         """Attempt to push the named patch. If this results in conflicts,
         halts the transaction. If index+worktree are given, spill any
         conflicts to them."""
-        i = self.unapplied.index(pn)
         cd = self.patches[pn].data
         cd = cd.set_committer(None)
         s = ['', ' (empty)'][cd.is_nochange()]
@@ -203,7 +202,7 @@ class StackTransaction(object):
                 s = ' (conflict)'
         cd = cd.set_tree(tree)
         self.patches[pn] = self.__stack.repository.commit(cd)
-        del self.unapplied[i]
+        del self.unapplied[self.unapplied.index(pn)]
         self.applied.append(pn)
         out.info('Pushed %s%s' % (pn, s))
         if merge_conflict: