comparison mercurial/debugcommands.py @ 43117:8ff1ecfadcd1

cleanup: join string literals that are already on one line Thanks to Kyle for noticing this and for providing the regular expression to run on the codebase. This patch has been reviewed by the test suite and they approved of it. # skip-blame: fallout from mass reformatting Differential Revision: https://phab.mercurial-scm.org/D7028
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 08 Oct 2019 15:06:18 -0700
parents defabf63e969
children ba5b062a1388
comparison
equal deleted inserted replaced
43116:defabf63e969 43117:8ff1ecfadcd1
107 r = revlog.revlog(vfsmod.vfs(encoding.getcwd(), audit=False), index) 107 r = revlog.revlog(vfsmod.vfs(encoding.getcwd(), audit=False), index)
108 lookup = r.lookup 108 lookup = r.lookup
109 elif len(args) == 2: 109 elif len(args) == 2:
110 if not repo: 110 if not repo:
111 raise error.Abort( 111 raise error.Abort(
112 _(b'there is no Mercurial repository here ' b'(.hg not found)') 112 _(b'there is no Mercurial repository here (.hg not found)')
113 ) 113 )
114 rev1, rev2 = args 114 rev1, rev2 = args
115 r = repo.changelog 115 r = repo.changelog
116 lookup = repo.lookup 116 lookup = repo.lookup
117 else: 117 else:
1462 err = stringutil.forcebytestr(inst) 1462 err = stringutil.forcebytestr(inst)
1463 problems += 1 1463 problems += 1
1464 fm.condwrite( 1464 fm.condwrite(
1465 err, 1465 err,
1466 b'encodingerror', 1466 b'encodingerror',
1467 _(b" %s\n" b" (check that your locale is properly set)\n"), 1467 _(b" %s\n (check that your locale is properly set)\n"),
1468 err, 1468 err,
1469 ) 1469 )
1470 1470
1471 # Python 1471 # Python
1472 fm.write( 1472 fm.write(
1575 sep=b', ', 1575 sep=b', ',
1576 ), 1576 ),
1577 ) 1577 )
1578 fm.write( 1578 fm.write(
1579 b'compenginesavail', 1579 b'compenginesavail',
1580 _(b'checking available compression engines ' b'(%s)\n'), 1580 _(b'checking available compression engines (%s)\n'),
1581 fm.formatlist( 1581 fm.formatlist(
1582 sorted(e.name() for e in compengines if e.available()), 1582 sorted(e.name() for e in compengines if e.available()),
1583 name=b'compengine', 1583 name=b'compengine',
1584 fmt=b'%s', 1584 fmt=b'%s',
1585 sep=b', ', 1585 sep=b', ',
1699 if not problems: 1699 if not problems:
1700 fm.data(problems=problems) 1700 fm.data(problems=problems)
1701 fm.condwrite( 1701 fm.condwrite(
1702 problems, 1702 problems,
1703 b'problems', 1703 b'problems',
1704 _(b"%d problems detected," b" please check your install!\n"), 1704 _(b"%d problems detected, please check your install!\n"),
1705 problems, 1705 problems,
1706 ) 1706 )
1707 fm.end() 1707 fm.end()
1708 1708
1709 return problems 1709 return problems
2069 (b'r', b'rev', [], _(b'display markers relevant to REV')), 2069 (b'r', b'rev', [], _(b'display markers relevant to REV')),
2070 ( 2070 (
2071 b'', 2071 b'',
2072 b'exclusive', 2072 b'exclusive',
2073 False, 2073 False,
2074 _(b'restrict display to markers only ' b'relevant to REV'), 2074 _(b'restrict display to markers only relevant to REV'),
2075 ), 2075 ),
2076 (b'', b'index', False, _(b'display index of the marker')), 2076 (b'', b'index', False, _(b'display index of the marker')),
2077 (b'', b'delete', [], _(b'delete markers specified by indices')), 2077 (b'', b'delete', [], _(b'delete markers specified by indices')),
2078 ] 2078 ]
2079 + cmdutil.commitopts2 2079 + cmdutil.commitopts2
2113 hint=_(b'use integers for indices'), 2113 hint=_(b'use integers for indices'),
2114 ) 2114 )
2115 2115
2116 if repo.currenttransaction(): 2116 if repo.currenttransaction():
2117 raise error.Abort( 2117 raise error.Abort(
2118 _(b'cannot delete obsmarkers in the middle ' b'of transaction.') 2118 _(b'cannot delete obsmarkers in the middle of transaction.')
2119 ) 2119 )
2120 2120
2121 with repo.lock(): 2121 with repo.lock():
2122 n = repair.deleteobsmarkers(repo.obsstore, indices) 2122 n = repair.deleteobsmarkers(repo.obsstore, indices)
2123 ui.write(_(b'deleted %i obsolescence markers\n') % n) 2123 ui.write(_(b'deleted %i obsolescence markers\n') % n)
2947 break 2947 break
2948 2948
2949 if format == 0: 2949 if format == 0:
2950 if ui.verbose: 2950 if ui.verbose:
2951 ui.writenoi18n( 2951 ui.writenoi18n(
2952 (b" rev offset length linkrev" b" %s %s p2\n") 2952 b" rev offset length linkrev %s %s p2\n"
2953 % (b"nodeid".ljust(idlen), b"p1".ljust(idlen)) 2953 % (b"nodeid".ljust(idlen), b"p1".ljust(idlen))
2954 ) 2954 )
2955 else: 2955 else:
2956 ui.writenoi18n( 2956 ui.writenoi18n(
2957 b" rev linkrev %s %s p2\n" 2957 b" rev linkrev %s %s p2\n"
3094 ] 3094 ]
3095 if opts[b'no_optimized']: 3095 if opts[b'no_optimized']:
3096 stages = stages[:-1] 3096 stages = stages[:-1]
3097 if opts[b'verify_optimized'] and opts[b'no_optimized']: 3097 if opts[b'verify_optimized'] and opts[b'no_optimized']:
3098 raise error.Abort( 3098 raise error.Abort(
3099 _(b'cannot use --verify-optimized with ' b'--no-optimized') 3099 _(b'cannot use --verify-optimized with --no-optimized')
3100 ) 3100 )
3101 stagenames = set(n for n, f in stages) 3101 stagenames = set(n for n, f in stages)
3102 3102
3103 showalways = set() 3103 showalways = set()
3104 showchanged = set() 3104 showchanged = set()
3274 If the update succeeds, retry the original operation. Otherwise, the cause 3274 If the update succeeds, retry the original operation. Otherwise, the cause
3275 of the SSL error is likely another issue. 3275 of the SSL error is likely another issue.
3276 ''' 3276 '''
3277 if not pycompat.iswindows: 3277 if not pycompat.iswindows:
3278 raise error.Abort( 3278 raise error.Abort(
3279 _(b'certificate chain building is only possible on ' b'Windows') 3279 _(b'certificate chain building is only possible on Windows')
3280 ) 3280 )
3281 3281
3282 if not source: 3282 if not source:
3283 if not repo: 3283 if not repo:
3284 raise error.Abort( 3284 raise error.Abort(
3420 """ 3420 """
3421 revs = None 3421 revs = None
3422 if opts[r'rev']: 3422 if opts[r'rev']:
3423 if repo is None: 3423 if repo is None:
3424 raise error.RepoError( 3424 raise error.RepoError(
3425 _(b'there is no Mercurial repository here ' b'(.hg not found)') 3425 _(b'there is no Mercurial repository here (.hg not found)')
3426 ) 3426 )
3427 revs = scmutil.revrange(repo, opts[r'rev']) 3427 revs = scmutil.revrange(repo, opts[r'rev'])
3428 3428
3429 props = {} 3429 props = {}
3430 for d in opts[r'define']: 3430 for d in opts[r'define']:
3880 _(b'invalid value for --peer'), 3880 _(b'invalid value for --peer'),
3881 hint=_(b'valid values are "raw", "ssh1", and "ssh2"'), 3881 hint=_(b'valid values are "raw", "ssh1", and "ssh2"'),
3882 ) 3882 )
3883 3883
3884 if path and opts[b'localssh']: 3884 if path and opts[b'localssh']:
3885 raise error.Abort( 3885 raise error.Abort(_(b'cannot specify --localssh with an explicit path'))
3886 _(b'cannot specify --localssh with an explicit ' b'path')
3887 )
3888 3886
3889 if ui.interactive(): 3887 if ui.interactive():
3890 ui.write(_(b'(waiting for commands on stdin)\n')) 3888 ui.write(_(b'(waiting for commands on stdin)\n'))
3891 3889
3892 blocks = list(_parsewirelangblocks(ui.fin)) 3890 blocks = list(_parsewirelangblocks(ui.fin))
4151 batchedcommands = None 4149 batchedcommands = None
4152 4150
4153 elif action.startswith(b'httprequest '): 4151 elif action.startswith(b'httprequest '):
4154 if not opener: 4152 if not opener:
4155 raise error.Abort( 4153 raise error.Abort(
4156 _(b'cannot use httprequest without an HTTP ' b'peer') 4154 _(b'cannot use httprequest without an HTTP peer')
4157 ) 4155 )
4158 4156
4159 request = action.split(b' ', 2) 4157 request = action.split(b' ', 2)
4160 if len(request) != 3: 4158 if len(request) != 3:
4161 raise error.Abort( 4159 raise error.Abort(