def _addpushbackchangegroup(repo, reply, outgoing): '''adds changegroup part to reply containing revs from outgoing.missing''' cgversions = set(reply.capabilities.get('changegroup')) if not cgversions: cgversions.add('01') version = max(cgversions & set(changegroup.supportedoutgoingversions(repo))) cg = changegroup.getlocalchangegroupraw(repo, 'rebase:reply', outgoing, version = version) cgpart = reply.newpart('CHANGEGROUP', data=cg) if version != '01': cgpart.addparam('version', version)
def _addpushbackchangegroup(repo, reply, outgoing): '''adds changegroup part to reply containing revs from outgoing.missing''' cgversions = set(reply.capabilities.get('changegroup')) if not cgversions: cgversions.add('01') version = max(cgversions & set(changegroup.packermap.keys())) cg = changegroup.getlocalchangegroupraw(repo, 'rebase:reply', outgoing, version = version) cgpart = reply.newpart('CHANGEGROUP', data = cg) if version != '01': cgpart.addparam('version', version)
def getrebasepart(repo, peer, outgoing, onto, newhead=False): if not outgoing.missing: raise util.Abort(_('no commits to rebase')) if rebaseparttype not in bundle2.bundle2caps(peer): raise util.Abort(_('no server support for %r') % rebaseparttype) validaterevset(repo, revset.formatspec('%ln', outgoing.missing)) cg = changegroup.getlocalchangegroupraw(repo, 'push', outgoing) # .upper() marks this as a mandatory part: server will abort if there's no # handler return bundle2.bundlepart(rebaseparttype.upper(), mandatoryparams={'onto': onto, 'newhead': repr(newhead), }.items(), data = cg)
def getrebasepart(repo, peer, outgoing, onto, newhead): if not outgoing.missing: raise error.Abort(_('no commits to rebase')) if rebaseparttype not in bundle2.bundle2caps(peer): raise error.Abort(_('no server support for %r') % rebaseparttype) validaterevset(repo, revset.formatspec('%ln', outgoing.missing)) cg = changegroup.getlocalchangegroupraw(repo, 'push', outgoing) # .upper() marks this as a mandatory part: server will abort if there's no # handler return bundle2.bundlepart( rebaseparttype.upper(), mandatoryparams={ 'onto': onto, 'newhead': repr(newhead), }.items(), data = cg)