Skip to content

Commit

Permalink
changed single to double quotes for Windows
Browse files Browse the repository at this point in the history
When getting the current revision from Mercurial on Windows the
following command:

  "hg log -r tip --template '{node|short}'"

fails due to the single quotes not being escaped. To make this
command run properly on Windows, I modified it to the following:

  "hg log -r tip --template \"{node|short}\""

This change seems to be safe on Windows 7, Mac OS X 10.7.2, and
Ubuntu 11.10.
  • Loading branch information
Matthew J. Morrison committed Jan 11, 2012
1 parent a66ea8d commit 716f8f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/capistrano/recipes/deploy/scm/mercurial.rb
Expand Up @@ -59,7 +59,7 @@ def query_revision(changeset)
cmd = scm :log,
verbose,
"-r #{changeset}",
"--template '{node|short}'"
'--template "{node|short}"'
yield cmd
end

Expand Down
2 changes: 1 addition & 1 deletion test/deploy/scm/mercurial_test.rb
Expand Up @@ -39,7 +39,7 @@ def test_log
end

def test_query_revision
assert_equal "hg log -r 8a8e00b8f11b --template '{node|short}'", @source.query_revision('8a8e00b8f11b') { |o| o }
assert_equal "hg log -r 8a8e00b8f11b --template \"{node|short}\"", @source.query_revision('8a8e00b8f11b') { |o| o }
end

def test_username_should_be_backwards_compatible
Expand Down

0 comments on commit 716f8f9

Please sign in to comment.