Mercurial > evolve
changeset 4906:33785e94097a
branching: merge with stable
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 23 Oct 2019 01:14:42 +0200 |
parents | f9743b13de6d (diff) f26ad80df723 (current diff) |
children | 0ce6510b45ab |
files | hgext3rd/evolve/cmdrewrite.py hgext3rd/evolve/rewind.py |
diffstat | 11 files changed, 73 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/evolve/__init__.py Wed Oct 23 01:14:42 2019 +0200 @@ -465,7 +465,8 @@ _alias, statuscmd = cmdutil.findcmd(b'status', commands.table) pstatusopts = [o for o in statuscmd[1] if o[1] != b'rev'] - @eh.command(b'pstatus', pstatusopts) + @eh.command(b'pstatus', pstatusopts, + **compat.helpcategorykwargs('CATEGORY_WORKING_DIRECTORY')) def pstatus(ui, repo, *args, **kwargs): """show status combining committed and uncommited changes @@ -480,7 +481,8 @@ _alias, diffcmd = cmdutil.findcmd(b'diff', commands.table) pdiffopts = [o for o in diffcmd[1] if o[1] != b'rev'] - @eh.command(b'pdiff', pdiffopts) + @eh.command(b'pdiff', pdiffopts, + **compat.helpcategorykwargs('CATEGORY_WORKING_DIRECTORY')) def pdiff(ui, repo, *args, **kwargs): """show diff combining committed and uncommited changes @@ -989,7 +991,8 @@ (b'n', b'dry-run', False, _(b'do not perform actions, just print what would be done'))], b'[OPTION]...', - helpbasic=True) + helpbasic=True, + **compat.helpcategorykwargs('CATEGORY_WORKING_DIRECTORY')) def cmdprevious(ui, repo, **opts): """update to parent revision @@ -1048,7 +1051,8 @@ (b'n', b'dry-run', False, _(b'do not perform actions, just print what would be done'))], b'[OPTION]...', - helpbasic=True) + helpbasic=True, + **compat.helpcategorykwargs('CATEGORY_WORKING_DIRECTORY')) def cmdnext(ui, repo, **opts): """update to next child revision @@ -1339,8 +1343,16 @@ if entry[0] == b"evolution": break else: - help.helptable.append(([b"evolution"], _(b"Safely Rewriting History"), - _helploader)) + if util.safehasattr(help, 'TOPIC_CATEGORY_CONCEPTS'): + help.helptable.append(([b"evolution"], + _(b"Safely Rewriting History"), + _helploader, + help.TOPIC_CATEGORY_CONCEPTS)) + else: + # hg <= 4.7 (c303d65d2e34) + help.helptable.append(([b"evolution"], + _(b"Safely Rewriting History"), + _helploader)) help.helptable.sort() evolvestateversion = 0
--- a/hgext3rd/evolve/cmdrewrite.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/evolve/cmdrewrite.py Wed Oct 23 01:14:42 2019 +0200 @@ -109,7 +109,8 @@ (b'n', b'note', b'', _(b'store a note on amend'), _(b'TEXT')), ] + walkopts + commitopts + commitopts2 + commitopts3 + interactiveopt, _(b'[OPTION]... [FILE]...'), - helpbasic=True) + helpbasic=True, + **compat.helpcategorykwargs('CATEGORY_COMMITTING')) def amend(ui, repo, *pats, **opts): """combine a changeset with updates and replace it with a new one @@ -454,7 +455,8 @@ (b'', b'revert', False, _(b'discard working directory changes after uncommit')), (b'n', b'note', b'', _(b'store a note on uncommit'), _(b'TEXT')), ] + commands.walkopts + commitopts + commitopts2 + commitopts3, - _(b'[OPTION]... [NAME]')) + _(b'[OPTION]... [NAME]'), + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT')) def uncommit(ui, repo, *pats, **opts): """move changes from parent revision to working directory @@ -690,7 +692,8 @@ (b'n', b'note', b'', _(b'store a note on fold'), _(b'TEXT')), ] + commitopts + commitopts2 + commitopts3, _(b'hg fold [OPTION]... [-r] REV'), - helpbasic=True) + helpbasic=True, + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT')) def fold(ui, repo, *revs, **opts): """fold multiple revisions into a single one @@ -820,7 +823,8 @@ (b'', b'fold', None, _(b"also fold specified revisions into one")), (b'n', b'note', b'', _(b'store a note on metaedit'), _(b'TEXT')), ] + commitopts + commitopts2 + commitopts3, - _(b'hg metaedit [OPTION]... [-r] [REV]')) + _(b'hg metaedit [OPTION]... [-r] [REV]'), + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT')) def metaedit(ui, repo, *revs, **opts): """edit commit information @@ -978,7 +982,8 @@ (b'B', b'bookmark', [], _(b"remove revs only reachable from given" b" bookmark"), _(b'BOOKMARK'))] + metadataopts, _(b'[OPTION] [-r] REV...'), - helpbasic=True) + helpbasic=True, + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT')) # XXX -U --noupdate option to prevent wc update and or bookmarks update ? def cmdprune(ui, repo, *revs, **opts): """mark changesets as obsolete or succeeded by another changeset @@ -1172,7 +1177,8 @@ (b'n', b'note', b'', _(b"store a note on split"), _(b'TEXT')), ] + commitopts + commitopts2 + commitopts3, _(b'hg split [OPTION] [-r REV] [FILES]'), - helpbasic=True) + helpbasic=True, + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT')) def cmdsplit(ui, repo, *pats, **opts): """split a changeset into smaller changesets @@ -1347,7 +1353,8 @@ b'mark the new revision as successor of the old one potentially creating ' b'divergence')], # allow to choose the seed ? - _(b'[-r] revs')) + _(b'[-r] revs'), + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT')) def touch(ui, repo, *revs, **opts): """create successors identical to their predecessors but the changeset ID @@ -1448,7 +1455,8 @@ (b'c', b'continue', False, b'continue interrupted pick'), (b'a', b'abort', False, b'abort interrupted pick'), ] + mergetoolopts, - _(b'[-r] rev')) + _(b'[-r] rev'), + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT')) def cmdpick(ui, repo, *revs, **opts): """move a commit on the top of working directory parent and updates to it."""
--- a/hgext3rd/evolve/compat.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/evolve/compat.py Wed Oct 23 01:14:42 2019 +0200 @@ -17,6 +17,7 @@ obsolete, obsutil, pycompat, + registrar, repair, scmutil, util, @@ -515,3 +516,12 @@ if meta.get(b'operation')) return sorted(operations) + +# help category compatibility +# hg <= 4.7 (c303d65d2e34) +def helpcategorykwargs(categoryname): + """Backwards-compatible specification of the helpategory argument.""" + category = getattr(registrar.command, categoryname, None) + if not category: + return {} + return {'helpcategory': category}
--- a/hgext3rd/evolve/evolvecmd.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/evolve/evolvecmd.py Wed Oct 23 01:14:42 2019 +0200 @@ -1505,7 +1505,8 @@ b' in the repo')), ] + mergetoolopts, _(b'[OPTIONS]...'), - helpbasic=True + helpbasic=True, + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT') ) def evolve(ui, repo, **opts): """solve troubled changesets in your repository
--- a/hgext3rd/evolve/exthelper.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/evolve/exthelper.py Wed Oct 23 01:14:42 2019 +0200 @@ -50,7 +50,7 @@ @eh.command('mynewcommand', [('r', 'rev', [], _('operate on these revisions'))], _('-r REV...'), - helpcategory=command.CATEGORY_XXX) + **compat.helpcategorykwargs('CATEGORY_XXX')) def newcommand(ui, repo, *revs, **opts): # implementation goes here
--- a/hgext3rd/evolve/metadata.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/evolve/metadata.py Wed Oct 23 01:14:42 2019 +0200 @@ -5,7 +5,7 @@ # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. -__version__ = b'9.2.2.dev' +__version__ = b'9.3.0.dev' testedwith = b'4.5.2 4.6.2 4.7 4.8 4.9 5.0 5.1' minimumhgversion = b'4.5' buglink = b'https://bz.mercurial-scm.org/'
--- a/hgext3rd/evolve/obshistory.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/evolve/obshistory.py Wed Oct 23 01:14:42 2019 +0200 @@ -50,7 +50,8 @@ (b'p', b'patch', False, _(b'show the patch between two obs versions')), (b'f', b'filternonlocal', False, _(b'filter out non local commits')), ] + commands.formatteropts, - _(b'hg olog [OPTION]... [REV]')) + _(b'hg olog [OPTION]... [REV]'), + **compat.helpcategorykwargs('CATEGORY_CHANGE_NAVIGATION')) def cmdobshistory(ui, repo, *revs, **opts): """show the obsolescence history of the specified revisions
--- a/hgext3rd/evolve/rewind.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/evolve/rewind.py Wed Oct 23 01:14:42 2019 +0200 @@ -36,7 +36,8 @@ _(b"do not modify working directory during rewind")), ], _(b'[--as-divergence] [--exact] [--keep] [--to REV]... [--from REV]...'), - helpbasic=True) + helpbasic=True, + **compat.helpcategorykwargs('CATEGORY_CHANGE_MANAGEMENT')) def rewind(ui, repo, **opts): """rewind a stack of changesets to a previous state
--- a/hgext3rd/topic/__init__.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/topic/__init__.py Wed Oct 23 01:14:42 2019 +0200 @@ -187,7 +187,7 @@ b'topic.active': b'green', } -__version__ = b'0.17.2.dev' +__version__ = b'0.18.0.dev' testedwith = b'4.5.2 4.6.2 4.7 4.8 4.9 5.0 5.1' minimumhgversion = b'4.5' @@ -634,7 +634,8 @@ (b'', b'age', False, b'show when you last touched the topics'), (b'', b'current', None, b'display the current topic only'), ] + commands.formatteropts, - _(b'hg topics [TOPIC]')) + _(b'hg topics [TOPIC]'), + **compat.helpcategorykwargs('CATEGORY_CHANGE_ORGANIZATION')) def topics(ui, repo, topic=None, **opts): """View current topic, set current topic, change topic for a set of revisions, or see all topics. @@ -777,7 +778,8 @@ (b'c', b'children', None, _(b'display data about children outside of the stack')) ] + commands.formatteropts, - _(b'hg stack [TOPIC]')) + _(b'hg stack [TOPIC]'), + **compat.helpcategorykwargs('CATEGORY_CHANGE_NAVIGATION')) def cmdstack(ui, repo, topic=b'', **opts): """list all changesets in a topic and other information
--- a/hgext3rd/topic/compat.py Thu Oct 10 08:22:41 2019 +0700 +++ b/hgext3rd/topic/compat.py Wed Oct 23 01:14:42 2019 +0200 @@ -10,6 +10,7 @@ from mercurial import ( obsolete, pycompat, + registrar, ) getmarkers = None @@ -34,3 +35,12 @@ def branchmapitems(branchmap): return branchmap.iteritems() # py3-transform: on + +# help category compatibility +# hg <= 4.7 (c303d65d2e34) +def helpcategorykwargs(categoryname): + """Backwards-compatible specification of the helpategory argument.""" + category = getattr(registrar.command, categoryname, None) + if not category: + return {} + return {'helpcategory': category}
--- a/tests/test-topic.t Thu Oct 10 08:22:41 2019 +0700 +++ b/tests/test-topic.t Wed Oct 23 01:14:42 2019 +0200 @@ -122,10 +122,15 @@ list of commands: - stack list all changesets in a topic and other information + Change organization: + topics View current topic, set current topic, change topic for a set of revisions, or see all topics. + Change navigation: + + stack list all changesets in a topic and other information + (use 'hg help -v topic' to show built-in aliases and global options) $ hg help topics hg topics [TOPIC]