##// END OF EJS Templates
changegroup: replace changegroupsubset with makechangegroup...
Durham Goode -
r34099:f7d41b85 default
parent child Browse files
Show More
@@ -33,6 +33,7 b' from mercurial import ('
33 bundlerepo,
33 bundlerepo,
34 changegroup,
34 changegroup,
35 cmdutil,
35 cmdutil,
36 discovery,
36 error,
37 error,
37 exchange,
38 exchange,
38 hg,
39 hg,
@@ -145,8 +146,11 b' class shelvedfile(object):'
145 btype = 'HG20'
146 btype = 'HG20'
146 compression = 'BZ'
147 compression = 'BZ'
147
148
148 cg = changegroup.changegroupsubset(self.repo, bases, [node], 'shelve',
149 outgoing = discovery.outgoing(self.repo, missingroots=bases,
149 version=cgversion)
150 missingheads=[node])
151 cg = changegroup.makechangegroup(self.repo, outgoing, cgversion,
152 'shelve')
153
150 bundle2.writebundle(self.ui, cg, self.fname, btype, self.vfs,
154 bundle2.writebundle(self.ui, cg, self.fname, btype, self.vfs,
151 compression=compression)
155 compression=compression)
152
156
@@ -940,22 +940,6 b' def getsubsetraw(repo, outgoing, bundler'
940 _changegroupinfo(repo, csets, source)
940 _changegroupinfo(repo, csets, source)
941 return bundler.generate(commonrevs, csets, fastpathlinkrev, source)
941 return bundler.generate(commonrevs, csets, fastpathlinkrev, source)
942
942
943 def changegroupsubset(repo, roots, heads, source, version='01'):
944 """Compute a changegroup consisting of all the nodes that are
945 descendants of any of the roots and ancestors of any of the heads.
946 Return a chunkbuffer object whose read() method will return
947 successive changegroup chunks.
948
949 It is fairly complex as determining which filenodes and which
950 manifest nodes need to be included for the changeset to be complete
951 is non-trivial.
952
953 Another wrinkle is doing the reverse, figuring out which changeset in
954 the changegroup a particular filenode or manifestnode belongs to.
955 """
956 outgoing = discovery.outgoing(repo, missingroots=roots, missingheads=heads)
957 return makechangegroup(repo, outgoing, version, source)
958
959 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None,
943 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None,
960 version='01'):
944 version='01'):
961 """Like getbundle, but taking a discovery.outgoing as an argument.
945 """Like getbundle, but taking a discovery.outgoing as an argument.
@@ -985,7 +969,9 b' def getlocalchangegroup(repo, *args, **k'
985
969
986 def changegroup(repo, basenodes, source):
970 def changegroup(repo, basenodes, source):
987 # to avoid a race we use changegroupsubset() (issue1320)
971 # to avoid a race we use changegroupsubset() (issue1320)
988 return changegroupsubset(repo, basenodes, repo.heads(), source)
972 outgoing = discovery.outgoing(repo, missingroots=basenodes,
973 missingheads=repo.heads())
974 return makechangegroup(repo, outgoing, '01', source)
989
975
990 def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles):
976 def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles):
991 revisions = 0
977 revisions = 0
@@ -31,6 +31,7 b' from . import ('
31 context,
31 context,
32 dirstate,
32 dirstate,
33 dirstateguard,
33 dirstateguard,
34 discovery,
34 encoding,
35 encoding,
35 error,
36 error,
36 exchange,
37 exchange,
@@ -289,7 +290,9 b' class locallegacypeer(repository.legacyp'
289 return changegroup.changegroup(self._repo, basenodes, source)
290 return changegroup.changegroup(self._repo, basenodes, source)
290
291
291 def changegroupsubset(self, bases, heads, source):
292 def changegroupsubset(self, bases, heads, source):
292 return changegroup.changegroupsubset(self._repo, bases, heads, source)
293 outgoing = discovery.outgoing(self._repo, missingroots=bases,
294 missingheads=heads)
295 return changegroup.makechangegroup(self._repo, outgoing, '01', source)
293
296
294 # End of baselegacywirecommands interface.
297 # End of baselegacywirecommands interface.
295
298
@@ -21,6 +21,7 b' from .node import ('
21 from . import (
21 from . import (
22 bundle2,
22 bundle2,
23 changegroup as changegroupmod,
23 changegroup as changegroupmod,
24 discovery,
24 encoding,
25 encoding,
25 error,
26 error,
26 exchange,
27 exchange,
@@ -801,7 +802,9 b' def changegroup(repo, proto, roots):'
801 def changegroupsubset(repo, proto, bases, heads):
802 def changegroupsubset(repo, proto, bases, heads):
802 bases = decodelist(bases)
803 bases = decodelist(bases)
803 heads = decodelist(heads)
804 heads = decodelist(heads)
804 cg = changegroupmod.changegroupsubset(repo, bases, heads, 'serve')
805 outgoing = discovery.outgoing(repo, missingroots=bases,
806 missingheads=heads)
807 cg = changegroupmod.makechangegroup(repo, outgoing, '01', 'serve')
805 return streamres(reader=cg, v1compressible=True)
808 return streamres(reader=cg, v1compressible=True)
806
809
807 @wireprotocommand('debugwireargs', 'one two *')
810 @wireprotocommand('debugwireargs', 'one two *')
General Comments 0
You need to be logged in to leave comments. Login now