##// END OF EJS Templates
exchange: guard against method invocation on `b2caps=None` args...
Matt Harbison -
r44158:0dbea180 default draft
parent child Browse files
Show More
@@ -2474,7 +2474,7 b' def _getbundlechangegrouppart('
2474 **kwargs
2474 **kwargs
2475 ):
2475 ):
2476 """add a changegroup part to the requested bundle"""
2476 """add a changegroup part to the requested bundle"""
2477 if not kwargs.get('cg', True):
2477 if not kwargs.get('cg', True) or not b2caps:
2478 return
2478 return
2479
2479
2480 version = b'01'
2480 version = b'01'
@@ -2536,7 +2536,7 b' def _getbundlebookmarkpart('
2536 """add a bookmark part to the requested bundle"""
2536 """add a bookmark part to the requested bundle"""
2537 if not kwargs.get('bookmarks', False):
2537 if not kwargs.get('bookmarks', False):
2538 return
2538 return
2539 if b'bookmarks' not in b2caps:
2539 if not b2caps or b'bookmarks' not in b2caps:
2540 raise error.Abort(_(b'no common bookmarks exchange method'))
2540 raise error.Abort(_(b'no common bookmarks exchange method'))
2541 books = bookmod.listbinbookmarks(repo)
2541 books = bookmod.listbinbookmarks(repo)
2542 data = bookmod.binaryencode(books)
2542 data = bookmod.binaryencode(books)
@@ -2577,7 +2577,7 b' def _getbundlephasespart('
2577 ):
2577 ):
2578 """add phase heads part to the requested bundle"""
2578 """add phase heads part to the requested bundle"""
2579 if kwargs.get('phases', False):
2579 if kwargs.get('phases', False):
2580 if not b'heads' in b2caps.get(b'phases'):
2580 if not b2caps or not b'heads' in b2caps.get(b'phases'):
2581 raise error.Abort(_(b'no common phases exchange method'))
2581 raise error.Abort(_(b'no common phases exchange method'))
2582 if heads is None:
2582 if heads is None:
2583 heads = repo.heads()
2583 heads = repo.heads()
@@ -2641,7 +2641,7 b' def _getbundletagsfnodes('
2641 # Don't send unless:
2641 # Don't send unless:
2642 # - changeset are being exchanged,
2642 # - changeset are being exchanged,
2643 # - the client supports it.
2643 # - the client supports it.
2644 if not (kwargs.get('cg', True) and b'hgtagsfnodes' in b2caps):
2644 if not b2caps or not (kwargs.get('cg', True) and b'hgtagsfnodes' in b2caps):
2645 return
2645 return
2646
2646
2647 outgoing = _computeoutgoing(repo, heads, common)
2647 outgoing = _computeoutgoing(repo, heads, common)
@@ -2675,6 +2675,7 b' def _getbundlerevbranchcache('
2675 # - narrow bundle isn't in play (not currently compatible).
2675 # - narrow bundle isn't in play (not currently compatible).
2676 if (
2676 if (
2677 not kwargs.get('cg', True)
2677 not kwargs.get('cg', True)
2678 or not b2caps
2678 or b'rev-branch-cache' not in b2caps
2679 or b'rev-branch-cache' not in b2caps
2679 or kwargs.get('narrow', False)
2680 or kwargs.get('narrow', False)
2680 or repo.ui.has_section(_NARROWACL_SECTION)
2681 or repo.ui.has_section(_NARROWACL_SECTION)
General Comments 0
You need to be logged in to leave comments. Login now