diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -422,6 +422,17 @@ def branch(repo, subset, x): s = set(s) return [r for r in subset if r in s or repo[r].branch() in b] +def bumped(repo, subset, x): + """``bumped()`` + Mutable changesets marked as successors of public changesets. + + Only non-public and non-obsolete changesets can be `bumped`. + """ + # i18n: "bumped" is a keyword + getargs(x, 0, 0, _("bumped takes no arguments")) + bumped = obsmod.getrevs(repo, 'bumped') + return [r for r in subset if r in bumped] + def checkstatus(repo, subset, pat, field): m = None s = [] @@ -1492,6 +1503,7 @@ symbols = { "bookmark": bookmark, "branch": branch, "branchpoint": branchpoint, + "bumped": bumped, "children": children, "closed": closed, "contains": contains, diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -155,6 +155,22 @@ Check that public changeset are not acco summary: add a +And that bumped changeset are detected +-------------------------------------- + +If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also +note that the bumped changeset (5:5601fb93a350) is not a direct successor of +the public changeset + + $ hg log --hidden -r 'bumped()' + changeset: 5:5601fb93a350 + tag: tip + parent: 1:7c3bad9141dc + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add new_3_c + + $ cd .. Exchange Test