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

login
register
mail settings
Submitter Bryan O'Sullivan
Date May 28, 2013, 11:28 p.m.
Message ID <bda65f9dee92fa105cc7.1369783735@australite.thefacebook.com>
Download mbox | patch
Permalink /patch/1671/
State Accepted
Commit 78501209488a337ecbb17a04fa2f6fe2da1ac31d
Headers show

Comments

Bryan O'Sullivan - May 28, 2013, 11:28 p.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano@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

Patch

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.