Mercurial > evolve
comparison hgext/evolve.py @ 1099:bac4e0bc9f6a stable
evolve: write a status message when the working directory changes
Evolve changes the working directory during atop, etc which can confuse people
as they are not aware that this happend. The ideal solution is to not have
evolve change it, however mercurial limitations don't allow us to do that at the
moment. So instead we are printing a status message that the working directory
changed.
author | David Soria Parra <davidsp@fb.com> |
---|---|
date | Fri, 29 Aug 2014 14:26:17 +0200 |
parents | 5d063fed9e3d |
children | 8cac667a0d7d |
comparison
equal
deleted
inserted
replaced
1098:1527ec81337e | 1099:bac4e0bc9f6a |
---|---|
1237 allopt = opts['all'] | 1237 allopt = opts['all'] |
1238 dryrunopt = opts['dry_run'] | 1238 dryrunopt = opts['dry_run'] |
1239 confirmopt = opts['confirm'] | 1239 confirmopt = opts['confirm'] |
1240 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'evolve') | 1240 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 'evolve') |
1241 | 1241 |
1242 startnode = repo['.'] | |
1243 | |
1242 if contopt: | 1244 if contopt: |
1243 if anyopt: | 1245 if anyopt: |
1244 raise util.Abort('cannot specify both "--any" and "--continue"') | 1246 raise util.Abort('cannot specify both "--any" and "--continue"') |
1245 if allopt: | 1247 if allopt: |
1246 raise util.Abort('cannot specify both "--all" and "--continue"') | 1248 raise util.Abort('cannot specify both "--all" and "--continue"') |
1280 | 1282 |
1281 if dryrunopt: | 1283 if dryrunopt: |
1282 print 'hg update %s' % ctx.rev() | 1284 print 'hg update %s' % ctx.rev() |
1283 return 0 | 1285 return 0 |
1284 else: | 1286 else: |
1285 return hg.update(repo, ctx.rev()) | 1287 res = hg.update(repo, ctx.rev()) |
1288 if ctx != startnode: | |
1289 ui.status(_('working directory is now at %s\n') % ctx) | |
1290 return res | |
1286 | 1291 |
1287 troubled = repo.revs('troubled()') | 1292 troubled = repo.revs('troubled()') |
1288 if troubled: | 1293 if troubled: |
1289 ui.write_err(_('nothing to evolve here\n')) | 1294 ui.write_err(_('nothing to evolve here\n')) |
1290 ui.status(_('(%i troubled changesets, do you want --any ?)\n') | 1295 ui.status(_('(%i troubled changesets, do you want --any ?)\n') |
1313 finally: | 1318 finally: |
1314 lockmod.release(tr, lock, wlock) | 1319 lockmod.release(tr, lock, wlock) |
1315 progresscb() | 1320 progresscb() |
1316 seen += 1 | 1321 seen += 1 |
1317 if not allopt: | 1322 if not allopt: |
1323 if repo['.'] != startnode: | |
1324 ui.status(_('working directory is now at %s\n') % repo['.']) | |
1318 return result | 1325 return result |
1319 progresscb() | 1326 progresscb() |
1320 tro = _picknexttroubled(ui, repo, anyopt or allopt) | 1327 tro = _picknexttroubled(ui, repo, anyopt or allopt) |
1321 | 1328 |
1322 if allopt: | 1329 if allopt: |
1323 ui.progress('evolve', None) | 1330 ui.progress('evolve', None) |
1331 | |
1332 if repo['.'] != startnode: | |
1333 ui.status(_('working directory is now at %s\n') % repo['.']) | |
1324 | 1334 |
1325 | 1335 |
1326 def _evolveany(ui, repo, tro, dryrunopt, confirmopt, progresscb): | 1336 def _evolveany(ui, repo, tro, dryrunopt, confirmopt, progresscb): |
1327 repo = repo.unfiltered() | 1337 repo = repo.unfiltered() |
1328 tro = repo[tro.rev()] | 1338 tro = repo[tro.rev()] |