##// END OF EJS Templates
push: move outgoing object in the push object...
Pierre-Yves David -
r20440:400da8bc default
parent child Browse files
Show More
@@ -42,6 +42,8 b' class pushoperation(object):'
42 # we have outgoing changesets but refused to push
42 # we have outgoing changesets but refused to push
43 # - other values as described by addchangegroup()
43 # - other values as described by addchangegroup()
44 self.ret = None
44 self.ret = None
45 # discover.outgoing object (contains common and outgoin data)
46 self.outgoing = None
45
47
46 def push(repo, remote, force=False, revs=None, newbranch=False):
48 def push(repo, remote, force=False, revs=None, newbranch=False):
47 '''Push outgoing changesets (limited by revs) from a local
49 '''Push outgoing changesets (limited by revs) from a local
@@ -101,6 +103,7 b' def push(repo, remote, force=False, revs'
101 fco = discovery.findcommonoutgoing
103 fco = discovery.findcommonoutgoing
102 outgoing = fco(unfi, pushop.remote, onlyheads=pushop.revs,
104 outgoing = fco(unfi, pushop.remote, onlyheads=pushop.revs,
103 commoninc=commoninc, force=pushop.force)
105 commoninc=commoninc, force=pushop.force)
106 pushop.outgoing = outgoing
104
107
105
108
106 if not outgoing.missing:
109 if not outgoing.missing:
@@ -172,10 +175,10 b' def push(repo, remote, force=False, revs'
172
175
173 if pushop.ret:
176 if pushop.ret:
174 # push succeed, synchronize target of the push
177 # push succeed, synchronize target of the push
175 cheads = outgoing.missingheads
178 cheads = pushop.outgoing.missingheads
176 elif pushop.revs is None:
179 elif pushop.revs is None:
177 # All out push fails. synchronize all common
180 # All out push fails. synchronize all common
178 cheads = outgoing.commonheads
181 cheads = pushop.outgoing.commonheads
179 else:
182 else:
180 # I want cheads = heads(::missingheads and ::commonheads)
183 # I want cheads = heads(::missingheads and ::commonheads)
181 # (missingheads is revs with secret changeset filtered out)
184 # (missingheads is revs with secret changeset filtered out)
@@ -191,14 +194,14 b' def push(repo, remote, force=False, revs'
191 #
194 #
192 # We can pick:
195 # We can pick:
193 # * missingheads part of common (::commonheads)
196 # * missingheads part of common (::commonheads)
194 common = set(outgoing.common)
197 common = set(pushop.outgoing.common)
195 nm = pushop.repo.changelog.nodemap
198 nm = pushop.repo.changelog.nodemap
196 cheads = [node for node in pushop.revs if nm[node] in common]
199 cheads = [node for node in pushop.revs if nm[node] in common]
197 # and
200 # and
198 # * commonheads parents on missing
201 # * commonheads parents on missing
199 revset = unfi.set('%ln and parents(roots(%ln))',
202 revset = unfi.set('%ln and parents(roots(%ln))',
200 outgoing.commonheads,
203 pushop.outgoing.commonheads,
201 outgoing.missing)
204 pushop.outgoing.missing)
202 cheads.extend(c.node() for c in revset)
205 cheads.extend(c.node() for c in revset)
203 # even when we don't push, exchanging phase data is useful
206 # even when we don't push, exchanging phase data is useful
204 remotephases = pushop.remote.listkeys('phases')
207 remotephases = pushop.remote.listkeys('phases')
General Comments 0
You need to be logged in to leave comments. Login now