diff easyhg.py @ 188:07b908b4fa5f

* Set python library path when unbundling extension, generally prefer unbundled copy
author Chris Cannam
date Mon, 20 Dec 2010 16:15:43 +0000
parents 98fa31128e9d
children c5fceb3fe5b4
line wrap: on
line diff
--- a/easyhg.py	Mon Dec 20 16:15:19 2010 +0000
+++ b/easyhg.py	Mon Dec 20 16:15:43 2010 +0000
@@ -16,6 +16,16 @@
 import sys
 from mercurial import ui, getpass, util
 from mercurial.i18n import _
+
+# The value assigned here may be modified during installation, by
+# replacing its default value with another one.  We can't compare
+# against its default value, because then the comparison text would
+# get modified as well.  So, compare using prefix only.
+#
+easyhg_import_path = 'NO_EASYHG_IMPORT_PATH'
+if not easyhg_import_path.startswith('NO_'):
+    sys.path.append(easyhg_import_path)
+
 from PyQt4 import QtGui
 
 easyhg_qtapp = None