D5067: help: assigning categories to existing commands
yuja added a comment. Queued the first 5 patches, thanks. > 1. Human-readable category names. These are translated. > 2. Extensions with custom categories should add their names here. To make these being collected to i18n catalog, we have to wrap them with _(). But that can be fixed later. > CATEGORY_NAMES = { > > +registrar.command.CATEGORY_REPO_CREATION: 'Repository creation', > +registrar.command.CATEGORY_REMOTE_REPO_MANAGEMENT: > +'Remote repository management', > +registrar.command.CATEGORY_COMMITTING: 'Change creation', > +registrar.command.CATEGORY_CHANGE_NAVIGATION: 'Change navigation', > +registrar.command.CATEGORY_CHANGE_MANAGEMENT: 'Change manipulation', > +registrar.command.CATEGORY_CHANGE_ORGANIZATION: 'Change organization', > +registrar.command.CATEGORY_WORKING_DIRECTORY: > +'Working directory management', > +registrar.command.CATEGORY_FILE_CONTENTS: 'File content management', > +registrar.command.CATEGORY_IMPORT_EXPORT: 'Change import/export', > +registrar.command.CATEGORY_MAINTENANCE: 'Repository maintenance', > +registrar.command.CATEGORY_HELP: 'Help', > +registrar.command.CATEGORY_MISC: 'Miscellaneous commands', > > registrar.command.CATEGORY_NONE: 'Uncategorized commands', Perhaps, using all-lowercase names is our convention. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5067 To: rdamazio, durin42, martinvonz, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5067: help: assigning categories to existing commands
Queued the first 5 patches, thanks. > # Human-readable category names. These are translated. > # Extensions with custom categories should add their names here. To make these being collected to i18n catalog, we have to wrap them with _(). But that can be fixed later. > CATEGORY_NAMES = { > +registrar.command.CATEGORY_REPO_CREATION: 'Repository creation', > +registrar.command.CATEGORY_REMOTE_REPO_MANAGEMENT: > +'Remote repository management', > +registrar.command.CATEGORY_COMMITTING: 'Change creation', > +registrar.command.CATEGORY_CHANGE_NAVIGATION: 'Change navigation', > +registrar.command.CATEGORY_CHANGE_MANAGEMENT: 'Change manipulation', > +registrar.command.CATEGORY_CHANGE_ORGANIZATION: 'Change organization', > +registrar.command.CATEGORY_WORKING_DIRECTORY: > +'Working directory management', > +registrar.command.CATEGORY_FILE_CONTENTS: 'File content management', > +registrar.command.CATEGORY_IMPORT_EXPORT: 'Change import/export', > +registrar.command.CATEGORY_MAINTENANCE: 'Repository maintenance', > +registrar.command.CATEGORY_HELP: 'Help', > +registrar.command.CATEGORY_MISC: 'Miscellaneous commands', > registrar.command.CATEGORY_NONE: 'Uncategorized commands', Perhaps, using all-lowercase names is our convention. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5067: help: assigning categories to existing commands
yuja added a comment. > +# Add our category before "Repository maintenance". > +help.CATEGORY_ORDER.insert( > +help.CATEGORY_ORDER.index(command.CATEGORY_MAINTENANCE), > +_HELP_CATEGORY) > +help.CATEGORY_NAMES[_HELP_CATEGORY] = 'GPG signing' Moved this to extsetup(), since otherwise it could leave phantom None on import failure. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5067 To: rdamazio, durin42, martinvonz, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5067: help: assigning categories to existing commands
> +# Add our category before "Repository maintenance". > +help.CATEGORY_ORDER.insert( > +help.CATEGORY_ORDER.index(command.CATEGORY_MAINTENANCE), > +_HELP_CATEGORY) > +help.CATEGORY_NAMES[_HELP_CATEGORY] = 'GPG signing' Moved this to extsetup(), since otherwise it could leave phantom None on import failure. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5067: help: assigning categories to existing commands
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc303d65d2e34: help: assigning categories to existing commands (authored by rdamazio, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D5067?vs=12122=12145#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5067?vs=12122=12145 REVISION DETAIL https://phab.mercurial-scm.org/D5067 AFFECTED FILES hgext/absorb.py hgext/amend.py hgext/blackbox.py hgext/censor.py hgext/children.py hgext/churn.py hgext/closehead.py hgext/extdiff.py hgext/fetch.py hgext/fix.py hgext/githelp.py hgext/gpg.py hgext/graphlog.py hgext/hgk.py hgext/histedit.py hgext/journal.py hgext/mq.py hgext/patchbomb.py hgext/purge.py hgext/rebase.py hgext/record.py hgext/releasenotes.py hgext/relink.py hgext/share.py hgext/shelve.py hgext/show.py hgext/split.py hgext/strip.py hgext/transplant.py hgext/uncommit.py mercurial/commands.py mercurial/help.py mercurial/registrar.py tests/test-globalopts.t tests/test-help.t tests/test-mq.t CHANGE DETAILS diff --git a/tests/test-mq.t b/tests/test-mq.t --- a/tests/test-mq.t +++ b/tests/test-mq.t @@ -73,29 +73,46 @@ list of commands: + Repository creation: + + qcloneclone main and patch repository at same time + + Change creation: + + qnew create a new patch + qrefresh update the current patch + + Change manipulation: + + qfold fold the named patches into the current patch + + Change organization: + qapplied print the patches already applied - qcloneclone main and patch repository at same time qdelete remove patches from queue - qdiff diff of the current patch and subsequent modifications qfinish move applied patches into repository history - qfold fold the named patches into the current patch qgoto push or pop patches until named patch is at top of stack qguardset or print guards for a patch qheader print the header of the topmost or specified patch - qimport import a patch or existing changeset - qnew create a new patch qnext print the name of the next pushable patch qpop pop the current patch off the stack qprev print the name of the preceding applied patch qpush push the next patch onto the stack qqueuemanage multiple patch queues - qrefresh update the current patch qrename rename a patch qselect set or print guarded patches to push qseries print the entire series file qtop print the name of the current patch qunappliedprint the patches not yet applied + File content management: + + qdiff diff of the current patch and subsequent modifications + + Change import/export: + + qimport import a patch or existing changeset + (use 'hg help -v mq' to show built-in aliases and global options) $ hg init a diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -53,55 +53,87 @@ list of commands: - add add the specified files on the next commit - addremove add all new files, delete all missing files - annotate show changeset information by line for each file - archive create an unversioned archive of a repository revision + Repository creation: + + clone make a copy of an existing repository + init create a new repository in the given directory + + Remote repository management: + + incoming show new changesets found in source + outgoing show changesets not found in the destination + paths show aliases for remote repositories + pull pull changes from the specified source + push push changes to the specified destination + serve start stand-alone webserver + + Change creation: + + commitcommit the specified files or all outstanding changes + + Change manipulation: + backout reverse effect of earlier changeset - bisectsubdivision search of changesets + graft copy changes from other branches onto the current branch + merge merge another revision into working directory + + Change organization: + bookmarks create a new bookmark or list existing bookmarks branchset or show the current branch name branches list repository named branches - bundlecreate a bundle file + phase set or show the current phase name + tag add one or more tags for the current or given revision + tags list repository tags + + File content management: + + annotate show changeset information by line for each file cat output the current or given revision of
D5067: help: assigning categories to existing commands
yuja added a comment. > See if this is what you had in mind. Also updated all parent changesets accordingly. Yeah, that's it, thanks. I'll review the new series. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5067 To: rdamazio, durin42, martinvonz, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5067: help: assigning categories to existing commands
> See if this is what you had in mind. Also updated all parent changesets > accordingly. Yeah, that's it, thanks. I'll review the new series. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5067: help: assigning categories to existing commands
rdamazio updated this revision to Diff 12122. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5067?vs=12062=12122 REVISION DETAIL https://phab.mercurial-scm.org/D5067 AFFECTED FILES hgext/absorb.py hgext/amend.py hgext/blackbox.py hgext/censor.py hgext/children.py hgext/churn.py hgext/closehead.py hgext/extdiff.py hgext/fetch.py hgext/fix.py hgext/githelp.py hgext/gpg.py hgext/graphlog.py hgext/hgk.py hgext/histedit.py hgext/journal.py hgext/mq.py hgext/patchbomb.py hgext/purge.py hgext/rebase.py hgext/record.py hgext/releasenotes.py hgext/relink.py hgext/share.py hgext/shelve.py hgext/show.py hgext/split.py hgext/strip.py hgext/transplant.py hgext/uncommit.py mercurial/commands.py mercurial/help.py mercurial/registrar.py tests/test-globalopts.t tests/test-help.t tests/test-mq.t CHANGE DETAILS diff --git a/tests/test-mq.t b/tests/test-mq.t --- a/tests/test-mq.t +++ b/tests/test-mq.t @@ -73,29 +73,46 @@ list of commands: + Repository creation: + + qcloneclone main and patch repository at same time + + Change creation: + + qnew create a new patch + qrefresh update the current patch + + Change manipulation: + + qfold fold the named patches into the current patch + + Change organization: + qapplied print the patches already applied - qcloneclone main and patch repository at same time qdelete remove patches from queue - qdiff diff of the current patch and subsequent modifications qfinish move applied patches into repository history - qfold fold the named patches into the current patch qgoto push or pop patches until named patch is at top of stack qguardset or print guards for a patch qheader print the header of the topmost or specified patch - qimport import a patch or existing changeset - qnew create a new patch qnext print the name of the next pushable patch qpop pop the current patch off the stack qprev print the name of the preceding applied patch qpush push the next patch onto the stack qqueuemanage multiple patch queues - qrefresh update the current patch qrename rename a patch qselect set or print guarded patches to push qseries print the entire series file qtop print the name of the current patch qunappliedprint the patches not yet applied + File content management: + + qdiff diff of the current patch and subsequent modifications + + Change import/export: + + qimport import a patch or existing changeset + (use 'hg help -v mq' to show built-in aliases and global options) $ hg init a diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -53,55 +53,87 @@ list of commands: - add add the specified files on the next commit - addremove add all new files, delete all missing files - annotate show changeset information by line for each file - archive create an unversioned archive of a repository revision + Repository creation: + + clone make a copy of an existing repository + init create a new repository in the given directory + + Remote repository management: + + incoming show new changesets found in source + outgoing show changesets not found in the destination + paths show aliases for remote repositories + pull pull changes from the specified source + push push changes to the specified destination + serve start stand-alone webserver + + Change creation: + + commitcommit the specified files or all outstanding changes + + Change manipulation: + backout reverse effect of earlier changeset - bisectsubdivision search of changesets + graft copy changes from other branches onto the current branch + merge merge another revision into working directory + + Change organization: + bookmarks create a new bookmark or list existing bookmarks branchset or show the current branch name branches list repository named branches - bundlecreate a bundle file + phase set or show the current phase name + tag add one or more tags for the current or given revision + tags list repository tags + + File content management: + + annotate show changeset information by line for each file cat output the current or given revision of files - clone make a copy of an existing repository - commitcommit the specified files or all outstanding changes - configshow combined config settings from all hgrc files copy mark files as
D5067: help: assigning categories to existing commands
rdamazio added a comment. In https://phab.mercurial-scm.org/D5067#76195, @yuja wrote: > Can you make these constants untranslated (e.g. 'help' instead of _('Help')) > and map them to corresponding translation later? > > And, perhaps they can be moved to `registrar.command` so we can avoid > importing help.py everywhere. See if this is what you had in mind. Also updated all parent changesets accordingly. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5067 To: rdamazio, durin42, martinvonz, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5067: help: assigning categories to existing commands
yuja added a comment. > 1. Command categories. +CATEGORY_REPO_CREATION = _('Repository creation') +CATEGORY_REMOTE_REPO_MANAGEMENT = _('Remote repository management') +CATEGORY_COMMITTING = _('Change creation') +CATEGORY_CHANGE_NAVIGATION = _('Change navigation') +CATEGORY_CHANGE_MANAGEMENT = _('Change manipulation') +CATEGORY_CHANGE_ORGANIZATION = _('Change organization') +CATEGORY_WORKING_DIRECTORY = _('Working directory management') +CATEGORY_FILE_CONTENTS = _('File content management') +CATEGORY_IMPORT_EXPORT = _('Change import/export') +CATEGORY_MAINTENANCE = _('Repository maintenance') +CATEGORY_HELP = _('Help') +CATEGORY_MISC = _('Miscellaneous commands') CATEGORY_NONE = _('Uncategorized commands') Can you make these constants untranslated (e.g. 'help' instead of _('Help')) and map them to corresponding translation later? And, perhaps they can be moved to `registrar.command` so we can avoid importing help.py everywhere. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5067 To: rdamazio, durin42, martinvonz, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D5067: help: assigning categories to existing commands
> # Command categories. > +CATEGORY_REPO_CREATION = _('Repository creation') > +CATEGORY_REMOTE_REPO_MANAGEMENT = _('Remote repository management') > +CATEGORY_COMMITTING = _('Change creation') > +CATEGORY_CHANGE_NAVIGATION = _('Change navigation') > +CATEGORY_CHANGE_MANAGEMENT = _('Change manipulation') > +CATEGORY_CHANGE_ORGANIZATION = _('Change organization') > +CATEGORY_WORKING_DIRECTORY = _('Working directory management') > +CATEGORY_FILE_CONTENTS = _('File content management') > +CATEGORY_IMPORT_EXPORT = _('Change import/export') > +CATEGORY_MAINTENANCE = _('Repository maintenance') > +CATEGORY_HELP = _('Help') > +CATEGORY_MISC = _('Miscellaneous commands') > CATEGORY_NONE = _('Uncategorized commands') Can you make these constants untranslated (e.g. 'help' instead of _('Help')) and map them to corresponding translation later? And, perhaps they can be moved to `registrar.command` so we can avoid importing help.py everywhere. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D5067: help: assigning categories to existing commands
rdamazio updated this revision to Diff 12062. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5067?vs=12041=12062 REVISION DETAIL https://phab.mercurial-scm.org/D5067 AFFECTED FILES hgext/absorb.py hgext/amend.py hgext/blackbox.py hgext/censor.py hgext/children.py hgext/churn.py hgext/closehead.py hgext/extdiff.py hgext/fetch.py hgext/fix.py hgext/githelp.py hgext/gpg.py hgext/graphlog.py hgext/hgk.py hgext/histedit.py hgext/journal.py hgext/mq.py hgext/patchbomb.py hgext/purge.py hgext/rebase.py hgext/record.py hgext/releasenotes.py hgext/relink.py hgext/share.py hgext/shelve.py hgext/show.py hgext/split.py hgext/strip.py hgext/transplant.py hgext/uncommit.py mercurial/commands.py mercurial/help.py tests/test-globalopts.t tests/test-help.t tests/test-mq.t CHANGE DETAILS diff --git a/tests/test-mq.t b/tests/test-mq.t --- a/tests/test-mq.t +++ b/tests/test-mq.t @@ -73,29 +73,46 @@ list of commands: + Repository creation: + + qcloneclone main and patch repository at same time + + Change creation: + + qnew create a new patch + qrefresh update the current patch + + Change manipulation: + + qfold fold the named patches into the current patch + + Change organization: + qapplied print the patches already applied - qcloneclone main and patch repository at same time qdelete remove patches from queue - qdiff diff of the current patch and subsequent modifications qfinish move applied patches into repository history - qfold fold the named patches into the current patch qgoto push or pop patches until named patch is at top of stack qguardset or print guards for a patch qheader print the header of the topmost or specified patch - qimport import a patch or existing changeset - qnew create a new patch qnext print the name of the next pushable patch qpop pop the current patch off the stack qprev print the name of the preceding applied patch qpush push the next patch onto the stack qqueuemanage multiple patch queues - qrefresh update the current patch qrename rename a patch qselect set or print guarded patches to push qseries print the entire series file qtop print the name of the current patch qunappliedprint the patches not yet applied + File content management: + + qdiff diff of the current patch and subsequent modifications + + Change import/export: + + qimport import a patch or existing changeset + (use 'hg help -v mq' to show built-in aliases and global options) $ hg init a diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -53,55 +53,87 @@ list of commands: - add add the specified files on the next commit - addremove add all new files, delete all missing files - annotate show changeset information by line for each file - archive create an unversioned archive of a repository revision + Repository creation: + + clone make a copy of an existing repository + init create a new repository in the given directory + + Remote repository management: + + incoming show new changesets found in source + outgoing show changesets not found in the destination + paths show aliases for remote repositories + pull pull changes from the specified source + push push changes to the specified destination + serve start stand-alone webserver + + Change creation: + + commitcommit the specified files or all outstanding changes + + Change manipulation: + backout reverse effect of earlier changeset - bisectsubdivision search of changesets + graft copy changes from other branches onto the current branch + merge merge another revision into working directory + + Change organization: + bookmarks create a new bookmark or list existing bookmarks branchset or show the current branch name branches list repository named branches - bundlecreate a bundle file + phase set or show the current phase name + tag add one or more tags for the current or given revision + tags list repository tags + + File content management: + + annotate show changeset information by line for each file cat output the current or given revision of files - clone make a copy of an existing repository - commitcommit the specified files or all outstanding changes - configshow combined config settings from all hgrc files copy mark files as copied for the next
D5067: help: assigning categories to existing commands
rdamazio created this revision. Herald added a reviewer: durin42. Herald added a reviewer: martinvonz. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'm separating this into its own commit so people can bikeshed over the actual categorization (vs the support for categories). These categories are based on the help implementation we've been using internally at Google, and have had zero complaints. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5067 AFFECTED FILES hgext/absorb.py hgext/amend.py hgext/blackbox.py hgext/censor.py hgext/children.py hgext/churn.py hgext/closehead.py hgext/extdiff.py hgext/fetch.py hgext/fix.py hgext/githelp.py hgext/gpg.py hgext/graphlog.py hgext/hgk.py hgext/histedit.py hgext/journal.py hgext/mq.py hgext/patchbomb.py hgext/purge.py hgext/rebase.py hgext/record.py hgext/releasenotes.py hgext/relink.py hgext/share.py hgext/shelve.py hgext/show.py hgext/split.py hgext/strip.py hgext/transplant.py hgext/uncommit.py mercurial/commands.py mercurial/help.py tests/test-globalopts.t tests/test-help.t tests/test-mq.t CHANGE DETAILS diff --git a/tests/test-mq.t b/tests/test-mq.t --- a/tests/test-mq.t +++ b/tests/test-mq.t @@ -73,29 +73,46 @@ list of commands: + Repository creation: + + qcloneclone main and patch repository at same time + + Change creation: + + qnew create a new patch + qrefresh update the current patch + + Change manipulation: + + qfold fold the named patches into the current patch + + Change organization: + qapplied print the patches already applied - qcloneclone main and patch repository at same time qdelete remove patches from queue - qdiff diff of the current patch and subsequent modifications qfinish move applied patches into repository history - qfold fold the named patches into the current patch qgoto push or pop patches until named patch is at top of stack qguardset or print guards for a patch qheader print the header of the topmost or specified patch - qimport import a patch or existing changeset - qnew create a new patch qnext print the name of the next pushable patch qpop pop the current patch off the stack qprev print the name of the preceding applied patch qpush push the next patch onto the stack qqueuemanage multiple patch queues - qrefresh update the current patch qrename rename a patch qselect set or print guarded patches to push qseries print the entire series file qtop print the name of the current patch qunappliedprint the patches not yet applied + File content management: + + qdiff diff of the current patch and subsequent modifications + + Change import/export: + + qimport import a patch or existing changeset + (use 'hg help -v mq' to show built-in aliases and global options) $ hg init a diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -53,55 +53,87 @@ list of commands: - add add the specified files on the next commit - addremove add all new files, delete all missing files - annotate show changeset information by line for each file - archive create an unversioned archive of a repository revision + Repository creation: + + clone make a copy of an existing repository + init create a new repository in the given directory + + Remote repository management: + + incoming show new changesets found in source + outgoing show changesets not found in the destination + paths show aliases for remote repositories + pull pull changes from the specified source + push push changes to the specified destination + serve start stand-alone webserver + + Change creation: + + commitcommit the specified files or all outstanding changes + + Change manipulation: + backout reverse effect of earlier changeset - bisectsubdivision search of changesets + graft copy changes from other branches onto the current branch + merge merge another revision into working directory + + Change organization: + bookmarks create a new bookmark or list existing bookmarks branchset or show the current branch name branches list repository named branches - bundlecreate a bundle file + phase set or show the current phase name + tag add one or more tags for the current or given revision + tags list repository tags + + File content management: + + annotate show changeset information by