@duhashostka,
It's not really a matter of correct, Duhashostka. The issue is whether the context warrants using a certain structure
Why not simply use the simple past?
"This woman kept to a diet from May till July last year" .
Usually there is some reason that we choose the PPC or the PC.
"This woman had been keeping to a diet from May till July last year when she unexplicably fell into a coma.
"This woman was keeping to a [specific] diet from May till July last year until she developed serious health problems"