diff --git a/docs/usage/general.rst b/docs/usage/general.rst --- a/docs/usage/general.rst +++ b/docs/usage/general.rst @@ -70,31 +70,32 @@ Creating a pull request (and its ancestors) by selecting it and clicking the ``Open new pull request for selected changesets`` button. -Non changeable repository urls ------------------------------- +Permanent repository URLs +------------------------- Due to the complicated nature of repository grouping, URLs of repositories -can often change. - -example:: +can often change. For example, a repository originally accessible from:: - #before http://server.com/repo_name - # after insertion to test_group group the url will be + +would get a new URL after moving it to test_group:: + http://server.com/test_group/repo_name -This can be an issue for build systems and any other hardcoded scripts, moving -a repository to a group leads to a need for changing external systems. To -overcome this Kallithea introduces a non-changable replacement URL. It's -simply a repository ID prefixed with ``_``. The above URLs are also accessible as:: +Such moving of a repository to a group can be an issue for build systems and +other scripts where the repository paths are hardcoded. To mitigate this, +Kallithea provides permanent URLs using the repository ID prefixed with an +underscore. In all Kallithea URLs, for example those for the changelog and the +file view, a repository name can be replaced by this ``_ID`` string. Since IDs +are always the same, moving the repository to a different group will not affect +such URLs. + +In the example, the repository could also be accessible as:: http://server.com/_ -Since IDs are always the same, moving the repository will not affect -such a URL. the ``_`` syntax can be used anywhere in the system so -URLs with ``repo_name`` for changelogs and files can be exchanged -with the ``_`` syntax. - +The ID of a given repository can be shown from the repository ``Summary`` page, +by selecting the ``Show by ID`` button next to ``Clone URL``. E-mail notifications -------------------- diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -154,7 +154,7 @@ class BaseVCSController(object): def _get_by_id(self, repo_name): """ Gets a special pattern _ from clone url and tries to replace it - with a repository_name for support of _ non changeable urls + with a repository_name for support of _ permanent URLs :param repo_name: """ diff --git a/kallithea/templates/admin/repos/repo_edit_settings.html b/kallithea/templates/admin/repos/repo_edit_settings.html --- a/kallithea/templates/admin/repos/repo_edit_settings.html +++ b/kallithea/templates/admin/repos/repo_edit_settings.html @@ -8,12 +8,12 @@
${h.text('repo_name',class_="medium")} - ${_('Non-changeable id')}: `_${c.repo_info.repo_id}` ${_('What is that?')} + ${_('Permanent Repository ID')}: `_${c.repo_info.repo_id}` ${_('What is that?')} + Using the above permanent URL guarantees that this repository always will be accessible on that URL. + This is useful for CI systems, or any other cases that you need to hardcode the URL into a 3rd party service.''')}