@@ -662,6 +662,7 @@ class Command:
662662 def __init__ (self ):
663663 self .usage = "usage: %prog [options]"
664664 self .needsGit = True
665+ self .verbose = False
665666
666667class P4UserMap :
667668 def __init__ (self ):
@@ -727,13 +728,9 @@ def loadUserMapFromCache(self):
727728class P4Debug (Command ):
728729 def __init__ (self ):
729730 Command .__init__ (self )
730- self .options = [
731- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ,
732- default = False ),
733- ]
731+ self .options = []
734732 self .description = "A tool to debug the output of p4 -G."
735733 self .needsGit = False
736- self .verbose = False
737734
738735 def run (self , args ):
739736 j = 0
@@ -747,11 +744,9 @@ class P4RollBack(Command):
747744 def __init__ (self ):
748745 Command .__init__ (self )
749746 self .options = [
750- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ),
751747 optparse .make_option ("--local" , dest = "rollbackLocalBranches" , action = "store_true" )
752748 ]
753749 self .description = "A tool to debug the multi-branch import. Don't use :)"
754- self .verbose = False
755750 self .rollbackLocalBranches = False
756751
757752 def run (self , args ):
@@ -809,7 +804,6 @@ def __init__(self):
809804 Command .__init__ (self )
810805 P4UserMap .__init__ (self )
811806 self .options = [
812- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ),
813807 optparse .make_option ("--origin" , dest = "origin" ),
814808 optparse .make_option ("-M" , dest = "detectRenames" , action = "store_true" ),
815809 # preserve the user, requires relevant p4 permissions
@@ -821,7 +815,6 @@ def __init__(self):
821815 self .interactive = True
822816 self .origin = ""
823817 self .detectRenames = False
824- self .verbose = False
825818 self .preserveUser = gitConfig ("git-p4.preserveUser" ).lower () == "true"
826819 self .isWindows = (platform .system () == "Windows" )
827820 self .exportLabels = False
@@ -1644,7 +1637,6 @@ def __init__(self):
16441637 optparse .make_option ("--silent" , dest = "silent" , action = "store_true" ),
16451638 optparse .make_option ("--detect-labels" , dest = "detectLabels" , action = "store_true" ),
16461639 optparse .make_option ("--import-labels" , dest = "importLabels" , action = "store_true" ),
1647- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ),
16481640 optparse .make_option ("--import-local" , dest = "importIntoRemotes" , action = "store_false" ,
16491641 help = "Import into refs/heads/ , not refs/remotes" ),
16501642 optparse .make_option ("--max-changes" , dest = "maxChanges" ),
@@ -1671,7 +1663,6 @@ def __init__(self):
16711663 self .importLabels = False
16721664 self .changesFile = ""
16731665 self .syncWithOrigin = True
1674- self .verbose = False
16751666 self .importIntoRemotes = True
16761667 self .maxChanges = ""
16771668 self .isWindows = (platform .system () == "Windows" )
@@ -2712,9 +2703,7 @@ def __init__(self):
27122703 Command .__init__ (self )
27132704 self .options = [
27142705 optparse .make_option ("--import-labels" , dest = "importLabels" , action = "store_true" ),
2715- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ),
27162706 ]
2717- self .verbose = False
27182707 self .importLabels = False
27192708 self .description = ("Fetches the latest revision from perforce and "
27202709 + "rebases the current work (branch) against it" )
@@ -2911,16 +2900,16 @@ def main():
29112900
29122901 args = sys .argv [2 :]
29132902
2914- if len ( options ) > 0 :
2915- if cmd .needsGit :
2916- options .append (optparse .make_option ("--git-dir" , dest = "gitdir" ))
2903+ options . append ( optparse . make_option ( "--verbose" , dest = "verbose" , action = "store_true" ))
2904+ if cmd .needsGit :
2905+ options .append (optparse .make_option ("--git-dir" , dest = "gitdir" ))
29172906
2918- parser = optparse .OptionParser (cmd .usage .replace ("%prog" , "%prog " + cmdName ),
2919- options ,
2920- description = cmd .description ,
2921- formatter = HelpFormatter ())
2907+ parser = optparse .OptionParser (cmd .usage .replace ("%prog" , "%prog " + cmdName ),
2908+ options ,
2909+ description = cmd .description ,
2910+ formatter = HelpFormatter ())
29222911
2923- (cmd , args ) = parser .parse_args (sys .argv [2 :], cmd );
2912+ (cmd , args ) = parser .parse_args (sys .argv [2 :], cmd );
29242913 global verbose
29252914 verbose = cmd .verbose
29262915 if cmd .needsGit :
0 commit comments