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

User feedback when default GitLab branch should be pruned

As explained in the commment we cannot prune yet directly,
the user feedback should help users check that it disappears later on.
parent 36fe09f5f276
No related branches found
No related tags found
1 merge request!107Edge cases with a topic as default Heptapod branch
Pipeline #86567 canceled
......@@ -29,6 +29,7 @@
)
from heptapod.gitlab.branch import (
TopicNameSpaceUnsupported,
branch_is_topic,
gitlab_branch_from_ref,
gitlab_branch_ref,
parse_branchmap_branch,
......@@ -822,6 +823,27 @@
ui.note(msg)
raise error.Abort(msg)
if prune_default_branch and branch_is_topic(default_git_branch):
# we cannot put it back on current Heptapod, because GitLab
# will refuse at the PreReceive stage (default branch deletion,
# and even circumventing that is not enough, as it is also
# protected). At some point we might introduce a new
# Mercurial-specific message (alongside prune reasons),
# so that GitLab can understand
# that it is acceptable with certainty.
self.ui.status(
b"These changes should make the current "
b"default Heptapod branch '%(br)s' disappear. This is "
b"fine for a topic, as long as a suitable replacement "
b"can be inferred from them (preferably a long-lasting "
b"value such as 'branch/default').\n"
b"However, sometimes the topic does not disappear "
b"server-side as it should. If that is "
b"the case, you may need to unprotect %(br)s "
b"in Settings > Repository > Protected Branches "
b"and subsequent pushes should clean finally clean it."
)
prune_reasons, changes = self.generate_prune_changes(to_prune,
existing)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment