[PATCH 2 of 4] util: rename ct variable in makedate to timestamp

Bryan O'Sullivan bos at serpentine.com
Tue May 28 18:28:55 CDT 2013


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1369782672 25200
#      Tue May 28 16:11:12 2013 -0700
# Node ID bda65f9dee92fa105cc79061e01c172044ac6a2f
# Parent  0f4397fbda5b3cd7e4de5c4ea070c80224ad3893
util: rename ct variable in makedate to timestamp

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -998,14 +998,16 @@ def filechunkiter(f, size=65536, limit=N
         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.


More information about the Mercurial-devel mailing list