diff mercurial/obsolete.py @ 17429:72fa4ef2245f

declare local constants instead of using magic values and comments
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 27 Aug 2012 23:16:22 +0200
parents 9724f8f8850b
children fb72eec7efd8
line wrap: on
line diff
--- a/mercurial/obsolete.py	Mon Aug 27 23:14:27 2012 +0200
+++ b/mercurial/obsolete.py	Mon Aug 27 23:16:22 2012 +0200
@@ -58,6 +58,8 @@
 _pack = struct.pack
 _unpack = struct.unpack
 
+_SEEK_END = 2 # os.SEEK_END was introduced in Python 2.5
+
 # the obsolete feature is not mature enough to be enabled by default.
 # you have to rely on third party extension extension to enable this.
 _enabled = False
@@ -207,7 +209,7 @@
                 # defined. So we must seek to the end before calling tell(),
                 # or we may get a zero offset for non-zero sized files on
                 # some platforms (issue3543).
-                f.seek(0, 2) # os.SEEK_END
+                f.seek(0, _SEEK_END)
                 offset = f.tell()
                 transaction.add('obsstore', offset)
                 # offset == 0: new file - add the version header