From 2896eda9ae2d78990c61ce6104af6d6351bacfd3 Mon Sep 17 00:00:00 2001 From: "asvitkine@chromium.org" Date: Wed, 5 Oct 2011 05:38:37 +0000 Subject: [PATCH] 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 --- gcl.py | 3 --- git_try.py | 2 +- trychange.py | 9 ++++++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gcl.py b/gcl.py index 72a83fdc8..8df5de1bc 100755 --- a/gcl.py +++ b/gcl.py @@ -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' diff --git a/git_try.py b/git_try.py index 27eafba37..9435fe78c 100755 --- a/git_try.py +++ b/git_try.py @@ -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 ' diff --git a/trychange.py b/trychange.py index bd81e074c..eae4ab414 100755 --- a/trychange.py +++ b/trychange.py @@ -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))