Explicitly use a UTC timezone for Bazaar.

Review Request #9836 — Created March 27, 2018 and submitted

Information

Review Board
release-3.0.x
d03c4a4...

Reviewers

When working with Bazaar, we normalize all date-based revisions to UTC.
This works so long as settings.TIME_ZONE is UTC, but if it's
anything else, revision lookup will fail. This is because the TZ
environment variable gets set to the value in settings.TIME_ZONE by
Django, and this gets inherited by Bazaar, causing all variable lookups
to be offset further by the timezone.

By forcing TZ=UTC, we can ensure that Bazaar will be able to match up
any revisions we throw its way.

Unit tests were updated to check for this case.

Tested that the unit tests failed without the fix both for the new tests
and for existing ones with settings.TIME_ZONE = 'US/Pacific'.

Verified all tests are fixed with this change, with both UTC and
US/Pacific set in settings_local.py.

Description From Last Updated

While we're here should we be converting these to be str() instead of bytes?

daviddavid
david
  1. 
      
  2. reviewboard/scmtools/bzr/__init__.py (Diff revision 1)
     
     
     
     
    Show all issues

    While we're here should we be converting these to be str() instead of bytes?

    1. I thought about it but decided to punt on it. There's a whole lot to do for environment variables everywhere, and even with str(), _bzr_plugin_path needs to be handled right.

      What I've been planning is to move all these to just use Unicode strings and then have popen convert as needed, so callers don't have to care. Think I'll just do that all at once later.

  3. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (f9d9e88)
Loading...