mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
use git to get revision for __version__
This commit is contained in:
parent
77b76439cc
commit
f5a31a759b
@ -30,12 +30,12 @@ if '+' in __version__ or 'pre' in __version__:
|
|||||||
# automatically propagated to an installed copy as well)
|
# automatically propagated to an installed copy as well)
|
||||||
try:
|
try:
|
||||||
import subprocess
|
import subprocess
|
||||||
p = subprocess.Popen(['hg', 'id', '-i', '-R',
|
p = subprocess.Popen(['git', 'show', '-s', '--pretty=format:%h',
|
||||||
path.join(package_dir, '..')],
|
path.join(package_dir, '..')],
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
if out:
|
if out:
|
||||||
__version__ += '/' + out.strip()
|
__version__ += '/' + out.decode().strip()
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user