BE changes for tryrebase.py (#101503)
- Use context manager rather than explicit ```try: finally:```
- Add `ref/remotes` prefix to `onto_branch` in `main` rather than in
`rebase_onto` functions
- Define `MAIN_BRANCH` and `VIABLE_STRICT_BRANCH` constants in tests.
- Replace `self.assertTrue(x in y)` with `self.assertIn(x, y)`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/101503
Approved by: https://github.com/ZainRizvi, https://github.com/huydhn