diff --git a/sat/tools/utils.py b/sat/tools/utils.py index 3729af0b..1a6cecdd 100644 --- a/sat/tools/utils.py +++ b/sat/tools/utils.py @@ -136,9 +136,9 @@ def getRepositoryData(module, as_string=True, is_path=False, save_dir_path=None) 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 @@ def getRepositoryData(module, as_string=True, is_path=False, save_dir_path=None) 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')