util: rename ct variable in makedate to timestamp
authorBryan O'Sullivan <bryano@fb.com>
Mon, 03 Jun 2013 17:20:44 -0700
changeset 19286 78501209488a
parent 19285 feaf5749d7a4
child 19287 8b04e1344111
util: rename ct variable in makedate to timestamp
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.