diff sat/tools/utils.py @ 2568:8e204f0d3193

tools(utils): fixed path handling in getRepositoryData
author Goffi <goffi@goffi.org>
date Wed, 04 Apr 2018 09:21:00 +0200
parents 26edcf3a30eb
children 18e2ca5f798e
line wrap: on
line diff
--- a/sat/tools/utils.py	Wed Apr 04 08:45:09 2018 +0200
+++ b/sat/tools/utils.py	Wed Apr 04 09:21:00 2018 +0200
@@ -136,9 +136,9 @@
     ori_cwd = os.getcwd()
 
     if is_path:
-        repos_root = module
+        repos_root = os.path.abspath(module)
     else:
-        repos_root = os.path.dirname(module.__file__)
+        repos_root = os.path.abspath(os.path.dirname(module.__file__))
 
     hg_path = find_executable('hg')
 
@@ -178,7 +178,7 @@
         if is_path:
             os.chdir(repos_root)
         else:
-            os.chdir(os.path.relpath('..', repos_root))
+            os.chdir(os.path.abspath(os.path.join('..', repos_root)))
         try:
             with open('.hg/dirstate') as hg_dirstate:
                 hg_data['node'] = hg_dirstate.read(20).encode('hex')