Design merging methods
HGitaly will need to provide methods to support the merge operations, currently implemented in the Rails app as methods merge
and ff_merge
of Gitlab::Mercurial::HgGitRepository
.
The corresponding methods in Gitaly are on the OperationService
: UserMergeToRef
, UserMergeBranch
, UserFFBranch
etc, but I'm afraid that simply implementing them for Mercurial could be semantically inappropriate: we have Git-only concepts in UserMergeToRef
and on the other hand, we lack expression of the Mercurial concepts (phases, notably).
As an example, for a high-level merge operation, it's probably acceptable to let HGitaly infer by itself that a merge into a topic should not give rise to a publication, and I can find solutions for such questions on a case-per-case basis, especially if we have separate methods to handle phases. Still, wouldn't we better off with a separate service?