[PATCH 3 of 7 V3] revset: add a bumped revset

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Oct 16 17:02:32 CDT 2012


On Oct 16, 2012, at 3:48 PM, Pierre-Yves David wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at logilab.fr>
> # Date 1350300187 -7200
> # Node ID e36b56c8231211eb5276677a31be57bb8e275a13
> # Parent  8192b7575461b04cd4797d59315a231f426aea77
> revset: add a bumped revset
> 
> Select bumped changesets.
> 
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -422,6 +422,17 @@
>     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 changeset trying to succeed to a public changeset.

Same phrasing changes here as to the comments in [PATCH 2 of 7 V3].

> +
> +    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.getobscache(repo, 'bumped')

Do we not have a method to return the bumped changesets a bit more cleanly? Directly fetching into another module's cache seems a bit dirty to me.

> +    return [r for r in subset if r in bumped]
> +
> def checkstatus(repo, subset, pat, field):
>     m = None
>     s = []
> @@ -1492,6 +1503,7 @@
>     "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 @@
>      summary:     add a
> 
> 
> +And that bumped changeset are detected
> +--------------------------------------
> +
> +If we did filtered obsolete changeset out, 3 and 4 would show up too. Also
   If we filtered              changesets
> +notes that the bumped changeset (5:5601fb93a350) is not a direct successors of
   note [imperative]                                                successor

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list