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

remote-mirrors: limit the values in create UI, with link to API

- we don't want users to create mirrors that aren't implemented yet
- we want the display of existing mirrors created through API to
  be correct.

--HG--
branch : heptapod
parent 324748197e36
Pipeline #13389 skipped with stages
......@@ -14,7 +14,9 @@
- if @project.mercurial?
.text-warning
%p
Both Git and Mercurial repositories are supported, however Git repos are limited to `push`.
Both Git and Mercurial repositories are supported, however Git repos are limited to `push` and Mercurial mirrors can be defined only through the
= link_to _('API'), help_page_path('api/remote_mirrors.md'), target: '_blank'
as of Heptapod 0.17.1
.settings-content
- if mirror_settings_enabled
......
......@@ -5,7 +5,7 @@
= label_tag :mirror_direction, _('Mirror direction'), class: 'label-light'
.select-wrapper
- if @project.mercurial?
= select_tag :mirror_direction, options_for_select([[_('Git push'), 'git-push'], [_('Hg pull'), 'hg-pull'], [_('Hg push'), 'hg-push']]), class: 'form-control select-control js-mirror-direction qa-mirror-direction'
= select_tag :mirror_direction, options_for_select([[_('Git push'), 'git-push']]), class: 'form-control select-control js-mirror-direction qa-mirror-direction'
- else
= select_tag :mirror_direction, options_for_select([[_('Git push'), 'git-push']]), class: 'form-control select-control js-mirror-direction qa-mirror-direction'
= icon('chevron-down')
......
......@@ -65,9 +65,23 @@ POST /projects/:id/remote_mirrors
| :---------- | :----- | :--------- | :------------ |
| `url` | String | yes | The URL of the remote repository to be mirrored. |
| `enabled` | Boolean | no | Determines if the mirror is enabled. |
| `hg_mirror_type` | String | no | Determines the mirror type (absent means Git Push) |
| `only_protected_branches` | Boolean | no | Determines if only protected branches are mirrored. |
| `keep_divergent_refs` | Boolean | no | Determines if divergent refs are skipped. |
The `hg_mirror_type` field is specific to Heptapod, and was introduced in Heptapod 0.17.1.
The possible values are:
- `null`: defaults to the upstream GitLab behaviour, hence push to a remote Git
repository (with `hg-git` conversion)
- `hg-pull`: pulls from a remote Mercurial repository. Does *not* take `only_protected_branches` nor `keep_divergent_refs`
into consideration as of Heptapod 0.17.1.
A future `hg-push` value is under consideration but hasn't been introduced yet.
Example request:
```shell
......
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