On a more general note, a few hard rules like this are important. They do wonders.
For example, I'm off liquor until the PhD's finished. Permanently: no delivered pizza, and nothing but regular coffee or espresso from coffee shops (specifically, no mochas, which I take like liquid crack).
I can ignore the rules for special occasions, which helps keep me in moderation even when I'm in these unusual circumstances.
Period.