# HG changeset patch
# User Peer Sommerlund <[EMAIL PROTECTED]>
# Date 1224275142 -7200
# Node ID cc4a46c7e373a6a0f5d862df670a34bb55340808
# Parent 8ccb624da5588dd936572ef219bcc9a393f4e63a
hgtk: Overwrite current-dir in sys.path
The documentation for Python 2.5.2 states that sys.path[0], is
the directory containing the script that was used to invoke the
Python interpreter. If the script directory is not available
(e.g. if the interpreter is invoked interactively or if the
script is read from standard input), path[0] is the empty
string, which directs Python to search modules in the current
directory first. Notice that the script directory is inserted
before the entries inserted as a result of PYTHONPATH. A program
is free to modify this list for its own purposes.
This is really mostly important to developers of TortoiseHg.
If you have several clones of the THG repository and you
invoke hgtk inside one of them, you will not use the code you
have asked for with TORTOISEHG_PATH, but the code in the current
directory.
diff -r 8ccb624da558 -r cc4a46c7e373 contrib/hgtk
--- a/contrib/hgtk Sun Sep 28 07:59:05 2008 +0100
+++ b/contrib/hgtk Fri Oct 17 22:25:42 2008 +0200
@@ -114,9 +114,8 @@
# Add TortoiseHg to python path
path = os.environ.get('TORTOISEHG_PATH') or tortoisehg_dir
norm = os.path.normpath(os.path.expanduser(path))
- if norm not in sys.path:
- sys.path.append(norm)
-
+ sys.path[0] = norm
+
try:
# assuming TortoiseHg source layout, with hgtk in contrib
path = os.path.dirname(os.path.realpath(__file__))
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop