1250 if allopt: |
1250 if allopt: |
1251 raise util.Abort('cannot specify both "--all" and "--continue"') |
1251 raise util.Abort('cannot specify both "--all" and "--continue"') |
1252 graftcmd = commands.table['graft'][0] |
1252 graftcmd = commands.table['graft'][0] |
1253 return graftcmd(ui, repo, old_obsolete=True, **{'continue': True}) |
1253 return graftcmd(ui, repo, old_obsolete=True, **{'continue': True}) |
1254 |
1254 |
1255 tro = _picknexttroubled(ui, repo, anyopt or allopt) |
|
1256 if tro is None: |
|
1257 return handlenotrouble(ui, repo, startnode, dryrunopt) |
|
1258 |
|
1259 def progresscb(): |
1255 def progresscb(): |
1260 if allopt: |
1256 if allopt: |
1261 ui.progress('evolve', seen, unit='changesets', total=count) |
1257 ui.progress('evolve', seen, unit='changesets', total=count) |
1262 |
1258 |
1263 seen = 1 |
1259 seen = 1 |
1264 count = allopt and _counttroubled(ui, repo) or 1 |
1260 count = allopt and _counttroubled(ui, repo) or 1 |
1265 |
1261 |
1266 while tro is not None: |
1262 nexttrouble = _picknexttroubled(ui, repo, anyopt or allopt) |
|
1263 |
|
1264 # No trouble to resolve |
|
1265 if not nexttrouble: |
|
1266 return handlenotrouble(ui, repo, startnode, dryrunopt) |
|
1267 |
|
1268 while nexttrouble is not None: |
1267 progresscb() |
1269 progresscb() |
1268 wlock = lock = tr = None |
1270 wlock = lock = tr = None |
1269 try: |
1271 try: |
1270 wlock = repo.wlock() |
1272 wlock = repo.wlock() |
1271 lock = repo.lock() |
1273 lock = repo.lock() |
1272 tr = repo.transaction("evolve") |
1274 tr = repo.transaction("evolve") |
1273 result = _evolveany(ui, repo, tro, dryrunopt, confirmopt, |
1275 result = _evolveany(ui, repo, nexttrouble, dryrunopt, confirmopt, |
1274 progresscb=progresscb) |
1276 progresscb=progresscb) |
1275 tr.close() |
1277 tr.close() |
1276 finally: |
1278 finally: |
1277 lockmod.release(tr, lock, wlock) |
1279 lockmod.release(tr, lock, wlock) |
1278 progresscb() |
1280 progresscb() |
1280 if not allopt: |
1282 if not allopt: |
1281 if repo['.'] != startnode: |
1283 if repo['.'] != startnode: |
1282 ui.status(_('working directory is now at %s\n') % repo['.']) |
1284 ui.status(_('working directory is now at %s\n') % repo['.']) |
1283 return result |
1285 return result |
1284 progresscb() |
1286 progresscb() |
1285 tro = _picknexttroubled(ui, repo, anyopt or allopt) |
1287 nexttrouble = _picknexttroubled(ui, repo, anyopt or allopt) |
1286 |
1288 |
1287 if allopt: |
1289 if allopt: |
1288 ui.progress('evolve', None) |
1290 ui.progress('evolve', None) |
1289 |
1291 |
1290 if repo['.'] != startnode: |
1292 if repo['.'] != startnode: |