Mercurial > hg
comparison mercurial/discovery.py @ 47759:d7515d29761d stable 5.9rc0
branching: merge default into stable
This mark the start of the 5.9 freeze.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 21 Jul 2021 22:52:09 +0200 |
parents | d55b71393907 |
children | 61fe7e17f21b |
comparison
equal
deleted
inserted
replaced
47506:29ea3b4c4f62 | 47759:d7515d29761d |
---|---|
10 import functools | 10 import functools |
11 | 11 |
12 from .i18n import _ | 12 from .i18n import _ |
13 from .node import ( | 13 from .node import ( |
14 hex, | 14 hex, |
15 nullid, | |
16 short, | 15 short, |
17 ) | 16 ) |
18 | 17 |
19 from . import ( | 18 from . import ( |
20 bookmarks, | 19 bookmarks, |
105 if ancestorsof is None: | 104 if ancestorsof is None: |
106 ancestorsof = cl.heads() | 105 ancestorsof = cl.heads() |
107 if missingroots: | 106 if missingroots: |
108 discbases = [] | 107 discbases = [] |
109 for n in missingroots: | 108 for n in missingroots: |
110 discbases.extend([p for p in cl.parents(n) if p != nullid]) | 109 discbases.extend([p for p in cl.parents(n) if p != repo.nullid]) |
111 # TODO remove call to nodesbetween. | 110 # TODO remove call to nodesbetween. |
112 # TODO populate attributes on outgoing instance instead of setting | 111 # TODO populate attributes on outgoing instance instead of setting |
113 # discbases. | 112 # discbases. |
114 csets, roots, heads = cl.nodesbetween(missingroots, ancestorsof) | 113 csets, roots, heads = cl.nodesbetween(missingroots, ancestorsof) |
115 included = set(csets) | 114 included = set(csets) |
116 ancestorsof = heads | 115 ancestorsof = heads |
117 commonheads = [n for n in discbases if n not in included] | 116 commonheads = [n for n in discbases if n not in included] |
118 elif not commonheads: | 117 elif not commonheads: |
119 commonheads = [nullid] | 118 commonheads = [repo.nullid] |
120 self.commonheads = commonheads | 119 self.commonheads = commonheads |
121 self.ancestorsof = ancestorsof | 120 self.ancestorsof = ancestorsof |
122 self._revlog = cl | 121 self._revlog = cl |
123 self._common = None | 122 self._common = None |
124 self._missing = None | 123 self._missing = None |
379 # To be a remote head after push, node must be either: | 378 # To be a remote head after push, node must be either: |
380 # - unknown locally | 379 # - unknown locally |
381 # - a local outgoing head descended from update | 380 # - a local outgoing head descended from update |
382 # - a remote head that's known locally and not | 381 # - a remote head that's known locally and not |
383 # ancestral to an outgoing head | 382 # ancestral to an outgoing head |
384 if remoteheads == [nullid]: | 383 if remoteheads == [repo.nullid]: |
385 # remote is empty, nothing to check. | 384 # remote is empty, nothing to check. |
386 return | 385 return |
387 | 386 |
388 if remote.capable(b'branchmap'): | 387 if remote.capable(b'branchmap'): |
389 headssum = _headssummary(pushop) | 388 headssum = _headssummary(pushop) |