--- a/hgext/infinitepush/bundleparts.py Sat Oct 05 10:29:34 2019 -0400
+++ b/hgext/infinitepush/bundleparts.py Sun Oct 06 09:45:02 2019 -0400
@@ -23,6 +23,7 @@
scratchbranchparttype = 'b2x:infinitepush'
+
def getscratchbranchparts(repo, peer, outgoing, ui, bookmark):
if not outgoing.missing:
raise error.Abort(_('no commits to push'))
@@ -30,8 +31,9 @@
if scratchbranchparttype not in bundle2.bundle2caps(peer):
raise error.Abort(_('no server support for %r') % scratchbranchparttype)
- _validaterevset(repo, revsetlang.formatspec('%ln', outgoing.missing),
- bookmark)
+ _validaterevset(
+ repo, revsetlang.formatspec('%ln', outgoing.missing), bookmark
+ )
supportedversions = changegroup.supportedoutgoingversions(repo)
# Explicitly avoid using '01' changegroup version in infinitepush to
@@ -60,13 +62,17 @@
# .upper() marks this as a mandatory part: server will abort if there's no
# handler
- parts.append(bundle2.bundlepart(
- scratchbranchparttype.upper(),
- advisoryparams=params.iteritems(),
- data=cg))
+ parts.append(
+ bundle2.bundlepart(
+ scratchbranchparttype.upper(),
+ advisoryparams=params.iteritems(),
+ data=cg,
+ )
+ )
return parts
+
def _validaterevset(repo, revset, bookmark):
"""Abort if the revs to be pushed aren't valid for a scratch branch."""
if not repo.revs(revset):
@@ -76,7 +82,9 @@
heads = repo.revs('heads(%r)', revset)
if len(heads) > 1:
raise error.Abort(
- _('cannot push more than one head to a scratch branch'))
+ _('cannot push more than one head to a scratch branch')
+ )
+
def _handlelfs(repo, missing):
'''Special case if lfs is enabled
@@ -91,6 +99,7 @@
# Ignore if lfs extension is not enabled
return
+
class copiedpart(object):
"""a copy of unbundlepart content that can be consumed later"""