http://hg.viff.dk/viff/rev/cc706ddd9376
changeset: 1099:cc706ddd9376
user: Martin Geisler <[email protected]>
date: Wed Feb 04 23:40:56 2009 +0100
summary: Use Mercurial via command line.
The use of Mercurial through its API was a violation of its license
since we were using GPL code from a LGPL program. Interfacing through
the command line is the officially encouraged way for non-GPL programs
to use Mercurial.
diffstat:
1 file changed, 15 insertions(+), 15 deletions(-)
setup.py | 30 +++++++++++++++---------------
diffs (49 lines):
diff -r 54a68af0a945 -r cc706ddd9376 setup.py
--- a/setup.py Wed Feb 04 23:06:07 2009 +0100
+++ b/setup.py Wed Feb 04 23:40:56 2009 +0100
@@ -4,7 +4,7 @@
# For a local install into ~/opt, use: python setup.py --home=~/opt
# For more options, use: python setup.py --help
-# Copyright 2007, 2008 VIFF Development Team.
+# Copyright 2007, 2008, 2009 VIFF Development Team.
#
# This file is part of VIFF, the Virtual Ideal Functionality Framework.
#
@@ -33,22 +33,22 @@
class hg_sdist(sdist):
def get_file_list(self):
try:
- # Attempt the import here so that users can run the other
- # Distutils commands without needing Mercurial.
- from mercurial import hg
- except ImportError:
from distutils.errors import DistutilsModuleError
- raise DistutilsModuleError("could not import mercurial")
+ import subprocess
+ p = subprocess.Popen(['hg', 'manifest'], stdout=subprocess.PIPE)
+ exitcode = p.wait()
+ if exitcode != 0:
+ raise DistutilsModuleError("Mercurial exited with non-zero "
+ "exit code: %d" % exitcode)
+ files = p.stdout.read().strip().split('\n')
- repo = hg.repository(None)
- changeset = repo.changectx(None)
- files = changeset.manifest().keys()
-
- # Add the files *before* the normal manifest magic is done.
- # That allows the manifest template to exclude some files
- # tracked by hg and to include others.
- self.filelist.extend(files)
- sdist.get_file_list(self)
+ # Add the files *before* the normal manifest magic is
+ # done. That allows the manifest template to exclude some
+ # files tracked by hg and to include others.
+ self.filelist.extend(files)
+ sdist.get_file_list(self)
+ except OSError, e:
+ raise DistutilsModuleError("could not execute Mercurial: %s" % e)
setup(name='viff',
version=viff.__version__,
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk