add tests and fix issues with canonical_rev()

Summary:

- Adds a test for canonical_rev() to BasicTest
- Fixes an issue with a newline being returned in the rev name for GitRepo.canonical_rev()
- Fixes a reference to 'unicode' in SvnRepo.canonical_rev()

Note:

I didn't really plan on fixing that last thing in this branch, but it arose once I added the test case for canonical_rev() under Python 3. I didn't want to upset CI, but at the same time I'm not sure what the current policy on str/unicode testing is. In any case, this should work on Python 3 without altering the behavior of SvnRepo.canonical_rev().