##// END OF EJS Templates
discovery: cleanup of variable names and comments
Mads Kiilerich -
r20381:fff0a71f default
parent child Browse files
Show More
@@ -154,7 +154,7 b' def _headssummary(repo, remote, outgoing'
154 154
155 155 - branch: the branch name
156 156 - remoteheads: the list of remote heads known locally
157 None is the branch is new
157 None if the branch is new
158 158 - newheads: the new remote heads (known locally) with outgoing pushed
159 159 - unsyncedheads: the list of remote heads unknown locally.
160 160 """
@@ -250,8 +250,7 b' def checkheads(repo, remote, outgoing, r'
250 250 hint=_("use 'hg push --new-branch' to create"
251 251 " new remote branches"))
252 252
253 # 2 compute newly pushed bookmarks. We
254 # we don't warned about bookmarked heads.
253 # 2. Compute newly pushed bookmarks. We don't warn about bookmarked heads.
255 254 localbookmarks = repo._bookmarks
256 255 remotebookmarks = remote.listkeys('bookmarks')
257 256 bookmarkedheads = set()
@@ -274,18 +273,19 b' def checkheads(repo, remote, outgoing, r'
274 273 allfuturecommon = set(c.node() for c in repo.set('%ld', outgoing.common))
275 274 allfuturecommon.update(allmissing)
276 275 for branch, heads in sorted(headssum.iteritems()):
277 candidate_newhs = set(heads[1])
276 remoteheads, newheads, unsyncedheads = heads
277 candidate_newhs = set(newheads)
278 278 # add unsynced data
279 if heads[0] is None:
279 if remoteheads is None:
280 280 oldhs = set()
281 281 else:
282 oldhs = set(heads[0])
283 oldhs.update(heads[2])
284 candidate_newhs.update(heads[2])
285 dhs = None
282 oldhs = set(remoteheads)
283 oldhs.update(unsyncedheads)
284 candidate_newhs.update(unsyncedheads)
285 dhs = None # delta heads, the new heads on branch
286 286 discardedheads = set()
287 287 if repo.obsstore:
288 # remove future heads which are actually obsolete by another
288 # remove future heads which are actually obsoleted by another
289 289 # pushed element:
290 290 #
291 291 # XXX as above, There are several cases this case does not handle
@@ -297,8 +297,8 b' def checkheads(repo, remote, outgoing, r'
297 297 # (2) if the new heads have ancestors which are not obsolete and
298 298 # not ancestors of any other heads we will have a new head too.
299 299 #
300 # This two case will be easy to handle for know changeset but much
301 # more tricky for unsynced changes.
300 # These two cases will be easy to handle for known changeset but
301 # much more tricky for unsynced changes.
302 302 newhs = set()
303 303 for nh in candidate_newhs:
304 304 if nh in repo and repo[nh].phase() <= phases.public:
@@ -312,10 +312,10 b' def checkheads(repo, remote, outgoing, r'
312 312 newhs.add(nh)
313 313 else:
314 314 newhs = candidate_newhs
315 if [h for h in heads[2] if h not in discardedheads]:
315 if [h for h in unsyncedheads if h not in discardedheads]:
316 316 unsynced = True
317 if heads[0] is None:
318 if 1 < len(newhs):
317 if remoteheads is None:
318 if len(newhs) > 1:
319 319 dhs = list(newhs)
320 320 if error is None:
321 321 error = (_("push creates new branch '%s' "
@@ -324,7 +324,7 b' def checkheads(repo, remote, outgoing, r'
324 324 " see \"hg help push\" for details about"
325 325 " pushing new heads")
326 326 elif len(newhs) > len(oldhs):
327 # strip updates to existing remote heads from the new heads list
327 # remove bookmarked or existing remote heads from the new heads list
328 328 dhs = sorted(newhs - bookmarkedheads - oldhs)
329 329 if dhs:
330 330 if error is None:
@@ -334,7 +334,7 b' def checkheads(repo, remote, outgoing, r'
334 334 else:
335 335 error = _("push creates new remote head %s!"
336 336 ) % short(dhs[0])
337 if heads[2]: # unsynced
337 if unsyncedheads:
338 338 hint = _("pull and merge or"
339 339 " see \"hg help push\" for details about"
340 340 " pushing new heads")
General Comments 0
You need to be logged in to leave comments. Login now