Mercurial > hg
diff hgext/infinitepush/bundleparts.py @ 43076:2372284d9457
formatting: blacken the codebase
This is using my patch to black
(https://github.com/psf/black/pull/826) so we don't un-wrap collection
literals.
Done with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**"' | xargs black -S
# skip-blame mass-reformatting only
# no-check-commit reformats foo_bar functions
Differential Revision: https://phab.mercurial-scm.org/D6971
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:45:02 -0400 |
parents | e3bb2a58af1e |
children | 687b865b95ad |
line wrap: on
line diff
--- 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"""