Submitter | Yuya Nishihara |
---|---|
Date | Feb. 26, 2018, 2:29 p.m. |
Message ID | <b3622121e31c172c91cc.1519655374@mimosa> |
Download | mbox | patch |
Permalink | /patch/28407/ |
State | Accepted |
Headers | show |
Comments
On Mon, Feb 26, 2018 at 6:29 AM, Yuya Nishihara <yuya@tcha.org> wrote: > # HG changeset patch > # User Yuya Nishihara <yuya@tcha.org> > # Date 1519533771 -32400 > # Sun Feb 25 13:42:51 2018 +0900 > # Node ID b3622121e31c172c91ccf35fb738a85269ad7125 > # Parent 93228b2a1fc0a0c48ea138fb88bc719d5222c0c8 > narrow: drop redundant templatekw/revset names from help text > Queued this series. I like the new, safer mechanism for declaring template keywords! > > ":<name>:" is automatically added by the registrar. > > diff --git a/hgext/narrow/narrowtemplates.py b/hgext/narrow/ > narrowtemplates.py > --- a/hgext/narrow/narrowtemplates.py > +++ b/hgext/narrow/narrowtemplates.py > @@ -24,16 +24,15 @@ def _isellipsis(repo, rev): > > @templatekeyword('ellipsis') > def ellipsis(repo, ctx, templ, **args): > - """:ellipsis: String. 'ellipsis' if the change is an ellipsis node, > - else ''.""" > + """String. 'ellipsis' if the change is an ellipsis node, else ''.""" > if _isellipsis(repo, ctx.rev()): > return 'ellipsis' > return '' > > @templatekeyword('outsidenarrow') > def outsidenarrow(repo, ctx, templ, **args): > - """:outsidenarrow: String. 'outsidenarrow' if the change affects no > - tracked files, else ''.""" > + """String. 'outsidenarrow' if the change affects no tracked files, > + else ''.""" > if util.safehasattr(repo, 'narrowmatch'): > m = repo.narrowmatch() > if not any(m(f) for f in ctx.files()): > @@ -42,7 +41,5 @@ def outsidenarrow(repo, ctx, templ, **ar > > @revsetpredicate('ellipsis') > def ellipsisrevset(repo, subset, x): > - """``ellipsis()`` > - Changesets that are ellipsis nodes. > - """ > + """Changesets that are ellipsis nodes.""" > return subset.filter(lambda r: _isellipsis(repo, r)) > _______________________________________________ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel >
Patch
diff --git a/hgext/narrow/narrowtemplates.py b/hgext/narrow/narrowtemplates.py --- a/hgext/narrow/narrowtemplates.py +++ b/hgext/narrow/narrowtemplates.py @@ -24,16 +24,15 @@ def _isellipsis(repo, rev): @templatekeyword('ellipsis') def ellipsis(repo, ctx, templ, **args): - """:ellipsis: String. 'ellipsis' if the change is an ellipsis node, - else ''.""" + """String. 'ellipsis' if the change is an ellipsis node, else ''.""" if _isellipsis(repo, ctx.rev()): return 'ellipsis' return '' @templatekeyword('outsidenarrow') def outsidenarrow(repo, ctx, templ, **args): - """:outsidenarrow: String. 'outsidenarrow' if the change affects no - tracked files, else ''.""" + """String. 'outsidenarrow' if the change affects no tracked files, + else ''.""" if util.safehasattr(repo, 'narrowmatch'): m = repo.narrowmatch() if not any(m(f) for f in ctx.files()): @@ -42,7 +41,5 @@ def outsidenarrow(repo, ctx, templ, **ar @revsetpredicate('ellipsis') def ellipsisrevset(repo, subset, x): - """``ellipsis()`` - Changesets that are ellipsis nodes. - """ + """Changesets that are ellipsis nodes.""" return subset.filter(lambda r: _isellipsis(repo, r))