##// END OF EJS Templates
checkheads: take future obsoleted heads into account...
Pierre-Yves David -
r17214:738ad56d default
parent child Browse files
Show More
@@ -7,7 +7,7 b''
7 7
8 8 from node import nullid, short
9 9 from i18n import _
10 import util, setdiscovery, treediscovery, phases
10 import util, setdiscovery, treediscovery, phases, obsolete
11 11
12 12 def findcommonincoming(repo, remote, heads=None, force=False):
13 13 """Return a tuple (common, anyincoming, heads) used to identify the common
@@ -266,6 +266,7 b' def checkheads(repo, remote, outgoing, r'
266 266 # error message, depending on unsynced status, is displayed.
267 267 error = None
268 268 unsynced = False
269 allmissing = set(outgoing.missing)
269 270 for branch, heads in headssum.iteritems():
270 271 if heads[0] is None:
271 272 # Maybe we should abort if we push more that one head
@@ -274,8 +275,34 b' def checkheads(repo, remote, outgoing, r'
274 275 if heads[2]:
275 276 unsynced = True
276 277 oldhs = set(heads[0])
277 newhs = set(heads[1])
278 candidate_newhs = set(heads[1])
279 # add unsynced data
280 oldhs.update(heads[2])
281 candidate_newhs.update(heads[2])
278 282 dhs = None
283 if repo.obsstore:
284 # remove future heads which are actually obsolete by another
285 # pushed element:
286 #
287 # XXX There is several case this case does not handle properly
288 #
289 # (1) if <nh> is public, it won't be affected by obsolete marker
290 # and a new is created
291 #
292 # (2) if the new heads have ancestors which are not obsolete and
293 # not ancestors of any other heads we will have a new head too.
294 #
295 # This two case will be easy to handle for know changeset but much
296 # more tricky for unsynced changes.
297 newhs = set()
298 for nh in candidate_newhs:
299 for suc in obsolete.anysuccessors(repo.obsstore, nh):
300 if suc != nh and suc in allmissing:
301 break
302 else:
303 newhs.add(nh)
304 else:
305 newhs = candidate_newhs
279 306 if len(newhs) > len(oldhs):
280 307 # strip updates to existing remote heads from the new heads list
281 308 dhs = list(newhs - bookmarkedheads - oldhs)
@@ -357,3 +357,50 b' no warning displayed'
357 357 searching for changes
358 358 no changes found
359 359 [1]
360
361 Do not warn about new head when the new head is a successors of a remote one
362
363 $ hg glog
364 @ changeset: 5:6e572121998e
365 | tag: tip
366 | user: test
367 | date: Thu Jan 01 00:00:00 1970 +0000
368 | summary: add original_e
369 |
370 x changeset: 4:7c694bff0650
371 | user: test
372 | date: Thu Jan 01 00:00:00 1970 +0000
373 | summary: add original_d
374 |
375 o changeset: 3:5601fb93a350
376 | parent: 1:7c3bad9141dc
377 | user: test
378 | date: Thu Jan 01 00:00:00 1970 +0000
379 | summary: add new_3_c
380 |
381 | o changeset: 2:245bde4270cd
382 |/ user: test
383 | date: Thu Jan 01 00:00:00 1970 +0000
384 | summary: add original_c
385 |
386 o changeset: 1:7c3bad9141dc
387 | user: test
388 | date: Thu Jan 01 00:00:00 1970 +0000
389 | summary: add b
390 |
391 o changeset: 0:1f0dee641bb7
392 user: test
393 date: Thu Jan 01 00:00:00 1970 +0000
394 summary: add a
395
396 $ hg up -q 'desc(new_3_c)'
397 $ mkcommit obsolete_e
398 created new head
399 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
400 $ hg push ../tmpf
401 pushing to ../tmpf
402 searching for changes
403 adding changesets
404 adding manifests
405 adding file changes
406 added 1 changesets with 1 changes to 1 files (+1 heads)
General Comments 0
You need to be logged in to leave comments. Login now