Add Mercurial support in rbt land.
Review Request #10678 — Created Sept. 2, 2019 and submitted
rbt land
has 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
rbt land
,
reworking some of the core landing and merging support and client
capability flags accordingly.Now,
rbt land
can 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.merge
now takes aclose_branch
argument, which is responsible for deleting/closing a branch. This
replaces a separate call toSCMClient.delete_branch()
, giving the
client more control of the order of operations.
MercurialClient
also has some new functionality to determine if a
reference identifies a branch, bookmark, tag, or revision, allowing us
to easily choose whether to interact withhg branch
,hg bookmark
, or
another command.This does not support
--push
at this time.
Unit tests pass.
Manually tested landing a Mercurial change from a review request, branch,
and bookmark, with and without editing commits.
Description | From | Last Updated |
---|---|---|
-l/--list appears to be Mercurial 5.0+ only. Aditionally, hg bookmark -q <rev> will update to that bookmark, which you probably … |
brennie | |
E703 statement ends with a semicolon |
reviewbot | |
E703 statement ends with a semicolon |
reviewbot | |
E703 statement ends with a semicolon |
reviewbot | |
E703 statement ends with a semicolon |
reviewbot |
-
-
-l
/--list
appears to be Mercurial 5.0+ only.Aditionally,
hg bookmark -q <rev>
will update to that bookmark, which you probably don't want to do.You can also do
hg log -r 'bookmark(REV)
which will return non-zero if REV is not a bookmark. By default it otputs the default template, but you can get less output with-q
.
- Change Summary:
-
- Switch bookmark and tag lookup to use
hg log
. Note that branches cannot be looked up the same way.
- Switch bookmark and tag lookup to use
- Commit:
-
ebfa00200ae05acd62f1c246c77a180c01578661128c51ba4398e06355c474758774feeebba78d9e