diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 39 |
1 files changed, 22 insertions, 17 deletions
| @@ -519,13 +519,7 @@ class Project(object): | |||
| 519 | self.client = self.manifest = manifest | 519 | self.client = self.manifest = manifest |
| 520 | self.name = name | 520 | self.name = name |
| 521 | self.remote = remote | 521 | self.remote = remote |
| 522 | self.gitdir = gitdir.replace('\\', '/') | 522 | self.UpdatePaths(relpath, worktree, gitdir, objdir) |
| 523 | self.objdir = objdir.replace('\\', '/') | ||
| 524 | if worktree: | ||
| 525 | self.worktree = os.path.normpath(worktree).replace('\\', '/') | ||
| 526 | else: | ||
| 527 | self.worktree = None | ||
| 528 | self.relpath = relpath | ||
| 529 | self.revisionExpr = revisionExpr | 523 | self.revisionExpr = revisionExpr |
| 530 | 524 | ||
| 531 | if revisionId is None \ | 525 | if revisionId is None \ |
| @@ -556,16 +550,6 @@ class Project(object): | |||
| 556 | self.copyfiles = [] | 550 | self.copyfiles = [] |
| 557 | self.linkfiles = [] | 551 | self.linkfiles = [] |
| 558 | self.annotations = [] | 552 | self.annotations = [] |
| 559 | self.config = GitConfig.ForRepository(gitdir=self.gitdir, | ||
| 560 | defaults=self.client.globalConfig) | ||
| 561 | |||
| 562 | if self.worktree: | ||
| 563 | self.work_git = self._GitGetByExec(self, bare=False, gitdir=gitdir) | ||
| 564 | else: | ||
| 565 | self.work_git = None | ||
| 566 | self.bare_git = self._GitGetByExec(self, bare=True, gitdir=gitdir) | ||
| 567 | self.bare_ref = GitRefs(gitdir) | ||
| 568 | self.bare_objdir = self._GitGetByExec(self, bare=True, gitdir=objdir) | ||
| 569 | self.dest_branch = dest_branch | 553 | self.dest_branch = dest_branch |
| 570 | self.old_revision = old_revision | 554 | self.old_revision = old_revision |
| 571 | 555 | ||
| @@ -573,6 +557,27 @@ class Project(object): | |||
| 573 | # project containing repo hooks. | 557 | # project containing repo hooks. |
| 574 | self.enabled_repo_hooks = [] | 558 | self.enabled_repo_hooks = [] |
| 575 | 559 | ||
| 560 | def UpdatePaths(self, relpath, worktree, gitdir, objdir): | ||
| 561 | """Update paths used by this project""" | ||
| 562 | self.gitdir = gitdir.replace('\\', '/') | ||
| 563 | self.objdir = objdir.replace('\\', '/') | ||
| 564 | if worktree: | ||
| 565 | self.worktree = os.path.normpath(worktree).replace('\\', '/') | ||
| 566 | else: | ||
| 567 | self.worktree = None | ||
| 568 | self.relpath = relpath | ||
| 569 | |||
| 570 | self.config = GitConfig.ForRepository(gitdir=self.gitdir, | ||
| 571 | defaults=self.manifest.globalConfig) | ||
| 572 | |||
| 573 | if self.worktree: | ||
| 574 | self.work_git = self._GitGetByExec(self, bare=False, gitdir=self.gitdir) | ||
| 575 | else: | ||
| 576 | self.work_git = None | ||
| 577 | self.bare_git = self._GitGetByExec(self, bare=True, gitdir=self.gitdir) | ||
| 578 | self.bare_ref = GitRefs(self.gitdir) | ||
| 579 | self.bare_objdir = self._GitGetByExec(self, bare=True, gitdir=self.objdir) | ||
| 580 | |||
| 576 | @property | 581 | @property |
| 577 | def Derived(self): | 582 | def Derived(self): |
| 578 | return self.is_derived | 583 | return self.is_derived |
