comparison mercurial/exchange.py @ 45942: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 f0626acf007d
children db9e33beb0fb
comparison
equal deleted inserted replaced
45941:346af7687c6f 45942:89a2afe31e82
376 newbranch=False, 376 newbranch=False,
377 bookmarks=(), 377 bookmarks=(),
378 publish=False, 378 publish=False,
379 opargs=None, 379 opargs=None,
380 ): 380 ):
381 '''Push outgoing changesets (limited by revs) from a local 381 """Push outgoing changesets (limited by revs) from a local
382 repository to remote. Return an integer: 382 repository to remote. Return an integer:
383 - None means nothing to push 383 - None means nothing to push
384 - 0 means HTTP error 384 - 0 means HTTP error
385 - 1 means we pushed and remote head count is unchanged *or* 385 - 1 means we pushed and remote head count is unchanged *or*
386 we have outgoing changesets but refused to push 386 we have outgoing changesets but refused to push
387 - other values as described by addchangegroup() 387 - other values as described by addchangegroup()
388 ''' 388 """
389 if opargs is None: 389 if opargs is None:
390 opargs = {} 390 opargs = {}
391 pushop = pushoperation( 391 pushop = pushoperation(
392 repo, 392 repo,
393 remote, 393 remote,
1508 pullop.common = headsofunion(new_heads, pullop.common) 1508 pullop.common = headsofunion(new_heads, pullop.common)
1509 pullop.rheads = set(pullop.rheads) - pullop.common 1509 pullop.rheads = set(pullop.rheads) - pullop.common
1510 1510
1511 1511
1512 def add_confirm_callback(repo, pullop): 1512 def add_confirm_callback(repo, pullop):
1513 """ adds a finalize callback to transaction which can be used to show stats 1513 """adds a finalize callback to transaction which can be used to show stats
1514 to user and confirm the pull before committing transaction """ 1514 to user and confirm the pull before committing transaction"""
1515 1515
1516 tr = pullop.trmanager.transaction() 1516 tr = pullop.trmanager.transaction()
1517 scmutil.registersummarycallback( 1517 scmutil.registersummarycallback(
1518 repo, tr, txnname=b'pull', as_validator=True 1518 repo, tr, txnname=b'pull', as_validator=True
1519 ) 1519 )
1890 b'pull', common=pullop.common, heads=pullop.heads or pullop.rheads 1890 b'pull', common=pullop.common, heads=pullop.heads or pullop.rheads
1891 ) 1891 )
1892 elif pullop.heads is None: 1892 elif pullop.heads is None:
1893 with pullop.remote.commandexecutor() as e: 1893 with pullop.remote.commandexecutor() as e:
1894 cg = e.callcommand( 1894 cg = e.callcommand(
1895 b'changegroup', {b'nodes': pullop.fetch, b'source': b'pull',} 1895 b'changegroup',
1896 {
1897 b'nodes': pullop.fetch,
1898 b'source': b'pull',
1899 },
1896 ).result() 1900 ).result()
1897 1901
1898 elif not pullop.remote.capable(b'changegroupsubset'): 1902 elif not pullop.remote.capable(b'changegroupsubset'):
1899 raise error.Abort( 1903 raise error.Abort(
1900 _( 1904 _(