Yujie Wu avatar Yujie Wu committed bd6f8db

Refactored code: Have options cleaned in one place (previously this was done in various places).

Comments (0)

Files changed (1)

         except IndexError :
             raise AbortFlow( "You must specify a name for the new branch to start." )
             
-        kwarg    = _getopt( self.ui, "start", kwarg )
         rev      = kwarg.pop( "rev",     None )
         msg      = kwarg.pop( "message", ""   )
         dirty    = kwarg.pop( "dirty",   None )
         @param stream: Stream of which you want to display open branches
         """
         # Lists all open branches in this stream.
-        kwarg         = _getopt( self.ui, "list", kwarg )
         open_branches = stream.branches()
         trunk         = stream.trunk()
         if (trunk) :
         # User may specify a file with a relative path name. Since CWD has changed to the repository's root dir when the
         # `Flow' object was constructed, we need to restore the original dir to get the correct path name of the file.
         os.chdir( self.orig_dir )
-        kwarg     = _getopt( self.ui, "log", kwarg )
         filenames = kwarg.pop( "file", [] )
         onstream  = kwarg.pop( "onstream", False )
         closed    = kwarg.pop( "closed",   False )
         @type  stream: C{Stream}
         @param stream: Stream where the branch which you want to abort is
         """
-        kwarg          = _getopt( self.ui, "abort", kwarg )
         msg            = kwarg.pop( "message",  ""    )
         should_erase   = kwarg.pop( "erase",    False )
         onstream       = kwarg.pop( "onstream", False )
         @param    rev: If provided, promote this revision instead of the head. The specified revision must be in the workspace
                        branch.
         """
-        kwarg          = _getopt( self.ui, "promote", kwarg )
         rev            = kwarg.pop( "rev",     None )
         tag_name       = kwarg.pop( "tag",     None )
         message        = kwarg.pop( "message", None )
                        branch, otherwise it will trigger an error. If not provided, use the tip of the parent branch as the
                        destination of rebasing.
         """
-        kwarg    = _getopt( self.ui, "rebase", kwarg )
         dest     = kwarg.get( "dest" )
         onstream = kwarg.pop( "onstream", False )
         if (onstream) :
         except IndexError :
             tag_name = None
 
-        kwarg          = _getopt( self.ui, "finish", kwarg )
         message        = kwarg.get( "message",  None  )
         onstream       = kwarg.pop( "onstream", False )
         should_erase   = kwarg.pop( "erase",    False )
                 self._print( "autoshelve: %s" % ("on" if (autoshelve) else "off"), prefix = "  " )
 
         # Shall we continue if there already exists a configuration file?
-        kwarg = _getopt( self.ui, "init", kwarg )
         if (has_goodconfig and not kwarg.get( "force" )) :
             return
 
     commands.reg_common_options( common_opts )
 
     try :
-        # If `cmd' is a command (instead of an action), checks the options for it.
-        if (cmd in func) :
-            _getopt( ui, cmd, kwarg )
+        # Checks the options for all commands and actions.
+        kwarg = _getopt( ui, cmd, kwarg )
         
         func = func.get( cmd, lambda *arg, **kwarg : flow.action( cmd, *arg, **kwarg ) )
         func( *arg, **kwarg )
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.