Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 45957:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 777e8d88f703 |
children | c3d0b3c29ec4 |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Nov 27 17:00:00 2020 -0500 +++ b/mercurial/commands.py Fri Nov 27 17:03:29 2020 -0500 @@ -605,7 +605,7 @@ helpcategory=command.CATEGORY_IMPORT_EXPORT, ) def archive(ui, repo, dest, **opts): - '''create an unversioned archive of a repository revision + """create an unversioned archive of a repository revision By default, the revision used is the parent of the working directory; use -r/--rev to specify a different revision. @@ -644,7 +644,7 @@ removed. Returns 0 on success. - ''' + """ opts = pycompat.byteskwargs(opts) rev = opts.get(b'rev') @@ -718,7 +718,7 @@ helpcategory=command.CATEGORY_CHANGE_MANAGEMENT, ) def backout(ui, repo, node=None, rev=None, **opts): - '''reverse effect of earlier changeset + """reverse effect of earlier changeset Prepare a new changeset with the effect of REV undone in the current working directory. If no conflicts were encountered, @@ -768,7 +768,7 @@ Returns 0 on success, 1 if nothing to backout or there are unresolved files. - ''' + """ with repo.wlock(), repo.lock(): return _dobackout(ui, repo, node, rev, **opts) @@ -1166,7 +1166,7 @@ helpcategory=command.CATEGORY_CHANGE_ORGANIZATION, ) def bookmark(ui, repo, *names, **opts): - '''create a new bookmark or list existing bookmarks + """create a new bookmark or list existing bookmarks Bookmarks are labels on changesets to help track lines of development. Bookmarks are unversioned and can be moved, renamed and deleted. @@ -1224,7 +1224,7 @@ - print only the active bookmark name:: hg book -ql . - ''' + """ opts = pycompat.byteskwargs(opts) force = opts.get(b'force') rev = opts.get(b'rev') @@ -2804,7 +2804,9 @@ @command( b'forget', - [(b'i', b'interactive', None, _(b'use interactive mode')),] + [ + (b'i', b'interactive', None, _(b'use interactive mode')), + ] + walkopts + dryrunopts, _(b'[OPTION]... FILE...'), @@ -2904,7 +2906,7 @@ helpcategory=command.CATEGORY_CHANGE_MANAGEMENT, ) def graft(ui, repo, *revs, **opts): - '''copy changes from other branches onto the current branch + """copy changes from other branches onto the current branch This command uses Mercurial's merge logic to copy individual changes from other branches without merging branches in the @@ -2997,7 +2999,7 @@ See :hg:`help revisions` for more about specifying revisions. Returns 0 on successful completion, 1 if there are unresolved files. - ''' + """ with repo.wlock(): return _dograft(ui, repo, *revs, **opts) @@ -5261,7 +5263,12 @@ None, _(b'run even when remote repository is unrelated'), ), - (b'', b'confirm', None, _(b'confirm pull before applying changes'),), + ( + b'', + b'confirm', + None, + _(b'confirm pull before applying changes'), + ), ( b'r', b'rev', @@ -5518,7 +5525,9 @@ if opts.get(b'all_bookmarks'): cmdutil.check_incompatible_arguments( - opts, b'all_bookmarks', [b'bookmark', b'rev'], + opts, + b'all_bookmarks', + [b'bookmark', b'rev'], ) opts[b'bookmark'] = list(repo._bookmarks) @@ -5608,7 +5617,9 @@ @command( b'recover', - [(b'', b'verify', False, b"run `hg verify` after successful recover"),], + [ + (b'', b'verify', False, b"run `hg verify` after successful recover"), + ], helpcategory=command.CATEGORY_MAINTENANCE, ) def recover(ui, repo, **opts): @@ -6448,7 +6459,7 @@ helpcategory=command.CATEGORY_WORKING_DIRECTORY, ) def shelve(ui, repo, *pats, **opts): - '''save and set aside changes from the working directory + """save and set aside changes from the working directory Shelving takes files that "hg status" reports as not clean, saves the modifications to a bundle (a shelved change), and reverts the @@ -6479,7 +6490,7 @@ To delete specific shelved changes, use ``--delete``. To delete all shelved changes, use ``--cleanup``. - ''' + """ opts = pycompat.byteskwargs(opts) allowables = [ (b'addremove', {b'create'}), # 'create' is pseudo action @@ -7707,8 +7718,7 @@ def loadcmdtable(ui, name, cmdtable): - """Load command functions from specified cmdtable - """ + """Load command functions from specified cmdtable""" overrides = [cmd for cmd in cmdtable if cmd in table] if overrides: ui.warn(