Comments
Patch
@@ -22,6 +22,22 @@
import os, sys, inspect
+inspectgetfile = inspect.getfile
+def fixedgetfile(func):
+ return os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), '..', inspectgetfile(func)))
+
+def monkeygetfile(func):
+ try:
+ inspect.getfile = inspectgetfile
+ inspect.getsource(func)
+ return inspect.getfile(func)
+ except IOError:
+ inspect.getfile = fixedgetfile
+ return inspect.getfile(func)
+ finally:
+ inspect.getfile = monkeygetfile
+
+inspect.getfile = monkeygetfile
def escape(s):
# The order is important, the backslash must be escaped first
@@ -47,3 +47,10 @@
$ python check-translation.py *.po
$ python check-translation.py --doctest
$ cd $TESTTMP
+
+Check hggettext
+
+ $ hggettext="$TESTDIR/../i18n/hggettext"
+ $ cd "$TESTDIR"/..
+ $ $hggettext hgext/*.py > /dev/null
+ $ cd $TESTTMP