Skip to content

Commit a1bbd1d

Browse files
committed
test: enable mercurial support
1 parent 63799c0 commit a1bbd1d

File tree

6 files changed

+21
-20
lines changed

6 files changed

+21
-20
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Uncomment all mercurial(hg) tests and make sure they pass.

lib/vcs_repo.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def push_current_branch(branch_name, remote = 'origin')
9696
when :git
9797
system("git push -u #{remote} #{branch_name}")
9898
when :hg
99-
system("hg push --rev #{branch_name}")
99+
system('hg', 'push', '--new-branch', '--rev', branch_name)
100100
when :bzr
101101
system('bzr push')
102102
when :fossil
@@ -472,7 +472,8 @@ def latest_agent_branch_commit
472472
`git log --all -E --grep='^Start-Agent-Branch:' -n 1 --pretty=%H`.strip
473473
when :hg
474474
revset = "reverse(grep('^Start-Agent-Branch:'))"
475-
`hg log -r #{revset} --limit 1 --template '{node}\n'`.strip
475+
out, = Open3.capture2('hg', 'log', '-r', revset, '--limit', '1', '--template', '{node}\n')
476+
out.strip
476477
when :fossil
477478
branch = current_branch
478479
escaped = branch.gsub("'", "''")

test/test_follow_up_tasks.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ class FollowUpGitTest < Minitest::Test
7171
VCS_TYPE = :git
7272
end
7373

74-
# These tests are temporarily disabled until we get git to work
75-
# class FollowUpHgTest < Minitest::Test
76-
# include RepoTestHelper
77-
# include FollowUpCases
78-
# VCS_TYPE = :hg
79-
# end
74+
class FollowUpHgTest < Minitest::Test
75+
include RepoTestHelper
76+
include FollowUpCases
77+
VCS_TYPE = :hg
78+
end
8079
#
8180
# class FollowUpFossilTest < Minitest::Test
8281
# include RepoTestHelper

test/test_get_task.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,11 @@ class GetTaskGitTest < Minitest::Test
103103
VCS_TYPE = :git
104104
end
105105

106-
# These tests are temporarily disabled until we get git to work
107-
# class GetTaskHgTest < Minitest::Test
108-
# include RepoTestHelper
109-
# include GetTaskCases
110-
# VCS_TYPE = :hg
111-
# end
106+
class GetTaskHgTest < Minitest::Test
107+
include RepoTestHelper
108+
include GetTaskCases
109+
VCS_TYPE = :hg
110+
end
112111
#
113112
# class GetTaskFossilTest < Minitest::Test
114113
# include RepoTestHelper

test/test_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ def setup_repo(vcs_type)
9696
hg(repo, 'commit', '-m', 'initial', '-u', 'Tester <[email protected]>')
9797
hgrc = File.join('.hg', 'hgrc')
9898
File.open(hgrc, 'a') do |f|
99+
f.puts '[ui]'
100+
f.puts 'username = Tester <[email protected]>'
99101
f.puts '[paths]'
100102
f.puts "default = #{remote}"
101103
end

test/test_start_task.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,11 @@ class StartTaskGitTest < Minitest::Test
268268
VCS_TYPE = :git
269269
end
270270

271-
# These tests are temporarily disabled until we get git to work
272-
# class StartTaskHgTest < Minitest::Test
273-
# include RepoTestHelper
274-
# include StartTaskCases
275-
# VCS_TYPE = :hg
276-
# end
271+
class StartTaskHgTest < Minitest::Test
272+
include RepoTestHelper
273+
include StartTaskCases
274+
VCS_TYPE = :hg
275+
end
277276
#
278277
# class StartTaskFossilTest < Minitest::Test
279278
# include RepoTestHelper

0 commit comments

Comments
 (0)