Update "make repo" to use git.
authorRobert Bradshaw <robertwb@math.washington.edu>
Tue, 18 Jan 2011 08:48:10 +0000 (00:48 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Tue, 18 Jan 2011 08:48:10 +0000 (00:48 -0800)
MANIFEST.in
Makefile
setup.py

index e79bfd6ca70d789c00cd815ff9b44a25cf68374c..e51230200287097d1a853167a21e8994dfee943c 100644 (file)
@@ -1,6 +1,6 @@
 include MANIFEST.in README.txt INSTALL.txt ToDo.txt USAGE.txt
 include COPYING.txt LICENSE.txt Makefile
-include .hgrev
+include .gitrev
 include setup.py
 include setupegg.py
 include bin/*
index c0b74e7ba8da5bc048e25deb97e13d3b83ff129e..964204fd47d47a54965e7b7c37d1cc9b463565f4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,21 @@
 PYTHON?=python
-REPO = http://hg.cython.org/cython-devel
+REPO = git://github.com/cython/cython.git
 
 all:    local 
 
 local:
        ${PYTHON} setup.py build_ext --inplace
 
-.hg: REV := $(shell cat .hgrev)
-.hg: TMPDIR := $(shell mktemp -d tmprepo.XXXXXX)
-.hg: 
-       hg clone --rev $(REV) $(REPO) $(TMPDIR)
-       hg -R $(TMPDIR) update
-       mv $(TMPDIR)/.hg .
-       mv $(TMPDIR)/.hgignore .
-       mv $(TMPDIR)/.hgtags .
+.git: REV := $(shell cat .gitrev)
+.git: TMPDIR := $(shell mktemp -d tmprepo.XXXXXX)
+.git: 
+       git clone $(REPO) $(TMPDIR)
+       cd $(TMPDIR); git checkout -b working $(REV)
+       mv $(TMPDIR)/{.git,.hgtags,.hgignore} .
+       mv $(TMPDIR)/Doc/s5 Doc/s5
        rm -rf $(TMPDIR)
 
-repo: .hg
+repo: .git
 
 
 clean:
index 7be053a781f470efe39fd64d2234310df55fb12a..8bc76151352d016c80ab1a563ab4afd1436d4f89 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,15 +3,8 @@ from distutils.sysconfig import get_python_lib
 import os, os.path
 import sys
 
-if 'sdist' in sys.argv and sys.platform != "win32" and sys.version_info >= (2,4):
-    # Record the current revision in .hgrev
-    import subprocess # os.popen is cleaner but deprecated
-    changeset = subprocess.Popen("hg identify --id --rev tip".split(),
-                                 stdout=subprocess.PIPE).stdout.read()
-    rev = changeset.decode('ISO-8859-1').strip()
-    hgrev = open('.hgrev', 'w')
-    hgrev.write(rev)
-    hgrev.close()
+if 'sdist' in sys.argv and sys.platform != "win32":
+    assert os.system("git show-ref -s HEAD > .gitrev") == 0
 
 if sys.platform == "darwin":
     # Don't create resource files on OS X tar.