Show More
@@ -33,6 +33,7 b' from mercurial import (' | |||
|
33 | 33 | bundlerepo, |
|
34 | 34 | changegroup, |
|
35 | 35 | cmdutil, |
|
36 | discovery, | |
|
36 | 37 | error, |
|
37 | 38 | exchange, |
|
38 | 39 | hg, |
@@ -145,8 +146,11 b' class shelvedfile(object):' | |||
|
145 | 146 | btype = 'HG20' |
|
146 | 147 | compression = 'BZ' |
|
147 | 148 | |
|
148 | cg = changegroup.changegroupsubset(self.repo, bases, [node], 'shelve', | |
|
149 |
|
|
|
149 | outgoing = discovery.outgoing(self.repo, missingroots=bases, | |
|
150 | missingheads=[node]) | |
|
151 | cg = changegroup.makechangegroup(self.repo, outgoing, cgversion, | |
|
152 | 'shelve') | |
|
153 | ||
|
150 | 154 | bundle2.writebundle(self.ui, cg, self.fname, btype, self.vfs, |
|
151 | 155 | compression=compression) |
|
152 | 156 |
@@ -940,22 +940,6 b' def getsubsetraw(repo, outgoing, bundler' | |||
|
940 | 940 | _changegroupinfo(repo, csets, source) |
|
941 | 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 | 943 | def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None, |
|
960 | 944 | version='01'): |
|
961 | 945 | """Like getbundle, but taking a discovery.outgoing as an argument. |
@@ -985,7 +969,9 b' def getlocalchangegroup(repo, *args, **k' | |||
|
985 | 969 | |
|
986 | 970 | def changegroup(repo, basenodes, source): |
|
987 | 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 | 976 | def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles): |
|
991 | 977 | revisions = 0 |
@@ -31,6 +31,7 b' from . import (' | |||
|
31 | 31 | context, |
|
32 | 32 | dirstate, |
|
33 | 33 | dirstateguard, |
|
34 | discovery, | |
|
34 | 35 | encoding, |
|
35 | 36 | error, |
|
36 | 37 | exchange, |
@@ -289,7 +290,9 b' class locallegacypeer(repository.legacyp' | |||
|
289 | 290 | return changegroup.changegroup(self._repo, basenodes, source) |
|
290 | 291 | |
|
291 | 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 | 297 | # End of baselegacywirecommands interface. |
|
295 | 298 |
@@ -21,6 +21,7 b' from .node import (' | |||
|
21 | 21 | from . import ( |
|
22 | 22 | bundle2, |
|
23 | 23 | changegroup as changegroupmod, |
|
24 | discovery, | |
|
24 | 25 | encoding, |
|
25 | 26 | error, |
|
26 | 27 | exchange, |
@@ -801,7 +802,9 b' def changegroup(repo, proto, roots):' | |||
|
801 | 802 | def changegroupsubset(repo, proto, bases, heads): |
|
802 | 803 | bases = decodelist(bases) |
|
803 | 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 | 808 | return streamres(reader=cg, v1compressible=True) |
|
806 | 809 | |
|
807 | 810 | @wireprotocommand('debugwireargs', 'one two *') |
General Comments 0
You need to be logged in to leave comments.
Login now