# HG changeset patch # User Pierre-Yves David # Date 1359128569 -3600 # Node ID 2a2b8c95bb435a27e1281ad5fd374541e3217c30 # Parent 789acc1d039baf3e268395f8a98b404b359ac246 evolve: remove revset calls in warnobserror revset have serious performance impact in several case. The resulting code is a bit too complicated to my taste. I hope for much simpler implementation in core anyway. diff -r 789acc1d039b -r 2a2b8c95bb43 hgext/evolve.py --- a/hgext/evolve.py Sat Jan 05 18:10:07 2013 +0100 +++ b/hgext/evolve.py Fri Jan 25 16:42:49 2013 +0100 @@ -596,15 +596,19 @@ @eh.wrapcommand("unbundle") def warnobserrors(orig, ui, repo, *args, **kwargs): """display warning is the command resulted in more instable changeset""" - priorunstables = len(repo.revs('unstable()')) - priorbumpeds = len(repo.revs('bumped()')) - priordivergents = len(repo.revs('divergent()')) + # part of the troubled stuff may be filtered (stash ?) + # This needs a better implementation but will probably wait for core. + filtered = repo.changelog.filteredrevs + priorunstables = len(set(getrevs(repo, 'unstable')) - filtered) + priorbumpeds = len(set(getrevs(repo, 'bumped')) - filtered) + priordivergents = len(set(getrevs(repo, 'divergent')) - filtered) ret = orig(ui, repo, *args, **kwargs) # workaround phase stupidity #phases._filterunknown(ui, repo.changelog, repo._phasecache.phaseroots) - newunstables = len(repo.revs('unstable()')) - priorunstables - newbumpeds = len(repo.revs('bumped()')) - priorbumpeds - newdivergents = len(repo.revs('divergent()')) - priordivergents + filtered = repo.changelog.filteredrevs + newunstables = len(set(getrevs(repo, 'unstable')) - filtered) - priorunstables + newbumpeds = len(set(getrevs(repo, 'bumped')) - filtered) - priorbumpeds + newdivergents = len(set(getrevs(repo, 'divergent')) - filtered) - priordivergents if newunstables > 0: ui.warn(_('%i new unstable changesets\n') % newunstables) if newbumpeds > 0: