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) |