hgext3rd/topic/stack.py
branchstable
changeset 3278 e4c0332ecee4
parent 3228 8cc8fb94cc00
child 3371 753e5ebabe7d
equal deleted inserted replaced
3277:0a6954bd6502 3278:e4c0332ecee4
    10     node,
    10     node,
    11     phases,
    11     phases,
    12     obsolete,
    12     obsolete,
    13     util,
    13     util,
    14 )
    14 )
    15 from .evolvebits import builddependencies, _singlesuccessor
    15 from .evolvebits import (
       
    16     _singlesuccessor,
       
    17     MultipleSuccessorsError,
       
    18     builddependencies,
       
    19 )
    16 
    20 
    17 short = node.short
    21 short = node.short
    18 
    22 
    19 # TODO: compat
    23 # TODO: compat
    20 
    24 
   283             prev = ctx.rev()
   287             prev = ctx.rev()
   284             continue
   288             continue
   285         p1 = ctx.p1()
   289         p1 = ctx.p1()
   286         p2 = ctx.p2()
   290         p2 = ctx.p2()
   287         if p1.obsolete():
   291         if p1.obsolete():
   288             p1 = repo[_singlesuccessor(repo, p1)]
   292             try:
       
   293                 p1 = repo[_singlesuccessor(repo, p1)]
       
   294             except MultipleSuccessorsError as e:
       
   295                 successors = e.successorssets
       
   296                 if len(successors) > 1:
       
   297                     # case of divergence which we don't handle yet
       
   298                     raise
       
   299                 p1 = repo[successors[0][-1]]
       
   300 
   289         if p2.node() != node.nullid:
   301         if p2.node() != node.nullid:
   290             entries.append((idxmap.get(p1.rev()), False, p1))
   302             entries.append((idxmap.get(p1.rev()), False, p1))
   291             entries.append((idxmap.get(p2.rev()), False, p2))
   303             entries.append((idxmap.get(p2.rev()), False, p2))
   292         elif p1.rev() != prev and p1.node() != node.nullid:
   304         elif p1.rev() != prev and p1.node() != node.nullid:
   293             entries.append((idxmap.get(p1.rev()), False, p1))
   305             entries.append((idxmap.get(p1.rev()), False, p1))