hg optimizations plus pycharm settings.