To my knowledge in mercurial a single commit can only have one branch, but in general you could do something like this: