mercurial/ancestor.py
changeset 12401 4cdaf1adafc8
parent 12387 4f8067c94729
child 13554 22565ddb28e7
equal deleted inserted replaced
12400:40852b4b910c 12401:4cdaf1adafc8
    32         if not pl:
    32         if not pl:
    33             depth[vertex] = 0
    33             depth[vertex] = 0
    34             visit.pop()
    34             visit.pop()
    35         else:
    35         else:
    36             for p in pl:
    36             for p in pl:
    37                 if p in (a, b): # did we find a or b as a parent?
    37                 if p == a or p == b: # did we find a or b as a parent?
    38                     return p # we're done
    38                     return p # we're done
    39                 if p not in depth:
    39                 if p not in depth:
    40                     visit.append(p)
    40                     visit.append(p)
    41             if visit[-1] == vertex:
    41             if visit[-1] == vertex:
    42                 depth[vertex] = min([depth[p] for p in pl]) - 1
    42                 depth[vertex] = min([depth[p] for p in pl]) - 1