##// END OF EJS Templates
Fix how setup.py identifies the Mercurial version....
Jeremy Whitlock -
r8493:4c030ada default
parent child Browse files
Show More
@@ -97,10 +97,7 try:
97 97 except ImportError:
98 98 pass
99 99
100 def getversion():
101 if not os.path.exists('.hg'):
102 return None # not in a repository
103
100 if os.path.exists('.hg'):
104 101 # execute hg out of this directory with a custom environment which
105 102 # includes the pure Python modules in mercurial/pure
106 103 pypath = os.environ.get('PYTHONPATH', '')
@@ -108,6 +105,7 def getversion():
108 105 os.environ['PYTHONPATH'] = os.pathsep.join(['mercurial', purepath, pypath])
109 106 os.environ['HGRCPATH'] = '' # do not read any config file
110 107 cmd = '%s hg id -it' % sys.executable
108 version = None
111 109
112 110 try:
113 111 l = os.popen(cmd).read().split()
@@ -122,16 +120,18 def getversion():
122 120 version = l[-1] # latest tag or revision number
123 121 if version.endswith('+'):
124 122 version += time.strftime('%Y%m%d')
125 return version
126 123
127 version = getversion()
128 124 if version:
129 125 f = file("mercurial/__version__.py", "w")
130 126 f.write('# this file is autogenerated by setup.py\n')
131 127 f.write('version = "%s"\n' % version)
132 128 f.close()
133 else:
134 version = "unknown"
129
130 try:
131 from mercurial import __version__
132 version = __version__.version
133 except ImportError:
134 version = 'unknown'
135 135
136 136 class install_package_data(install_data):
137 137 def finalize_options(self):
General Comments 0
You need to be logged in to leave comments. Login now