##// END OF EJS Templates
changegroup: replace getsubset with makechangegroup...
Durham Goode -
r34098:f85dfde1 default
parent child Browse files
Show More
@@ -912,6 +912,18 b' def _changegroupinfo(repo, nodes, source'
912 for node in nodes:
912 for node in nodes:
913 repo.ui.debug("%s\n" % hex(node))
913 repo.ui.debug("%s\n" % hex(node))
914
914
915 def makestream(repo, outgoing, version, source, fastpath=False,
916 bundlecaps=None):
917 bundler = getbundler(version, repo, bundlecaps=bundlecaps)
918 return getsubsetraw(repo, outgoing, bundler, source, fastpath=fastpath)
919
920 def makechangegroup(repo, outgoing, version, source, fastpath=False,
921 bundlecaps=None):
922 cgstream = makestream(repo, outgoing, version, source,
923 fastpath=fastpath, bundlecaps=bundlecaps)
924 return getunbundler(version, util.chunkbuffer(cgstream), None,
925 {'clcount': len(outgoing.missing) })
926
915 def getsubsetraw(repo, outgoing, bundler, source, fastpath=False):
927 def getsubsetraw(repo, outgoing, bundler, source, fastpath=False):
916 repo = repo.unfiltered()
928 repo = repo.unfiltered()
917 commonrevs = outgoing.common
929 commonrevs = outgoing.common
@@ -928,11 +940,6 b' def getsubsetraw(repo, outgoing, bundler'
928 _changegroupinfo(repo, csets, source)
940 _changegroupinfo(repo, csets, source)
929 return bundler.generate(commonrevs, csets, fastpathlinkrev, source)
941 return bundler.generate(commonrevs, csets, fastpathlinkrev, source)
930
942
931 def getsubset(repo, outgoing, bundler, source, fastpath=False):
932 gengroup = getsubsetraw(repo, outgoing, bundler, source, fastpath)
933 return getunbundler(bundler.version, util.chunkbuffer(gengroup), None,
934 {'clcount': len(outgoing.missing)})
935
936 def changegroupsubset(repo, roots, heads, source, version='01'):
943 def changegroupsubset(repo, roots, heads, source, version='01'):
937 """Compute a changegroup consisting of all the nodes that are
944 """Compute a changegroup consisting of all the nodes that are
938 descendants of any of the roots and ancestors of any of the heads.
945 descendants of any of the roots and ancestors of any of the heads.
@@ -947,8 +954,7 b' def changegroupsubset(repo, roots, heads'
947 the changegroup a particular filenode or manifestnode belongs to.
954 the changegroup a particular filenode or manifestnode belongs to.
948 """
955 """
949 outgoing = discovery.outgoing(repo, missingroots=roots, missingheads=heads)
956 outgoing = discovery.outgoing(repo, missingroots=roots, missingheads=heads)
950 bundler = getbundler(version, repo)
957 return makechangegroup(repo, outgoing, version, source)
951 return getsubset(repo, outgoing, bundler, source)
952
958
953 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None,
959 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None,
954 version='01'):
960 version='01'):
@@ -969,8 +975,8 b' def getchangegroup(repo, source, outgoin'
969 precomputed sets in outgoing."""
975 precomputed sets in outgoing."""
970 if not outgoing.missing:
976 if not outgoing.missing:
971 return None
977 return None
972 bundler = getbundler(version, repo, bundlecaps)
978 return makechangegroup(repo, outgoing, version, source,
973 return getsubset(repo, outgoing, bundler, source)
979 bundlecaps=bundlecaps)
974
980
975 def getlocalchangegroup(repo, *args, **kwargs):
981 def getlocalchangegroup(repo, *args, **kwargs):
976 repo.ui.deprecwarn('getlocalchangegroup is deprecated, use getchangegroup',
982 repo.ui.deprecwarn('getlocalchangegroup is deprecated, use getchangegroup',
@@ -963,12 +963,8 b' def _pushchangeset(pushop):'
963 or pushop.repo.changelog.filteredrevs):
963 or pushop.repo.changelog.filteredrevs):
964 # push everything,
964 # push everything,
965 # use the fast path, no race possible on push
965 # use the fast path, no race possible on push
966 bundler = changegroup.cg1packer(pushop.repo, bundlecaps)
966 cg = changegroup.makechangegroup(pushop.repo, outgoing, '01', 'push',
967 cg = changegroup.getsubset(pushop.repo,
967 fastpath=True, bundlecaps=bundlecaps)
968 outgoing,
969 bundler,
970 'push',
971 fastpath=True)
972 else:
968 else:
973 cg = changegroup.getchangegroup(pushop.repo, 'push', outgoing,
969 cg = changegroup.getchangegroup(pushop.repo, 'push', outgoing,
974 bundlecaps=bundlecaps)
970 bundlecaps=bundlecaps)
General Comments 0
You need to be logged in to leave comments. Login now