Skip to content
Snippets Groups Projects
Commit d0467b93 authored by Georges Racinet's avatar Georges Racinet :squid:
Browse files

StateMaintainer: new `native` property

This is obviously to reduce duplication. It is worthwile to note
that in Heptapod 17.7, it will be equivalent to which subclass is in use
(we still use `HeptapodGitHandler` for native projects with mirrors to Git
in Heptapod 17.6).
That is why we preferred using a property, as it can simply be replaced by
a class attribute later on.
parent adb5d496
Branches
Tags
2 merge requests!114Merged fixes of 4.8.1,!113Wikis: forcing the default branch if native
......@@ -119,6 +119,10 @@
# Methods relying on the expected implemented methods
#
@property
def native(self):
return self.repo.ui.configbool(b'heptapod', b'native')
def is_wiki(self):
"""Tell whether self.repo is the storage for a GitLab wiki"""
return (self.repo.ui.environ.get(b'GL_REPOSITORY', b'')
......@@ -815,7 +819,7 @@
prune_default_branch = to_prune.pop(default_git_branch, None)
if (
prune_default_branch
and ui.configbool(b'heptapod', b'native')
and self.native
and default_git_branch.startswith(b'branch/')
):
msg = (b"These changes close or prune the Heptapod default "
......@@ -936,7 +940,7 @@
return
ui = self.repo.ui
native = ui.configbool(b'heptapod', b'native')
native = self.native
ui.note(b"heptapod_notify_gitlab heptapod.native=%r" % native)
if native and prune_reasons:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment