Parameter partIndex in method HistoryPart.getScope was unused and the
scope of the first part was always returned. Now, partIndex is used to
derived the scope.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>