@ -20,9 +20,7 @@ import time
from third_party import upload
from third_party import upload
import urllib2
import urllib2
__pychecker__ = ' unusednames=breakpad '
import breakpad
import breakpad
__pychecker__ = ' '
# gcl now depends on gclient.
# gcl now depends on gclient.
from scm import SVN
from scm import SVN
@ -669,6 +667,7 @@ def defer_attributes(a, b):
def need_change ( function ) :
def need_change ( function ) :
""" Converts args -> change_info. """
""" Converts args -> change_info. """
# pylint: disable=W0612,W0621
def hook ( args ) :
def hook ( args ) :
if not len ( args ) == 1 :
if not len ( args ) == 1 :
ErrorExit ( " You need to pass a change list name " )
ErrorExit ( " You need to pass a change list name " )
@ -682,6 +681,7 @@ def need_change(function):
def need_change_and_args ( function ) :
def need_change_and_args ( function ) :
""" Converts args -> change_info. """
""" Converts args -> change_info. """
# pylint: disable=W0612,W0621
def hook ( args ) :
def hook ( args ) :
if not args :
if not args :
ErrorExit ( " You need to pass a change list name " )
ErrorExit ( " You need to pass a change list name " )
@ -694,6 +694,7 @@ def need_change_and_args(function):
def no_args ( function ) :
def no_args ( function ) :
""" Make sure no args are passed. """
""" Make sure no args are passed. """
# pylint: disable=W0612,W0621
def hook ( args ) :
def hook ( args ) :
if args :
if args :
ErrorExit ( " Doesn ' t support arguments " )
ErrorExit ( " Doesn ' t support arguments " )
@ -1041,8 +1042,8 @@ def CMDchange(args):
filename = line [ 7 : ]
filename = line [ 7 : ]
new_cl_files . append ( ( status , filename ) )
new_cl_files . append ( ( status , filename ) )
if ( not len ( change_info . _files) ) and ( not change_info . issue ) and \
if ( not len ( change_info . GetFiles( ) ) and not change_info . issue and
( not len ( new_description ) and ( not new_cl_files ) ) :
not len ( new_description ) and not new_cl_files ) :
ErrorExit ( " Empty changelist not saved " )
ErrorExit ( " Empty changelist not saved " )
change_info . _files = new_cl_files
change_info . _files = new_cl_files
@ -1143,7 +1144,7 @@ def CMDdeleteempties():
print " \n --- Deleting: "
print " \n --- Deleting: "
for cl in GetCLs ( ) :
for cl in GetCLs ( ) :
change_info = ChangeInfo . Load ( cl , GetRepositoryRoot ( ) , True , True )
change_info = ChangeInfo . Load ( cl , GetRepositoryRoot ( ) , True , True )
if not len ( change_info . _files ) :
if not len ( change_info . GetFiles( ) ) :
print change_info . name
print change_info . name
change_info . Delete ( )
change_info . Delete ( )
return 0
return 0
@ -1264,13 +1265,13 @@ def GenUsage(command):
more = getattr ( obj , ' usage ' , ' ' )
more = getattr ( obj , ' usage ' , ' ' )
if command == ' help ' :
if command == ' help ' :
display = ' <command> '
display = ' <command> '
need_change = ' '
need_change _val = ' '
if getattr ( obj , ' need_change ' , None ) :
if getattr ( obj , ' need_change ' , None ) :
need_change = ' <change_list> '
need_change _val = ' <change_list> '
options = ' [options] '
options = ' [options] '
if getattr ( obj , ' no_args ' , None ) :
if getattr ( obj , ' no_args ' , None ) :
options = ' '
options = ' '
res = ' Usage: gcl %s %s %s %s \n \n ' % ( display , need_change , options , more )
res = ' Usage: gcl %s %s %s %s \n \n ' % ( display , need_change _val , options , more )
res + = re . sub ( ' \n ' , ' \n ' , obj . __doc__ )
res + = re . sub ( ' \n ' , ' \n ' , obj . __doc__ )
return res
return res