Beispiel #1
0
    def __init__(self, repodir):
        self.repodir = os.path.abspath(repodir)
        self.topdir = os.path.dirname(self.repodir)
        self.manifestFile = os.path.join(self.repodir, MANIFEST_FILE_NAME)
        self.globalConfig = GitConfig.ForUser()
        self.localManifestWarning = False
        self.isGitcClient = False
        self._load_local_manifests = True

        self.repoProject = MetaProject(self,
                                       'repo',
                                       gitdir=os.path.join(
                                           repodir, 'repo/.git'),
                                       worktree=os.path.join(repodir, 'repo'))

        mp = MetaProject(self,
                         'manifests',
                         gitdir=os.path.join(repodir, 'manifests.git'),
                         worktree=os.path.join(repodir, 'manifests'))
        self.manifestProject = mp

        # This is a bit hacky, but we're in a chicken & egg situation: all the
        # normal repo settings live in the manifestProject which we just setup
        # above, so we couldn't easily query before that.  We assume Project()
        # init doesn't care if this changes afterwards.
        if os.path.exists(mp.gitdir) and mp.config.GetBoolean('repo.worktree'):
            mp.use_git_worktrees = True

        self._Unload()
Beispiel #2
0
  def __init__(self, repodir):
    self.repodir = os.path.abspath(repodir)
    self.topdir = os.path.dirname(self.repodir)
    self.manifestFile = os.path.join(self.repodir, MANIFEST_FILE_NAME)
    self.globalConfig = GitConfig.ForUser()

    self.repoProject = MetaProject(self, 'repo',
      gitdir   = os.path.join(repodir, 'repo/.git'),
      worktree = os.path.join(repodir, 'repo'))

    self.manifestProject = MetaProject(self, 'manifests',
      gitdir   = os.path.join(repodir, 'manifests.git'),
      worktree = os.path.join(repodir, 'manifests'))

    self._Unload()
Beispiel #3
0
    def __init__(self, repodir):
        Manifest.__init__(self, repodir)

        gitdir = os.path.join(repodir, 'manifest.git')
        config = GitConfig.ForRepository(gitdir=gitdir)

        if config.GetBoolean('repo.mirror'):
            worktree = os.path.join(repodir, 'manifest')
            relpath = None
        else:
            worktree = self.topdir
            relpath = '.'

        self.manifestProject = MetaProject(self,
                                           '__manifest__',
                                           gitdir=gitdir,
                                           worktree=worktree,
                                           relpath=relpath)
        self._modules = GitConfig(os.path.join(worktree, '.gitmodules'),
                                  pickleFile=os.path.join(
                                      repodir, '.repopickle_gitmodules'))
        self._review = GitConfig(os.path.join(worktree, '.review'),
                                 pickleFile=os.path.join(
                                     repodir, '.repopickle_review'))
        self._Unload()
Beispiel #4
0
  def __init__(self, repodir):
    Manifest.__init__(self, repodir)

    self._manifestFile = os.path.join(repodir, MANIFEST_FILE_NAME)
    self.manifestProject = MetaProject(self, 'manifests',
      gitdir   = os.path.join(repodir, 'manifests.git'),
      worktree = os.path.join(repodir, 'manifests'))

    self._Unload()
Beispiel #5
0
  def __init__(self, repodir):
    self.repodir = os.path.abspath(repodir)
    self.topdir = os.path.dirname(self.repodir)
    self.globalConfig = GitConfig.ForUser()
    Editor.globalConfig = self.globalConfig

    self.repoProject = MetaProject(self, 'repo',
      gitdir   = os.path.join(repodir, 'repo/.git'),
      worktree = os.path.join(repodir, 'repo'))
Beispiel #6
0
  def __init__(self, repodir, manifest_file, local_manifests=None):
    """Initialize.

    Args:
      repodir: Path to the .repo/ dir for holding all internal checkout state.
          It must be in the top directory of the repo client checkout.
      manifest_file: Full path to the manifest file to parse.  This will usually
          be |repodir|/|MANIFEST_FILE_NAME|.
      local_manifests: Full path to the directory of local override manifests.
          This will usually be |repodir|/|LOCAL_MANIFESTS_DIR_NAME|.
    """
    # TODO(vapier): Move this out of this class.
    self.globalConfig = GitConfig.ForUser()

    self.repodir = os.path.abspath(repodir)
    self.topdir = os.path.dirname(self.repodir)
    self.manifestFile = manifest_file
    self.local_manifests = local_manifests
    self._load_local_manifests = True

    self.repoProject = MetaProject(self, 'repo',
                                   gitdir=os.path.join(repodir, 'repo/.git'),
                                   worktree=os.path.join(repodir, 'repo'))

    mp = MetaProject(self, 'manifests',
                     gitdir=os.path.join(repodir, 'manifests.git'),
                     worktree=os.path.join(repodir, 'manifests'))
    self.manifestProject = mp

    # This is a bit hacky, but we're in a chicken & egg situation: all the
    # normal repo settings live in the manifestProject which we just setup
    # above, so we couldn't easily query before that.  We assume Project()
    # init doesn't care if this changes afterwards.
    if os.path.exists(mp.gitdir) and mp.config.GetBoolean('repo.worktree'):
      mp.use_git_worktrees = True

    self._Unload()