Correctly identify the parent branch (bug #10014)
[stgit] / stgit / commands / float.py
index 4da5f59..0ba4446 100644 (file)
@@ -24,13 +24,14 @@ from stgit.utils import *
 from stgit import stack, git
 
 help = 'push patches to the top, even if applied'
-usage = """%prog [options] [<patches> | <series>]
+usage = """%prog [<patches> | -s [<series>] ]
 
 Push a patch or a range of patches to the top even if applied. The
 necessary pop and push operations will be performed to accomplish
 this. The '--series' option can be used to rearrange the (top) patches
 as specified by the given series file (or the standard input)."""
 
+directory = DirectoryGotoToplevel()
 options = [make_option('-s', '--series',
                        help = 'rearrange according to a series file',
                        action = 'store_true')]
@@ -45,7 +46,7 @@ def func(parser, options, args):
 
     check_local_changes()
     check_conflicts()
-    check_head_top_equal()
+    check_head_top_equal(crt_series)
 
     unapplied = crt_series.get_unapplied()
     applied = crt_series.get_applied()
@@ -84,7 +85,7 @@ def func(parser, options, args):
     # check whether the operation is really needed
     if topop != topush:
         if topop:
-            pop_patches(topop)
+            pop_patches(crt_series, topop)
         if topush:
             topush.reverse()
-            push_patches(topush)
+            push_patches(crt_series, topush)