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

WIP Fully native Mercurial without Git: diversions

These shortcuts are enough to make the functional tests pass, but
some of them are obviously unacceptable, while some other ones
can be kept until the corresponding feature is ready for implementation.

This changeset is supposed to shrink until there are only acceptable
diversions, at which point we can consider publishing it and go
to the next step: more testing of the `hgitaly2` branch and final merge
into the main `heptapod` development branch.

--HG--
branch : hgitaly2
parent 1d2cfcbcbf8a
Pipeline #28527 passed with stages
in 10 minutes and 18 seconds
......@@ -6,6 +6,11 @@ module BlobLanguageFromGitAttributes
def language_from_gitattributes
return unless repository&.exists?
if repository.hg_fully_native? && !repository.hg_with_git?
Gitlab::AppLogger.warn("diverted language_from_git_attributes(), as Mercurial projects don't have attributes yet, see heptapod#437")
return
end
repository.gitattribute(path, 'gitlab-language')
end
end
......@@ -395,6 +395,11 @@ def fully_expanded?
private
def diffable_by_attribute?
if repository.hg_fully_native?
Gitlab::AppLogger.warn("diverted Diff::File#diffable_by_attribute?(), as Mercurial projects don't have attributes yet, see heptapod#437")
return false
end
repository.attributes(file_path).fetch('diff') { true }
end
......
......@@ -187,6 +187,11 @@ def decorate(repository, commit, ref = nil)
end
def shas_with_signatures(repository, shas)
if repository.hg_fully_native?
Gitlab::AppLogger.info("diverted Git::Commit#shas_with_signatures(), as no changeset signature system is currently implemented in Heptapod, see heptapod#553")
return []
end
Gitlab::GitalyClient::CommitService.new(repository).filter_shas_with_signatures(shas)
end
......
......@@ -245,6 +245,26 @@ def set_full_path(full_path:)
gitaly_repository_client.set_full_path(full_path)
end
def languages(ref = nil)
return super(ref) if hg_with_git?
Gitlab::AppLogger.warn("diverted languages(), remove when hgitaly#12 is ready")
# inspired from spec/lib/gitlab/language_detection_spec.rb
[{ value: 100.0, label: "Ruby", color: "#701516", highlight: "#701516" }]
end
def copy_gitattributes(ref)
return super(ref) if hg_with_git?
Gitlab::AppLogger.warn("diverted copy_gitattributes(), remove when hgitaly#82 is ready")
end
def clean_stale_repository_files
return super if hg_with_git?
Gitlab::AppLogger.info("Doing nothing for clean_stale_repository_files, as currently irrelevant for Mercurial, see hgitaly#85")
end
# Provides access to the auxiliary Git repository for special case.
# Will be eventually removed, once all Mercurial native projects are
# fully native with no feature flag
......
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