diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -103,7 +103,7 @@ def _ProjectHooks(): | |||
103 | """ | 103 | """ |
104 | global _project_hook_list | 104 | global _project_hook_list |
105 | if _project_hook_list is None: | 105 | if _project_hook_list is None: |
106 | d = os.path.realpath(os.path.abspath(os.path.dirname(__file__))) | 106 | d = platform_utils.realpath(os.path.abspath(os.path.dirname(__file__))) |
107 | d = os.path.join(d, 'hooks') | 107 | d = os.path.join(d, 'hooks') |
108 | _project_hook_list = [os.path.join(d, x) for x in os.listdir(d)] | 108 | _project_hook_list = [os.path.join(d, x) for x in os.listdir(d)] |
109 | return _project_hook_list | 109 | return _project_hook_list |
@@ -275,7 +275,7 @@ class _LinkFile(object): | |||
275 | 275 | ||
276 | def __linkIt(self, relSrc, absDest): | 276 | def __linkIt(self, relSrc, absDest): |
277 | # link file if it does not exist or is out of date | 277 | # link file if it does not exist or is out of date |
278 | if not os.path.islink(absDest) or (os.readlink(absDest) != relSrc): | 278 | if not platform_utils.islink(absDest) or (platform_utils.readlink(absDest) != relSrc): |
279 | try: | 279 | try: |
280 | # remove existing file first, since it might be read-only | 280 | # remove existing file first, since it might be read-only |
281 | if os.path.lexists(absDest): | 281 | if os.path.lexists(absDest): |
@@ -2315,10 +2315,10 @@ class Project(object): | |||
2315 | print("Retrying clone after deleting %s" % | 2315 | print("Retrying clone after deleting %s" % |
2316 | self.gitdir, file=sys.stderr) | 2316 | self.gitdir, file=sys.stderr) |
2317 | try: | 2317 | try: |
2318 | platform_utils.rmtree(os.path.realpath(self.gitdir)) | 2318 | platform_utils.rmtree(platform_utils.realpath(self.gitdir)) |
2319 | if self.worktree and os.path.exists(os.path.realpath | 2319 | if self.worktree and os.path.exists(platform_utils.realpath |
2320 | (self.worktree)): | 2320 | (self.worktree)): |
2321 | platform_utils.rmtree(os.path.realpath(self.worktree)) | 2321 | platform_utils.rmtree(platform_utils.realpath(self.worktree)) |
2322 | return self._InitGitDir(mirror_git=mirror_git, force_sync=False) | 2322 | return self._InitGitDir(mirror_git=mirror_git, force_sync=False) |
2323 | except: | 2323 | except: |
2324 | raise e | 2324 | raise e |
@@ -2370,7 +2370,7 @@ class Project(object): | |||
2370 | self._InitHooks() | 2370 | self._InitHooks() |
2371 | 2371 | ||
2372 | def _InitHooks(self): | 2372 | def _InitHooks(self): |
2373 | hooks = os.path.realpath(self._gitdir_path('hooks')) | 2373 | hooks = platform_utils.realpath(self._gitdir_path('hooks')) |
2374 | if not os.path.exists(hooks): | 2374 | if not os.path.exists(hooks): |
2375 | os.makedirs(hooks) | 2375 | os.makedirs(hooks) |
2376 | for stock_hook in _ProjectHooks(): | 2376 | for stock_hook in _ProjectHooks(): |
@@ -2386,7 +2386,7 @@ class Project(object): | |||
2386 | continue | 2386 | continue |
2387 | 2387 | ||
2388 | dst = os.path.join(hooks, name) | 2388 | dst = os.path.join(hooks, name) |
2389 | if os.path.islink(dst): | 2389 | if platform_utils.islink(dst): |
2390 | continue | 2390 | continue |
2391 | if os.path.exists(dst): | 2391 | if os.path.exists(dst): |
2392 | if filecmp.cmp(stock_hook, dst, shallow=False): | 2392 | if filecmp.cmp(stock_hook, dst, shallow=False): |
@@ -2448,9 +2448,9 @@ class Project(object): | |||
2448 | symlink_dirs += self.working_tree_dirs | 2448 | symlink_dirs += self.working_tree_dirs |
2449 | to_symlink = symlink_files + symlink_dirs | 2449 | to_symlink = symlink_files + symlink_dirs |
2450 | for name in set(to_symlink): | 2450 | for name in set(to_symlink): |
2451 | dst = os.path.realpath(os.path.join(destdir, name)) | 2451 | dst = platform_utils.realpath(os.path.join(destdir, name)) |
2452 | if os.path.lexists(dst): | 2452 | if os.path.lexists(dst): |
2453 | src = os.path.realpath(os.path.join(srcdir, name)) | 2453 | src = platform_utils.realpath(os.path.join(srcdir, name)) |
2454 | # Fail if the links are pointing to the wrong place | 2454 | # Fail if the links are pointing to the wrong place |
2455 | if src != dst: | 2455 | if src != dst: |
2456 | _error('%s is different in %s vs %s', name, destdir, srcdir) | 2456 | _error('%s is different in %s vs %s', name, destdir, srcdir) |
@@ -2482,10 +2482,10 @@ class Project(object): | |||
2482 | if copy_all: | 2482 | if copy_all: |
2483 | to_copy = os.listdir(gitdir) | 2483 | to_copy = os.listdir(gitdir) |
2484 | 2484 | ||
2485 | dotgit = os.path.realpath(dotgit) | 2485 | dotgit = platform_utils.realpath(dotgit) |
2486 | for name in set(to_copy).union(to_symlink): | 2486 | for name in set(to_copy).union(to_symlink): |
2487 | try: | 2487 | try: |
2488 | src = os.path.realpath(os.path.join(gitdir, name)) | 2488 | src = platform_utils.realpath(os.path.join(gitdir, name)) |
2489 | dst = os.path.join(dotgit, name) | 2489 | dst = os.path.join(dotgit, name) |
2490 | 2490 | ||
2491 | if os.path.lexists(dst): | 2491 | if os.path.lexists(dst): |
@@ -2498,7 +2498,7 @@ class Project(object): | |||
2498 | if name in to_symlink: | 2498 | if name in to_symlink: |
2499 | platform_utils.symlink( | 2499 | platform_utils.symlink( |
2500 | os.path.relpath(src, os.path.dirname(dst)), dst) | 2500 | os.path.relpath(src, os.path.dirname(dst)), dst) |
2501 | elif copy_all and not os.path.islink(dst): | 2501 | elif copy_all and not platform_utils.islink(dst): |
2502 | if os.path.isdir(src): | 2502 | if os.path.isdir(src): |
2503 | shutil.copytree(src, dst) | 2503 | shutil.copytree(src, dst) |
2504 | elif os.path.isfile(src): | 2504 | elif os.path.isfile(src): |
@@ -2556,7 +2556,7 @@ class Project(object): | |||
2556 | raise | 2556 | raise |
2557 | 2557 | ||
2558 | def _gitdir_path(self, path): | 2558 | def _gitdir_path(self, path): |
2559 | return os.path.realpath(os.path.join(self.gitdir, path)) | 2559 | return platform_utils.realpath(os.path.join(self.gitdir, path)) |
2560 | 2560 | ||
2561 | def _revlist(self, *args, **kw): | 2561 | def _revlist(self, *args, **kw): |
2562 | a = [] | 2562 | a = [] |