@@ -662,6 +662,7 @@ class Command:
662
662
def __init__ (self ):
663
663
self .usage = "usage: %prog [options]"
664
664
self .needsGit = True
665
+ self .verbose = False
665
666
666
667
class P4UserMap :
667
668
def __init__ (self ):
@@ -727,13 +728,9 @@ def loadUserMapFromCache(self):
727
728
class P4Debug (Command ):
728
729
def __init__ (self ):
729
730
Command .__init__ (self )
730
- self .options = [
731
- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ,
732
- default = False ),
733
- ]
731
+ self .options = []
734
732
self .description = "A tool to debug the output of p4 -G."
735
733
self .needsGit = False
736
- self .verbose = False
737
734
738
735
def run (self , args ):
739
736
j = 0
@@ -747,11 +744,9 @@ class P4RollBack(Command):
747
744
def __init__ (self ):
748
745
Command .__init__ (self )
749
746
self .options = [
750
- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ),
751
747
optparse .make_option ("--local" , dest = "rollbackLocalBranches" , action = "store_true" )
752
748
]
753
749
self .description = "A tool to debug the multi-branch import. Don't use :)"
754
- self .verbose = False
755
750
self .rollbackLocalBranches = False
756
751
757
752
def run (self , args ):
@@ -809,7 +804,6 @@ def __init__(self):
809
804
Command .__init__ (self )
810
805
P4UserMap .__init__ (self )
811
806
self .options = [
812
- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ),
813
807
optparse .make_option ("--origin" , dest = "origin" ),
814
808
optparse .make_option ("-M" , dest = "detectRenames" , action = "store_true" ),
815
809
# preserve the user, requires relevant p4 permissions
@@ -821,7 +815,6 @@ def __init__(self):
821
815
self .interactive = True
822
816
self .origin = ""
823
817
self .detectRenames = False
824
- self .verbose = False
825
818
self .preserveUser = gitConfig ("git-p4.preserveUser" ).lower () == "true"
826
819
self .isWindows = (platform .system () == "Windows" )
827
820
self .exportLabels = False
@@ -1644,7 +1637,6 @@ def __init__(self):
1644
1637
optparse .make_option ("--silent" , dest = "silent" , action = "store_true" ),
1645
1638
optparse .make_option ("--detect-labels" , dest = "detectLabels" , action = "store_true" ),
1646
1639
optparse .make_option ("--import-labels" , dest = "importLabels" , action = "store_true" ),
1647
- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ),
1648
1640
optparse .make_option ("--import-local" , dest = "importIntoRemotes" , action = "store_false" ,
1649
1641
help = "Import into refs/heads/ , not refs/remotes" ),
1650
1642
optparse .make_option ("--max-changes" , dest = "maxChanges" ),
@@ -1671,7 +1663,6 @@ def __init__(self):
1671
1663
self .importLabels = False
1672
1664
self .changesFile = ""
1673
1665
self .syncWithOrigin = True
1674
- self .verbose = False
1675
1666
self .importIntoRemotes = True
1676
1667
self .maxChanges = ""
1677
1668
self .isWindows = (platform .system () == "Windows" )
@@ -2712,9 +2703,7 @@ def __init__(self):
2712
2703
Command .__init__ (self )
2713
2704
self .options = [
2714
2705
optparse .make_option ("--import-labels" , dest = "importLabels" , action = "store_true" ),
2715
- optparse .make_option ("--verbose" , dest = "verbose" , action = "store_true" ),
2716
2706
]
2717
- self .verbose = False
2718
2707
self .importLabels = False
2719
2708
self .description = ("Fetches the latest revision from perforce and "
2720
2709
+ "rebases the current work (branch) against it" )
@@ -2911,16 +2900,16 @@ def main():
2911
2900
2912
2901
args = sys .argv [2 :]
2913
2902
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" ))
2917
2906
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 ())
2922
2911
2923
- (cmd , args ) = parser .parse_args (sys .argv [2 :], cmd );
2912
+ (cmd , args ) = parser .parse_args (sys .argv [2 :], cmd );
2924
2913
global verbose
2925
2914
verbose = cmd .verbose
2926
2915
if cmd .needsGit :
0 commit comments