mercurial/phases.py
changeset 39262 5b9f116104f9
parent 39147 b95b48a55c36
parent 39200 bd63ada7e1f8
child 39271 fd7376fa60e7
equal deleted inserted replaced
39261:c9a3f7f5c023 39262:5b9f116104f9
   671     repo = repo.unfiltered()
   671     repo = repo.unfiltered()
   672     cl = repo.changelog
   672     cl = repo.changelog
   673     rev = cl.nodemap.get
   673     rev = cl.nodemap.get
   674     if not roots:
   674     if not roots:
   675         return heads
   675         return heads
   676     if not heads or heads == [nullrev]:
   676     if not heads or heads == [nullid]:
   677         return []
   677         return []
   678     # The logic operated on revisions, convert arguments early for convenience
   678     # The logic operated on revisions, convert arguments early for convenience
   679     new_heads = set(rev(n) for n in heads if n != nullid)
   679     new_heads = set(rev(n) for n in heads if n != nullid)
   680     roots = [rev(n) for n in roots]
   680     roots = [rev(n) for n in roots]
   681     if not heads or not roots:
       
   682         return heads
       
   683     # compute the area we need to remove
   681     # compute the area we need to remove
   684     affected_zone = repo.revs("(%ld::%ld)", roots, new_heads)
   682     affected_zone = repo.revs("(%ld::%ld)", roots, new_heads)
   685     # heads in the area are no longer heads
   683     # heads in the area are no longer heads
   686     new_heads.difference_update(affected_zone)
   684     new_heads.difference_update(affected_zone)
   687     # revisions in the area have children outside of it,
   685     # revisions in the area have children outside of it,