The patch adds a new collection property "undo_history" to bpy.context.
It can be used to get current undo history index:
bpy.context.undo_history.index
Or to get all pushed undo states:
bpy.context.undo_history.keys()
Please read @dima glib (dairin0d)'s email to understand why we need this feature.
