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

commit service: using GitLab branch utils from heptapod.gitlab

One has found its final place, the other one has moved from
HGitaly's commit service to heptapod.gitlab
parent 6484beef
No related branches found
No related tags found
No related merge requests found
......@@ -13,4 +13,8 @@
from mercurial.utils import stringutil as hg_stringutil
from google.protobuf.timestamp_pb2 import Timestamp
from heptapod.gitlab.branch import (
branchmap_branch_from_gitlab_branch,
)
from hgext3rd.heptapod.branch import get_default_gitlab_branch
......@@ -16,6 +20,4 @@
from hgext3rd.heptapod.branch import get_default_gitlab_branch
# TODO move that to heptapod.gitlab
from hgext3rd.heptapod.git import parse_gitlab_branch
from ..stub.shared_pb2 import (
CommitAuthor,
......@@ -80,15 +82,6 @@
)
def gitlab_branch_to_branchmap_branch(gl_branch):
parsed = parse_gitlab_branch(gl_branch)
if parsed is None:
return None # could be a SHA, a bookmark or a tag
if parsed[1] is None:
return parsed[0]
return b':'.join(parsed)
class CommitServicer(CommitServiceServicer, HGitalyServicer):
def FindCommit(self,
......@@ -99,7 +92,7 @@
if revision == b'HEAD':
revision = get_default_gitlab_branch(repo)
try:
branchmap_key = gitlab_branch_to_branchmap_branch(revision)
branchmap_key = branchmap_branch_from_gitlab_branch(revision)
if branchmap_key is None:
ctx = scmutil.revsingle(repo, revision)
else:
......
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