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

servicer: split out relative path normalization

It has already been the case in Heptapod that relative path in
Gitaly Repository messages were to be passed as if the repository
was a Git repository (hence ending in `.git`) and then to be
normalized as `.hg` for Mercurial operation. But this is due
to the legacy hg-git based integration, and could not be necessary
in some future.

Meanwhile, we'll need to reuse the logic for working directories.
parent 081e8130
No related branches found
No related tags found
2 merge requests!151heptapod#743: making 0.36 the new stable,!145Pool of repository working directories
......@@ -47,6 +47,13 @@
generation, time.time() - start, gc_result, gc.get_stats())
def normalize_rpath(gl_repo: Repository):
rpath = gl_repo.relative_path
if rpath.endswith('.git'):
rpath = rpath[:-4] + '.hg'
return rpath
class HGitalyServicer:
"""Common features of all HGitaly services.
......@@ -182,10 +189,7 @@
return root_dir
def repo_disk_path(self, repository: Repository, context):
rpath = repository.relative_path
if rpath.endswith('.git'):
rpath = rpath[:-4] + '.hg'
rpath = normalize_rpath(repository)
root_dir = self.storage_root_dir(repository.storage_name, context)
# GitLab filesystem paths are always ASCII
......
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