I am not a lawyer, but this type of promise strikes me as a good example of a contract that is very likely to be ruled unconscionable, and hence legally unenforceable, if a court of law were ever to consider the matter.
In a more academic context (since academia sometimes obeys unwritten rules that don’t always coincide with the written law), your adviser’s requirement strikes me as unethical and highly problematic. Your adviser’s job is to approve your dissertation if, and only if, they judge that the work that you have done to date meets the requirements for a PhD. A PhD is not indentured servitude and your adviser cannot exert control over your life into the indefinite future, or indeed into any future that extends beyond the moment they sign that piece of paper. I see it as highly improper for your adviser to attempt to impose such a requirement. If I were a colleague of your adviser who heard about their behavior, I would lose a lot of the respect I hold for them, assuming I had such respect to begin with. And if I were a university official hearing a demand from your advisor to revoke your PhD over a breached promise of this type, I would laugh them out of the room. Of course, I cannot guarantee that other academics would have the same reaction.
I can’t advise you how to proceed, but some options that I can think of are:
Make the promise and be true to your word.
Make the promise without planning to satisfy the requirement. The rationale here is that a promise obtained under coercion is ethically void and you are not bound to satisfy it. (Again, that is the notion of unconscionability I was referring to earlier, but in an ethics rather than legal context.)
Do not make the promise. Explain to your adviser that the demand is inappropriate and hope that they will be convinced, or possibly negotiate to get the adviser to relax the unreasonable condition so as to allow for uncertainties about future events.
Complain to relevant authorities at your department and/or university.
Some people might think less of you for choosing option 2. Personally I think each of the choices I outlined above is reasonable and moral, although option 2 is certainly distasteful and I would try to avoid it if I could.