Show More
@@ -27,7 +27,7 from . import ( | |||||
27 | util, |
|
27 | util, | |
28 | ) |
|
28 | ) | |
29 |
|
29 | |||
30 | def findcommonincoming(repo, remote, heads=None, force=False): |
|
30 | def findcommonincoming(repo, remote, heads=None, force=False, ancestorsof=None): | |
31 | """Return a tuple (common, anyincoming, heads) used to identify the common |
|
31 | """Return a tuple (common, anyincoming, heads) used to identify the common | |
32 | subset of nodes between repo and remote. |
|
32 | subset of nodes between repo and remote. | |
33 |
|
33 | |||
@@ -38,6 +38,9 def findcommonincoming(repo, remote, hea | |||||
38 | changegroupsubset. No code except for pull should be relying on this fact |
|
38 | changegroupsubset. No code except for pull should be relying on this fact | |
39 | any longer. |
|
39 | any longer. | |
40 | "heads" is either the supplied heads, or else the remote's heads. |
|
40 | "heads" is either the supplied heads, or else the remote's heads. | |
|
41 | "ancestorsof" if not None, restrict the discovery to a subset defined by | |||
|
42 | these nodes. Changeset outside of this set won't be considered (and | |||
|
43 | won't appears in "common") | |||
41 |
|
44 | |||
42 | If you pass heads and they are all known locally, the response lists just |
|
45 | If you pass heads and they are all known locally, the response lists just | |
43 | these heads in "common" and in "heads". |
|
46 | these heads in "common" and in "heads". | |
@@ -60,7 +63,8 def findcommonincoming(repo, remote, hea | |||||
60 | return (heads, False, heads) |
|
63 | return (heads, False, heads) | |
61 |
|
64 | |||
62 | res = setdiscovery.findcommonheads(repo.ui, repo, remote, |
|
65 | res = setdiscovery.findcommonheads(repo.ui, repo, remote, | |
63 |
abortwhenunrelated=not force |
|
66 | abortwhenunrelated=not force, | |
|
67 | ancestorsof=ancestorsof) | |||
64 | common, anyinc, srvheads = res |
|
68 | common, anyinc, srvheads = res | |
65 | return (list(common), anyinc, heads or list(srvheads)) |
|
69 | return (list(common), anyinc, heads or list(srvheads)) | |
66 |
|
70 | |||
@@ -142,7 +146,8 def findcommonoutgoing(repo, other, only | |||||
142 |
|
146 | |||
143 | # get common set if not provided |
|
147 | # get common set if not provided | |
144 | if commoninc is None: |
|
148 | if commoninc is None: | |
145 |
commoninc = findcommonincoming(repo, other, force=force |
|
149 | commoninc = findcommonincoming(repo, other, force=force, | |
|
150 | ancestorsof=onlyheads) | |||
146 | og.commonheads, _any, _hds = commoninc |
|
151 | og.commonheads, _any, _hds = commoninc | |
147 |
|
152 | |||
148 | # compute outgoing |
|
153 | # compute outgoing |
@@ -514,6 +514,10 def _pushdiscovery(pushop): | |||||
514 | def _pushdiscoverychangeset(pushop): |
|
514 | def _pushdiscoverychangeset(pushop): | |
515 | """discover the changeset that need to be pushed""" |
|
515 | """discover the changeset that need to be pushed""" | |
516 | fci = discovery.findcommonincoming |
|
516 | fci = discovery.findcommonincoming | |
|
517 | if pushop.revs: | |||
|
518 | commoninc = fci(pushop.repo, pushop.remote, force=pushop.force, | |||
|
519 | ancestorsof=pushop.revs) | |||
|
520 | else: | |||
517 | commoninc = fci(pushop.repo, pushop.remote, force=pushop.force) |
|
521 | commoninc = fci(pushop.repo, pushop.remote, force=pushop.force) | |
518 | common, inc, remoteheads = commoninc |
|
522 | common, inc, remoteheads = commoninc | |
519 | fco = discovery.findcommonoutgoing |
|
523 | fco = discovery.findcommonoutgoing |
General Comments 0
You need to be logged in to leave comments.
Login now