|
|
DescriptionAutomatically adds quotes on Windows when necessary
So that a command like
"git config rietveld.viewvc-url http://src.chromium.org/viewvc/chrome?view=rev&revision="
works fine.
Fix the description automatically generated for the hooks to be using the same
code than for the one presented to the user.
R=cmp@chromium.org
BUG=
TEST=Tested manually on cygwin, win32, linux
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=138874
Patch Set 1 #
Total comments: 4
Patch Set 2 : Fix test #Messages
Total messages: 7 (0 generated)
lgtm https://chromiumcodereview.appspot.com/10447021/diff/1/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/10447021/diff/1/git_cl.py#newcode54 git_cl.py:54: def QuoteCommand(command): i think we're going to pay for this later, but i support your efforts now https://chromiumcodereview.appspot.com/10447021/diff/1/git_cl.py#newcode548 git_cl.py:548: description = CreateDescriptionFromLog([upstream_branch + '..']) .strip() was called before on this result, but now it's gone in the new code path, not wanted?
https://chromiumcodereview.appspot.com/10447021/diff/1/git_cl.py File git_cl.py (right): https://chromiumcodereview.appspot.com/10447021/diff/1/git_cl.py#newcode54 git_cl.py:54: def QuoteCommand(command): On 2012/05/24 19:35:33, cmp wrote: > i think we're going to pay for this later, but i support your efforts now I know. For example of fun, see: http://twistedmatrix.com/trac/ticket/3933 Note that I don't quote '()' here because it wasn't necessary yet. I tested with ^, one regexp uses it, and it worked fine. https://chromiumcodereview.appspot.com/10447021/diff/1/git_cl.py#newcode548 git_cl.py:548: description = CreateDescriptionFromLog([upstream_branch + '..']) On 2012/05/24 19:35:33, cmp wrote: > .strip() was called before on this result, but now it's gone in the new code > path, not wanted? It doesn't matter in this specific case.
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/maruel@chromium.org/10447021/1
Presubmit check for 10447021-1 failed and returned exit status 1. warning: code.google.com certificate with fingerprint 8e:ab:3a:93:45:99:6b:95:07:71:7a:c2:1f:68:90:af:78:a9:3c:9a not verified (check hostfingerprints or web.cacerts config setting) Running presubmit commit checks ... Checking out rietveld... Running push-basic.sh Running save-description-on-failure.sh Running basic.sh Running upload-stale.sh Running upload-local-tracking-branch.sh Running patch.sh Running submit-from-new-dir.sh Running post-dcommit-hook-test.sh Running hooks.sh Running abandon.sh Running upstream.sh ** Presubmit ERRORS ** tests/git_cl_test.py failed! Command tests/git_cl_test.py returned non-zero exit status 1 in /mnt/data/b/commit-queue/workdir/tools/depot_tools ...FFFFFFFFF ====================================================================== FAIL: test_gerrit_no_reviewer (__main__.TestGitCl) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_cl_test.py", line 387, in test_gerrit_no_reviewer []) File "tests/git_cl_test.py", line 381, in _run_gerrit_reviewer_test git_cl.main(['upload'] + upload_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1556, in main return command(parser, argv[1:]) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1113, in CMDupload author=None) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 563, in RunHook change = self.GetChange(upstream_branch, author) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 548, in GetChange description = CreateDescriptionFromLog([upstream_branch + '..']) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 893, in CreateDescriptionFromLog return RunGit(['log', '--pretty=format:%s%n%n%b'] + log_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 79, in RunGit return RunCommand(['git'] + args, **kwargs) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 68, in RunCommand return subprocess2.check_output(QuoteCommand(args), **kwargs) File "tests/git_cl_test.py", line 91, in _mocked_call self._calls_done, expected_args, args)) AssertionError: @12 Expected: (['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],) Actual: (['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],) ====================================================================== FAIL: test_gerrit_reviewer_multiple (__main__.TestGitCl) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_cl_test.py", line 399, in test_gerrit_reviewer_multiple ['reviewer@example.com', 'another@example.com']) File "tests/git_cl_test.py", line 381, in _run_gerrit_reviewer_test git_cl.main(['upload'] + upload_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1556, in main return command(parser, argv[1:]) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1113, in CMDupload author=None) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 563, in RunHook change = self.GetChange(upstream_branch, author) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 548, in GetChange description = CreateDescriptionFromLog([upstream_branch + '..']) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 893, in CreateDescriptionFromLog return RunGit(['log', '--pretty=format:%s%n%n%b'] + log_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 79, in RunGit return RunCommand(['git'] + args, **kwargs) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 68, in RunCommand return subprocess2.check_output(QuoteCommand(args), **kwargs) File "tests/git_cl_test.py", line 91, in _mocked_call self._calls_done, expected_args, args)) AssertionError: @12 Expected: (['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],) Actual: (['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],) ====================================================================== FAIL: test_gerrit_reviewers_cmd_line (__main__.TestGitCl) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_cl_test.py", line 393, in test_gerrit_reviewers_cmd_line ['foo@example.com']) File "tests/git_cl_test.py", line 381, in _run_gerrit_reviewer_test git_cl.main(['upload'] + upload_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1556, in main return command(parser, argv[1:]) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1113, in CMDupload author=None) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 563, in RunHook change = self.GetChange(upstream_branch, author) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 548, in GetChange description = CreateDescriptionFromLog([upstream_branch + '..']) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 893, in CreateDescriptionFromLog return RunGit(['log', '--pretty=format:%s%n%n%b'] + log_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 79, in RunGit return RunCommand(['git'] + args, **kwargs) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 68, in RunCommand return subprocess2.check_output(QuoteCommand(args), **kwargs) File "tests/git_cl_test.py", line 91, in _mocked_call self._calls_done, expected_args, args)) AssertionError: @12 Expected: (['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],) Actual: (['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],) ====================================================================== FAIL: test_no_reviewer (__main__.TestGitCl) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_cl_test.py", line 253, in test_no_reviewer []) File "tests/git_cl_test.py", line 245, in _run_reviewer_test git_cl.main(['upload'] + upload_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1556, in main return command(parser, argv[1:]) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1113, in CMDupload author=None) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 563, in RunHook change = self.GetChange(upstream_branch, author) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 548, in GetChange description = CreateDescriptionFromLog([upstream_branch + '..']) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 893, in CreateDescriptionFromLog return RunGit(['log', '--pretty=format:%s%n%n%b'] + log_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 79, in RunGit return RunCommand(['git'] + args, **kwargs) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 68, in RunCommand return subprocess2.check_output(QuoteCommand(args), **kwargs) File "tests/git_cl_test.py", line 91, in _mocked_call self._calls_done, expected_args, args)) AssertionError: @12 Expected: (['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],) Actual: (['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],) ====================================================================== FAIL: test_reviewer_multiple (__main__.TestGitCl) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_cl_test.py", line 285, in test_reviewer_multiple ['--reviewers', 'reviewer@example.com,another@example.com']) File "tests/git_cl_test.py", line 245, in _run_reviewer_test git_cl.main(['upload'] + upload_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1556, in main return command(parser, argv[1:]) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1113, in CMDupload author=None) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 563, in RunHook change = self.GetChange(upstream_branch, author) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 548, in GetChange description = CreateDescriptionFromLog([upstream_branch + '..']) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 893, in CreateDescriptionFromLog return RunGit(['log', '--pretty=format:%s%n%n%b'] + log_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 79, in RunGit return RunCommand(['git'] + args, **kwargs) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 68, in RunCommand return subprocess2.check_output(QuoteCommand(args), **kwargs) File "tests/git_cl_test.py", line 91, in _mocked_call self._calls_done, expected_args, args)) AssertionError: @12 Expected: (['git', 'log', '--pretty=format:%s%n%n%b', 'master...'],) Actual: (['git', 'log', '--pretty=format:%s%n%n%b', 'master..'],) ====================================================================== FAIL: test_reviewer_send_mail (__main__.TestGitCl) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_cl_test.py", line 295, in test_reviewer_send_mail ['--reviewers', 'reviewer@example.com', '--send_mail']) File "tests/git_cl_test.py", line 245, in _run_reviewer_test git_cl.main(['upload'] + upload_args) File "/mnt/data/b/commit-queue/workdir/tools/depot_tools/git_cl.py", line 1556, in main return command(parser, argv[1:]) File "/mnt/data/b/commit-q… (message too large)
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/maruel@chromium.org/10447021/8001
Change committed as 138874 |