This instance will be upgraded to Heptapod 0.25.0 (final) on 2021-09-22 at 15:00 UTC+2 (a few minutes of down time)

Commit cd3f2056 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

GitalyClient::MercurialRepositoryService: first implementation

The immediate goal is to prove that we can call HGitaly-specific
services. RSpec test will be provided once hooked in a repository
class.

--HG--
branch : heptapod
parent 312c2fa31b3d
# frozen_string_literal: true
module Gitlab
module GitalyClient
class MercurialRepositoryService
include Gitlab::EncodingHelper
# 'repository' is a Mercurial subclass of Gitlab::Git::Repository
def initialize(repository)
@repository = repository
@gitaly_repo = repository.gitaly_repository
@storage = Gitlab::GitalyClient.vcs_qualified_storage(
repository.storage, 'hg')
end
def config_item_bool(section, item)
request = Hgitaly::GetConfigItemRequest.new(
repository: @gitaly_repo,
section: section,
name: item,
as_type: Hgitaly::ConfigItemType::BOOL
)
response = GitalyClient.call(
@storage, :mercurial_repository_service, :get_config_item, request,
timeout: GitalyClient.fast_timeout
)
response.as_bool
end
end
end
end
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