Move the Editor configuration out of Manifest's constructor

This way we can build more than one Manifest instance in memory
and not muck around with the Editor configuration each time we
build a new instance.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce 2008-10-29 15:20:02 -07:00
parent de646819b8
commit 7965f9fed0
2 changed files with 2 additions and 3 deletions

View File

@ -28,6 +28,7 @@ import re
import sys import sys
from command import InteractiveCommand, PagedCommand from command import InteractiveCommand, PagedCommand
from editor import Editor
from error import NoSuchProjectError from error import NoSuchProjectError
from error import RepoChangedException from error import RepoChangedException
from manifest import Manifest from manifest import Manifest
@ -77,6 +78,7 @@ class _Repo(object):
cmd.repodir = self.repodir cmd.repodir = self.repodir
cmd.manifest = Manifest(cmd.repodir) cmd.manifest = Manifest(cmd.repodir)
Editor.globalConfig = cmd.manifest.globalConfig
if not gopts.no_pager and not isinstance(cmd, InteractiveCommand): if not gopts.no_pager and not isinstance(cmd, InteractiveCommand):
config = cmd.manifest.globalConfig config = cmd.manifest.globalConfig

View File

@ -17,7 +17,6 @@ import os
import sys import sys
import xml.dom.minidom import xml.dom.minidom
from editor import Editor
from git_config import GitConfig, IsId from git_config import GitConfig, IsId
from import_tar import ImportTar from import_tar import ImportTar
from import_zip import ImportZip from import_zip import ImportZip
@ -42,9 +41,7 @@ class Manifest(object):
self.repodir = os.path.abspath(repodir) self.repodir = os.path.abspath(repodir)
self.topdir = os.path.dirname(self.repodir) self.topdir = os.path.dirname(self.repodir)
self.manifestFile = os.path.join(self.repodir, MANIFEST_FILE_NAME) self.manifestFile = os.path.join(self.repodir, MANIFEST_FILE_NAME)
self.globalConfig = GitConfig.ForUser() self.globalConfig = GitConfig.ForUser()
Editor.globalConfig = self.globalConfig
self.repoProject = MetaProject(self, 'repo', self.repoProject = MetaProject(self, 'repo',
gitdir = os.path.join(repodir, 'repo/.git'), gitdir = os.path.join(repodir, 'repo/.git'),