Extract the revision-setting code also