# HG changeset patch # User Bryan O'Sullivan # Date 1370305244 25200 # Node ID 78501209488a337ecbb17a04fa2f6fe2da1ac31d # Parent feaf5749d7a42ccccd479eeda81016035e61621f util: rename ct variable in makedate to timestamp diff -r feaf5749d7a4 -r 78501209488a mercurial/util.py --- a/mercurial/util.py Mon Jun 03 17:20:37 2013 -0700 +++ b/mercurial/util.py Mon Jun 03 17:20:44 2013 -0700 @@ -998,14 +998,16 @@ yield s def makedate(): - ct = time.time() - if ct < 0: + '''Return the current time as a (unixtime, offset) tuple based off + the local timezone.''' + timestamp = time.time() + if timestamp < 0: hint = _("check your clock") - raise Abort(_("negative timestamp: %d") % ct, hint=hint) - delta = (datetime.datetime.utcfromtimestamp(ct) - - datetime.datetime.fromtimestamp(ct)) + raise Abort(_("negative timestamp: %d") % timestamp, hint=hint) + delta = (datetime.datetime.utcfromtimestamp(timestamp) - + datetime.datetime.fromtimestamp(timestamp)) tz = delta.days * 86400 + delta.seconds - return ct, tz + return timestamp, tz def datestr(date=None, format='%a %b %d %H:%M:%S %Y %1%2'): """represent a (unixtime, offset) tuple as a localized time.