Remove |file_list| parameter from |TryChange()|.

BUG=none
TEST=Run unit tests - they should still pass. Run gcl try and git try and make sure there are no errors.

Review URL: http://codereview.chromium.org/8133001

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@104067 0039d316-1c4b-4281-b951-d872f2087c98
parent a91d26de
......@@ -960,7 +960,6 @@ def TryChange(change_info, args, swallow_exception):
trychange_args.extend(["--issue", str(change_info.issue)])
if change_info.patchset:
trychange_args.extend(["--patchset", str(change_info.patchset)])
file_list = change_info.GetFileNames()
change = presubmit_support.SvnChange(change_info.name,
change_info.description,
change_info.GetLocalRoot(),
......@@ -969,14 +968,12 @@ def TryChange(change_info, args, swallow_exception):
change_info.patchset,
None)
else:
file_list = []
change = None
trychange_args.extend(args)
return trychange.TryChange(
trychange_args,
change=change,
file_list=file_list,
swallow_exception=swallow_exception,
prog='gcl try',
extra_epilog='\n'
......
......@@ -57,7 +57,7 @@ if __name__ == '__main__':
cl = git_cl.Changelist()
change = cl.GetChange(cl.GetUpstreamBranch(), None)
sys.exit(trychange.TryChange(
args, change, file_list=[], swallow_exception=False,
args, change, swallow_exception=False,
prog='git try',
extra_epilog='\n'
'git try will diff against your tracked branch and will '
......
......@@ -490,16 +490,19 @@ def GetMungedDiff(path_diff, diff):
def TryChange(argv,
change,
file_list,
swallow_exception,
prog=None,
extra_epilog=None):
"""
Args:
argv: Arguments and options.
file_list: Default value to pass to --file.
change: Change instance corresponding to the CL.
swallow_exception: Whether we raise or swallow exceptions.
"""
file_list = []
if change:
file_list = [f.LocalPath() for f in change.AffectedFiles()]
# Parse argv
parser = optparse.OptionParser(usage=USAGE,
version=__version__,
......@@ -806,4 +809,4 @@ def TryChange(argv,
if __name__ == "__main__":
fix_encoding.fix_encoding()
sys.exit(TryChange(None, None, [], False))
sys.exit(TryChange(None, None, False))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment