[PATCH 0 of 1] [PATCH] Option to enforce using UTC for commit dates

arne_bab at web.de arne_bab at web.de
Mon Dec 17 19:24:52 CST 2012


To make the infocalypse extension safe for anonymous use, the user
needs an easy and reliable way to set the time zone to UTC to avoid
leaking location information.

This patch adds a config option to always use UTC, except if
explicitely requested otherwise (via a date string which includes the
timezone).

I hope the config option can be included, because it is a precondition
for making anonymous collaboration with Mercurial over freenet safe by
default.

I added the function timezoneprivacy to util along with doctests and
extended the test for an empty date string when committing to also
check if the config option causes a datestring without
timezone-information to be interpreted as UTC instead of local time.

Changes:

 mercurial/cmdutil.py      |   4 ++-
 mercurial/commands.py     |   5 +++-
 mercurial/help/config.txt |   4 +++
 mercurial/util.py         |  51 ++++++++++++++++++++++++++++++++++++----------
 tests/test-commit.t       |  10 ++++++++-

Best wishes,
Arne


More information about the Mercurial-devel mailing list