helper: align update of reference to shared hg repo

... to use a relative path where possible
This commit is contained in:
Mark Nauwelaerts
2025-05-03 11:35:51 +02:00
parent d47a4abdae
commit 6d75435eab

View File

@@ -227,9 +227,12 @@ class GitHgRepo:
warn(b'failed to find local hg for remote %s' % (r))
continue
else:
npath = os.path.abspath(hg_path)
# use relative path if possible
if check_version(4, 2):
npath = os.path.join(b'..', b'..', b'..', b'.hg')
# make sure the shared path is always up-to-date
util.writefile(os.path.join(local_hg, b'sharedpath'),
os.path.abspath(hg_path))
util.writefile(os.path.join(local_hg, b'sharedpath'), npath)
self.hg_repos[r] = os.path.join(local_path)
log('%s determined hg_repos %s', self.identity(), self.hg_repos)