1301 for prec in repo.set('allprecursors(%d)', ctx): |
1300 for prec in repo.set('allprecursors(%d)', ctx): |
1302 yield prec |
1301 yield prec |
1303 |
1302 |
1304 # Look for an unstable which can be stabilized as a child of |
1303 # Look for an unstable which can be stabilized as a child of |
1305 # node. The unstable must be a child of one of node predecessors. |
1304 # node. The unstable must be a child of one of node predecessors. |
|
1305 directdesc = set([pctx.rev()]) |
1306 for ctx in selfanddescendants(repo, pctx): |
1306 for ctx in selfanddescendants(repo, pctx): |
1307 for child in ctx.children(): |
1307 for child in ctx.children(): |
1308 if child.unstable(): |
1308 if ctx.rev() in directdesc and not child.obsolete(): |
|
1309 directdesc.add(child.rev()) |
|
1310 elif child.unstable(): |
1309 return child |
1311 return child |
1310 return None |
1312 return None |
1311 |
1313 |
1312 def _solveunstable(ui, repo, orig, dryrun=False, confirm=False, |
1314 def _solveunstable(ui, repo, orig, dryrun=False, confirm=False, |
1313 progresscb=None): |
1315 progresscb=None): |
1314 """Stabilize a unstable changeset""" |
1316 """Stabilize a unstable changeset""" |
1315 obs = orig.parents()[0] |
1317 obs = orig.parents()[0] |
1316 if not obs.obsolete(): |
1318 if not obs.obsolete(): |
1317 print obs.rev(), orig.parents() |
1319 obs = orig.parents()[1] # second parent is obsolete ? |
1318 print orig.rev() |
|
1319 obs = orig.parents()[1] |
|
1320 assert obs.obsolete() |
1320 assert obs.obsolete() |
1321 newer = obsolete.successorssets(repo, obs.node()) |
1321 newer = obsolete.successorssets(repo, obs.node()) |
1322 # search of a parent which is not killed |
1322 # search of a parent which is not killed |
1323 while not newer or newer == [()]: |
1323 while not newer or newer == [()]: |
1324 ui.debug("stabilize target %s is plain dead," |
1324 ui.debug("stabilize target %s is plain dead," |