Add Mercurial support in rbt land.
Review Request #10678 — Created Sept. 2, 2019 and submitted — Latest diff uploaded
rbt landhas historically only worked with Git, and had some Gitisms
in its implementation. For instance, it assumed that after merging a
branch, the branch would always be deleted as a separate step, unrelated
to the merge, which isn't the case with traditional branches in
Mercurial (you'd close the branch as a separate operation). This, along
with the differences between branches and bookmarks, made it a little
wonky to support Mercurial.
This change introduces full support for Mercurial in
reworking some of the core landing and merging support and client
capability flags accordingly.
rbt landcan correctly land changes living in review requests, in
branches, or in bookmarks to a destination branch. This works much like
it does for Git, from a user's perspective, with the exception that
commits won't be squashed in Mercurial. This could theoretically be
added, but seems to go against the spirit of Mercurial a bit.
Behind the scenes,
SCMClient.mergenow takes a
argument, which is responsible for deleting/closing a branch. This
replaces a separate call to
SCMClient.delete_branch(), giving the
client more control of the order of operations.
MercurialClientalso has some new functionality to determine if a
reference identifies a branch, bookmark, tag, or revision, allowing us
to easily choose whether to interact with
hg bookmark, or
This does not support
--pushat this time.
Unit tests pass.
Manually tested landing a Mercurial change from a review request, branch,
and bookmark, with and without editing commits.