Rewrite timezone handling to support tzinfo zones, not fixed offsets#2
Open
teliseo wants to merge 5 commits intorobohack:masterfrom
Open
Rewrite timezone handling to support tzinfo zones, not fixed offsets#2teliseo wants to merge 5 commits intorobohack:masterfrom
teliseo wants to merge 5 commits intorobohack:masterfrom
Conversation
- In addition to fixed offsets, tzinfo timezone names may now be used in the --tz and --move-zone options, and in the AuthorMap file. - --tz now doesn't just affect the log display, it changes the interpretation of the local timestamps in SCCS deltas. Without --tz, deltas are treated as in the system default timezone, or as specified by the TZ environment variable. In all cases, there is proper handling of daylight/summer time, which was previously lacking. - --move-zone has changed from --move-offset. It is now a new timezone name or offset, not an hour offset from the previous zone. - The AuthorMap parser is now much more robust, and can accept all forms of time zone specs. - A timezone specified in the AuthorMap now takes precedence over --move-zone. - Previously, specifying an AuthorMap file prevented fallback to system login name lookup, which it now does.
Owner
|
This looks very interesting too. I'll try it with my test case repository soon! |
Author
|
I intend for you to merge my other PR (#1) first, which will cause a couple of merge conflicts with this one (around the option parsing). I’m not sure if I have the appropriate perms to fix them, or if you have to do this. I could always merge your updated master into this branch locally and then push, but I don't know if that's the cleanest github strategy. After this, I think I’m done with major hacking on this project for a while, as it now meets my needs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--tzand--move-zoneoptions, and in the AuthorMap file.--tznow doesn’t just affect the log display, it changes the interpretation of the local timestamps in SCCS deltas. Without--tz, deltas are treated as in the system default timezone, or as specified by the TZ environment variable. In all cases, there is proper handling of daylight/summer time, which was previously lacking.--move-zonehas changed from--move-offset. It is now a new timezone name or offset, not an hour offset from the previous zone.--move-zone.This improved timezone handling doesn’t require any third-party modules, but ZoneInfo does require a fairly recent version of Python, 3.9, released in 2020. Everything should be golden on modern Posix-compatible systems, but Windows and some containers may lack a proper tzinfo backend, requiring additional modules.
For Windows specifically, depending on the local zone fallback will not properly handle daylight/summer time, but this can be mitigated by always specifying a tzinfo zone name with the
--tzoption. This could be improved by using the third-party tzlocal module, but I didn’t do this to avoid a third-party dependency.