Fix sys.path for scripts in contrib.
commit00657f96e857ef3ad57a99c791bcf5f6ed37a795
authormhagger <mhagger@be7e6eca-30d4-0310-a8e5-ac0d63af7087>
Fri, 26 Mar 2010 12:05:57 +0000 (26 12:05 +0000)
committermhagger <mhagger@be7e6eca-30d4-0310-a8e5-ac0d63af7087>
Fri, 26 Mar 2010 12:05:57 +0000 (26 12:05 +0000)
tree675319cedf3ec784681a105761113dc27cee5438
parent74a26ce5e9c978b73ff3cc172e75bdc68c079b09
Fix sys.path for scripts in contrib.

Patch by: Jon Foster <jon.foster@cabot.co.uk>

The problem is that the programs in contrib automatically find the
cvs2svn libraries by taking the script path, then chopping off the
last directory component.  If the full isn't specified, there isn't a
"last directory component" to chop off.  The fix is just to insert a
call to abspath() in the appropriate place.

After fixing that, there's a similar-but-different bug when using
pychecker:

> ~/cvs2svn-trunk/contrib$ pychecker destroy_repository.py
> Processing destroy_repository...
> ImportError: No module named cvs2svn_lib.key_generator

In this case, the problem is that sys.argv[0] points to pychecker,
not destroy_repository.py.  This can be fixed by using __file__
instead, which is a special Python variable that gives the path
to the current source file.

git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5083 be7e6eca-30d4-0310-a8e5-ac0d63af7087
contrib/destroy_repository.py
contrib/find_illegal_filenames.py
contrib/rcs_file_filter.py
contrib/show_db.py
contrib/shrink_test_case.py