Commit 07ce9147 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Project model: easy boolean to check for Mercurial

This anticipates a bit on the future `"hg"` value for `vcs_type`,
but it's easy to use from various parts of the code.

--HG--
branch : heptapod
parent ee9dd0963a32
......@@ -38,6 +38,7 @@ class Project < ApplicationRecord
BoardLimitExceeded = Class.new(StandardError)
STATISTICS_ATTRIBUTE = 'repositories_count'.freeze
MERCURIAL_VCS_TYPES = ["hg", "hg_git"].freeze
UNKNOWN_IMPORT_URL = 'http://unknown.git'.freeze
# Hashed Storage versions handle rolling out new storage to project and dependents models:
# nil: legacy
......@@ -691,6 +692,10 @@ def daily_statistics_enabled?
Feature.enabled?(:project_daily_statistics, self, default_enabled: true)
end
def mercurial?
return MERCURIAL_VCS_TYPES.include?(vcs_type)
end
def empty_repo?
repository.empty?
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