I used a couple mantra's/thought patterns on my most recent tour. I found I was happiest when I didn't have to motivate myself to get to point B so a mantra was born out of that "Prepare for everything. Expect nothing." Which means be willing to stop on the side of the road and pitch a tent if you have to, have a plan B, have sufficient food, water, a dry change of clothes and basic means so that you can get by no matter what mother nature, the roads, your bike or other variables throw at you. When I expect to get to a certain place by the end of the day I get stuck in a future oriented mindset, stop enjoying the present and become frustrated when obstacles present themselves from me getting to my goal.
When doing hills I used a couple different things
1) If I committed to a kilometer I would finish that kilometer (checking bike computer occasionally to see when ive reached). No breaks until then
2) Counting inhales/exhales. Similar to kilometer. Find how many measured breathes make up an average kilometer at the grade you are working at then when reach 225 or whatever, check computer and voila!