Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.0 on 2022-01-18 at 14:00 UTC+1 (a few minutes of down time)

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.

branch : heptapod
parent ee9dd0963a32
......@@ -38,6 +38,7 @@ class Project < ApplicationRecord
BoardLimitExceeded =
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)
def mercurial?
return MERCURIAL_VCS_TYPES.include?(vcs_type)
def empty_repo?
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