tools(utils): fixed path handling in getRepositoryData
This commit is contained in:
parent
69faabb405
commit
578883b8bd
1 changed files with 3 additions and 3 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue