Change branches_cmd from a function to a lambda.

This will allows branches_cmd to use the parent scope for stable_branch
and development_branch.