##// END OF EJS Templates
discovery: simplify findoutgoing(), the updated_head stuff wasn't used
Benoit Boissinot -
r11576:98c874a9 default
parent child Browse files
Show More
@@ -174,18 +174,17 b' def findcommonincoming(repo, remote, bas'
174
174
175 return base.keys(), list(fetch), heads
175 return base.keys(), list(fetch), heads
176
176
177 def findoutgoing(repo, remote, base=None, heads=None, force=False):
177 def findoutgoing(repo, remote, base=None, remoteheads=None, force=False):
178 """Return list of nodes that are roots of subsets not in remote
178 """Return list of nodes that are roots of subsets not in remote
179
179
180 If base dict is specified, assume that these nodes and their parents
180 If base dict is specified, assume that these nodes and their parents
181 exist on the remote side.
181 exist on the remote side.
182 If a list of heads is specified, return only nodes which are heads
182 If remotehead is specified, assume it is the list of the heads from
183 or ancestors of these heads, and return a second element which
183 the remote repository.
184 contains all remote heads which get new children.
185 """
184 """
186 if base is None:
185 if base is None:
187 base = {}
186 base = {}
188 findincoming(repo, remote, base, heads, force=force)
187 findincoming(repo, remote, base, remoteheads, force=force)
189
188
190 repo.ui.debug("common changesets up to "
189 repo.ui.debug("common changesets up to "
191 + " ".join(map(short, base.keys())) + "\n")
190 + " ".join(map(short, base.keys())) + "\n")
@@ -205,22 +204,12 b' def findoutgoing(repo, remote, base=None'
205 # find every node whose parents have been pruned
204 # find every node whose parents have been pruned
206 subset = []
205 subset = []
207 # find every remote head that will get new children
206 # find every remote head that will get new children
208 updated_heads = set()
209 for n in remain:
207 for n in remain:
210 p1, p2 = repo.changelog.parents(n)
208 p1, p2 = repo.changelog.parents(n)
211 if p1 not in remain and p2 not in remain:
209 if p1 not in remain and p2 not in remain:
212 subset.append(n)
210 subset.append(n)
213 if heads:
214 if p1 in heads:
215 updated_heads.add(p1)
216 if p2 in heads:
217 updated_heads.add(p2)
218
211
219 # this is the set of all roots we have to push
212 return subset
220 if heads:
221 return subset, list(updated_heads)
222 else:
223 return subset
224
213
225 def prepush(repo, remote, force, revs, newbranch):
214 def prepush(repo, remote, force, revs, newbranch):
226 '''Analyze the local and remote repositories and determine which
215 '''Analyze the local and remote repositories and determine which
@@ -241,7 +230,7 b' def prepush(repo, remote, force, revs, n'
241 inc = findincoming(repo, remote, common, remote_heads, force=force)
230 inc = findincoming(repo, remote, common, remote_heads, force=force)
242
231
243 cl = repo.changelog
232 cl = repo.changelog
244 update, updated_heads = findoutgoing(repo, remote, common, remote_heads)
233 update = findoutgoing(repo, remote, common, remote_heads)
245 outg, bases, heads = cl.nodesbetween(update, revs)
234 outg, bases, heads = cl.nodesbetween(update, revs)
246
235
247 if not bases:
236 if not bases:
General Comments 0
You need to be logged in to leave comments. Login now