comparison mercurial/exchange.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 d783f945a701
children c17a63eb5d4c
comparison
equal deleted inserted replaced
43116:defabf63e969 43117:8ff1ecfadcd1
317 _( 317 _(
318 b'changegroup version %s does not have ' 318 b'changegroup version %s does not have '
319 b'a known bundlespec' 319 b'a known bundlespec'
320 ) 320 )
321 % version, 321 % version,
322 hint=_(b'try upgrading your Mercurial ' b'client'), 322 hint=_(b'try upgrading your Mercurial client'),
323 ) 323 )
324 elif part.type == b'stream2' and version is None: 324 elif part.type == b'stream2' and version is None:
325 # A stream2 part requires to be part of a v2 bundle 325 # A stream2 part requires to be part of a v2 bundle
326 requirements = urlreq.unquote(part.params[b'requirements']) 326 requirements = urlreq.unquote(part.params[b'requirements'])
327 splitted = requirements.split() 327 splitted = requirements.split()
328 params = bundle2._formatrequirementsparams(splitted) 328 params = bundle2._formatrequirementsparams(splitted)
329 return b'none-v2;stream=v2;%s' % params 329 return b'none-v2;stream=v2;%s' % params
330 330
331 if not version: 331 if not version:
332 raise error.Abort( 332 raise error.Abort(
333 _(b'could not identify changegroup version in ' b'bundle') 333 _(b'could not identify changegroup version in bundle')
334 ) 334 )
335 335
336 return b'%s-%s' % (comp, version) 336 return b'%s-%s' % (comp, version)
337 elif isinstance(b, streamclone.streamcloneapplier): 337 elif isinstance(b, streamclone.streamcloneapplier):
338 requirements = streamclone.readbundle1header(fh)[2] 338 requirements = streamclone.readbundle1header(fh)[2]
381 ui.warn( 381 ui.warn(
382 _(b'%i changesets about to be published\n') % len(published) 382 _(b'%i changesets about to be published\n') % len(published)
383 ) 383 )
384 elif behavior == b'confirm': 384 elif behavior == b'confirm':
385 if ui.promptchoice( 385 if ui.promptchoice(
386 _(b'push and publish %i changesets (yn)?' b'$$ &Yes $$ &No') 386 _(b'push and publish %i changesets (yn)?$$ &Yes $$ &No')
387 % len(published) 387 % len(published)
388 ): 388 ):
389 raise error.Abort(_(b'user quit')) 389 raise error.Abort(_(b'user quit'))
390 elif behavior == b'abort': 390 elif behavior == b'abort':
391 msg = _(b'push would publish %i changesets') % len(published) 391 msg = _(b'push would publish %i changesets') % len(published)
1164 1164
1165 def _abortonsecretctx(pushop, node, b): 1165 def _abortonsecretctx(pushop, node, b):
1166 """abort if a given bookmark points to a secret changeset""" 1166 """abort if a given bookmark points to a secret changeset"""
1167 if node and pushop.repo[node].phase() == phases.secret: 1167 if node and pushop.repo[node].phase() == phases.secret:
1168 raise error.Abort( 1168 raise error.Abort(
1169 _(b'cannot push bookmark %s as it points to a secret' b' changeset') 1169 _(b'cannot push bookmark %s as it points to a secret changeset') % b
1170 % b
1171 ) 1170 )
1172 1171
1173 1172
1174 def _pushb2bookmarkspart(pushop, bundler): 1173 def _pushb2bookmarkspart(pushop, bundler):
1175 pushop.stepsdone.add(b'bookmarks') 1174 pushop.stepsdone.add(b'bookmarks')
2694 or their_heads == [b'hashed', heads_hash] 2693 or their_heads == [b'hashed', heads_hash]
2695 ): 2694 ):
2696 # someone else committed/pushed/unbundled while we 2695 # someone else committed/pushed/unbundled while we
2697 # were transferring data 2696 # were transferring data
2698 raise error.PushRaced( 2697 raise error.PushRaced(
2699 b'repository changed while %s - ' b'please try again' % context 2698 b'repository changed while %s - please try again' % context
2700 ) 2699 )
2701 2700
2702 2701
2703 def unbundle(repo, cg, heads, source, url): 2702 def unbundle(repo, cg, heads, source, url):
2704 """Apply a bundle to a repo. 2703 """Apply a bundle to a repo.
2840 b'no compatible clone bundles available on server; ' 2839 b'no compatible clone bundles available on server; '
2841 b'falling back to regular clone\n' 2840 b'falling back to regular clone\n'
2842 ) 2841 )
2843 ) 2842 )
2844 repo.ui.warn( 2843 repo.ui.warn(
2845 _(b'(you may want to report this to the server ' b'operator)\n') 2844 _(b'(you may want to report this to the server operator)\n')
2846 ) 2845 )
2847 return 2846 return
2848 2847
2849 entries = sortclonebundleentries(repo.ui, entries) 2848 entries = sortclonebundleentries(repo.ui, entries)
2850 2849