diff options
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -464,7 +464,13 @@ class RemoteSpec(object): | |||
464 | 464 | ||
465 | class Project(object): | 465 | class Project(object): |
466 | # These objects can be shared between several working trees. | 466 | # These objects can be shared between several working trees. |
467 | shareable_dirs = ['hooks', 'rr-cache'] | 467 | @property |
468 | def shareable_dirs(self): | ||
469 | """Return the shareable directories""" | ||
470 | if self.UseAlternates: | ||
471 | return ['hooks', 'rr-cache'] | ||
472 | else: | ||
473 | return ['hooks', 'objects', 'rr-cache'] | ||
468 | 474 | ||
469 | def __init__(self, | 475 | def __init__(self, |
470 | manifest, | 476 | manifest, |
@@ -595,6 +601,14 @@ class Project(object): | |||
595 | self.bare_objdir = self._GitGetByExec(self, bare=True, gitdir=self.objdir) | 601 | self.bare_objdir = self._GitGetByExec(self, bare=True, gitdir=self.objdir) |
596 | 602 | ||
597 | @property | 603 | @property |
604 | def UseAlternates(self): | ||
605 | """Whether git alternates are in use. | ||
606 | |||
607 | This will be removed once migration to alternates is complete. | ||
608 | """ | ||
609 | return _ALTERNATES or self.manifest.is_multimanifest | ||
610 | |||
611 | @property | ||
598 | def Derived(self): | 612 | def Derived(self): |
599 | return self.is_derived | 613 | return self.is_derived |
600 | 614 | ||
@@ -1147,7 +1161,7 @@ class Project(object): | |||
1147 | self._UpdateHooks(quiet=quiet) | 1161 | self._UpdateHooks(quiet=quiet) |
1148 | self._InitRemote() | 1162 | self._InitRemote() |
1149 | 1163 | ||
1150 | if _ALTERNATES or self.manifest.is_multimanifest: | 1164 | if self.UseAlternates: |
1151 | # If gitdir/objects is a symlink, migrate it from the old layout. | 1165 | # If gitdir/objects is a symlink, migrate it from the old layout. |
1152 | gitdir_objects = os.path.join(self.gitdir, 'objects') | 1166 | gitdir_objects = os.path.join(self.gitdir, 'objects') |
1153 | if platform_utils.islink(gitdir_objects): | 1167 | if platform_utils.islink(gitdir_objects): |