equal
deleted
inserted
replaced
79 ui.debug("stabilize target %s is plain dead," |
79 ui.debug("stabilize target %s is plain dead," |
80 " trying to stabilize on its parent\n" % |
80 " trying to stabilize on its parent\n" % |
81 obs) |
81 obs) |
82 obs = obs.parents()[0] |
82 obs = obs.parents()[0] |
83 newer = compat.successorssets(repo, obs.node()) |
83 newer = compat.successorssets(repo, obs.node()) |
84 if len(newer) > 1 or len(newer[0]) > 1: |
84 if 1 < len(newer): |
|
85 # divergence case |
|
86 # we should pick as arbitrary one |
85 raise MultipleSuccessorsError(newer) |
87 raise MultipleSuccessorsError(newer) |
|
88 elif 1 < len(newer[0]): |
|
89 splitheads = list(repo.revs('heads(%ln::%ln)', newer[0], newer[0])) |
|
90 if 1 < len(splitheads): |
|
91 # split case, See if we can make sense of it. |
|
92 raise MultipleSuccessorsError(newer) |
|
93 return splitheads[0] |
86 |
94 |
87 return repo[newer[0][0]].rev() |
95 return repo[newer[0][0]].rev() |
88 |
96 |
89 class MultipleSuccessorsError(RuntimeError): |
97 class MultipleSuccessorsError(RuntimeError): |
90 """Exception raised by _singlesuccessor when multiple successor sets exists |
98 """Exception raised by _singlesuccessor when multiple successor sets exists |