Show More
@@ -480,3 +480,13 b' def changegroupsubset(repo, roots, heads' | |||||
480 | bundler = bundle10(repo) |
|
480 | bundler = bundle10(repo) | |
481 | return getsubset(repo, outgoing, bundler, source) |
|
481 | return getsubset(repo, outgoing, bundler, source) | |
482 |
|
482 | |||
|
483 | def getlocalbundle(repo, source, outgoing, bundlecaps=None): | |||
|
484 | """Like getbundle, but taking a discovery.outgoing as an argument. | |||
|
485 | ||||
|
486 | This is only implemented for local repos and reuses potentially | |||
|
487 | precomputed sets in outgoing.""" | |||
|
488 | if not outgoing.missing: | |||
|
489 | return None | |||
|
490 | bundler = bundle10(repo, bundlecaps) | |||
|
491 | return getsubset(repo, outgoing, bundler, source) | |||
|
492 |
@@ -1142,7 +1142,7 b' def bundle(ui, repo, fname, dest=None, *' | |||||
1142 | onlyheads=heads, |
|
1142 | onlyheads=heads, | |
1143 | force=opts.get('force'), |
|
1143 | force=opts.get('force'), | |
1144 | portable=True) |
|
1144 | portable=True) | |
1145 |
cg = |
|
1145 | cg = changegroup.getlocalbundle(repo, 'bundle', outgoing, bundlecaps) | |
1146 | if not cg: |
|
1146 | if not cg: | |
1147 | scmutil.nochangesfound(ui, repo, outgoing and outgoing.excluded) |
|
1147 | scmutil.nochangesfound(ui, repo, outgoing and outgoing.excluded) | |
1148 | return 1 |
|
1148 | return 1 |
@@ -187,7 +187,8 b' def _pushchangeset(pushop):' | |||||
187 | 'push', |
|
187 | 'push', | |
188 | fastpath=True) |
|
188 | fastpath=True) | |
189 | else: |
|
189 | else: | |
190 |
cg = pushop.repo |
|
190 | cg = changegroup.getlocalbundle(pushop.repo, 'push', outgoing, | |
|
191 | bundlecaps) | |||
191 |
|
192 | |||
192 | # apply changegroup to remote |
|
193 | # apply changegroup to remote | |
193 | if unbundle: |
|
194 | if unbundle: |
@@ -1683,16 +1683,6 b' class localrepository(object):' | |||||
1683 | def push(self, remote, force=False, revs=None, newbranch=False): |
|
1683 | def push(self, remote, force=False, revs=None, newbranch=False): | |
1684 | return exchange.push(self, remote, force, revs, newbranch) |
|
1684 | return exchange.push(self, remote, force, revs, newbranch) | |
1685 |
|
1685 | |||
1686 | def getlocalbundle(self, source, outgoing, bundlecaps=None): |
|
|||
1687 | """Like getbundle, but taking a discovery.outgoing as an argument. |
|
|||
1688 |
|
||||
1689 | This is only implemented for local repos and reuses potentially |
|
|||
1690 | precomputed sets in outgoing.""" |
|
|||
1691 | if not outgoing.missing: |
|
|||
1692 | return None |
|
|||
1693 | bundler = changegroup.bundle10(self, bundlecaps) |
|
|||
1694 | return changegroup.getsubset(self, outgoing, bundler, source) |
|
|||
1695 |
|
||||
1696 | def getbundle(self, source, heads=None, common=None, bundlecaps=None): |
|
1686 | def getbundle(self, source, heads=None, common=None, bundlecaps=None): | |
1697 | """Like changegroupsubset, but returns the set difference between the |
|
1687 | """Like changegroupsubset, but returns the set difference between the | |
1698 | ancestors of heads and the ancestors common. |
|
1688 | ancestors of heads and the ancestors common. | |
@@ -1710,9 +1700,9 b' class localrepository(object):' | |||||
1710 | common = [nullid] |
|
1700 | common = [nullid] | |
1711 | if not heads: |
|
1701 | if not heads: | |
1712 | heads = cl.heads() |
|
1702 | heads = cl.heads() | |
1713 | return self.getlocalbundle(source, |
|
1703 | outgoing = discovery.outgoing(cl, common, heads) | |
1714 | discovery.outgoing(cl, common, heads), |
|
1704 | return changegroup.getlocalbundle(self, source, outgoing, | |
1715 | bundlecaps=bundlecaps) |
|
1705 | bundlecaps=bundlecaps) | |
1716 |
|
1706 | |||
1717 | def changegroup(self, basenodes, source): |
|
1707 | def changegroup(self, basenodes, source): | |
1718 | # to avoid a race we use changegroupsubset() (issue1320) |
|
1708 | # to avoid a race we use changegroupsubset() (issue1320) |
General Comments 0
You need to be logged in to leave comments.
Login now