replace prod origin with -dev origin for -dev, replace stage origin with stage's (bug 960534)