diff options
author | Shawn O. Pearce <sop@google.com> | 2008-10-29 15:20:02 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2008-10-29 15:24:34 -0700 |
commit | 7965f9fed083f07255d62f2a4a49fb54424356e4 (patch) | |
tree | 60b0eff346743da51bf3f4952bd40623e046c362 | |
parent | de646819b8e43a906d86a579c68118cad31934cc (diff) | |
download | git-repo-7965f9fed083f07255d62f2a4a49fb54424356e4.tar.gz |
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>
-rwxr-xr-x | main.py | 2 | ||||
-rw-r--r-- | manifest.py | 3 |
2 files changed, 2 insertions, 3 deletions
@@ -28,6 +28,7 @@ import re | |||
28 | import sys | 28 | import sys |
29 | 29 | ||
30 | from command import InteractiveCommand, PagedCommand | 30 | from command import InteractiveCommand, PagedCommand |
31 | from editor import Editor | ||
31 | from error import NoSuchProjectError | 32 | from error import NoSuchProjectError |
32 | from error import RepoChangedException | 33 | from error import RepoChangedException |
33 | from manifest import Manifest | 34 | from manifest import Manifest |
@@ -77,6 +78,7 @@ class _Repo(object): | |||
77 | 78 | ||
78 | cmd.repodir = self.repodir | 79 | cmd.repodir = self.repodir |
79 | cmd.manifest = Manifest(cmd.repodir) | 80 | cmd.manifest = Manifest(cmd.repodir) |
81 | Editor.globalConfig = cmd.manifest.globalConfig | ||
80 | 82 | ||
81 | if not gopts.no_pager and not isinstance(cmd, InteractiveCommand): | 83 | if not gopts.no_pager and not isinstance(cmd, InteractiveCommand): |
82 | config = cmd.manifest.globalConfig | 84 | config = cmd.manifest.globalConfig |
diff --git a/manifest.py b/manifest.py index 89dd5bed..8c5a8d6d 100644 --- a/manifest.py +++ b/manifest.py | |||
@@ -17,7 +17,6 @@ import os | |||
17 | import sys | 17 | import sys |
18 | import xml.dom.minidom | 18 | import xml.dom.minidom |
19 | 19 | ||
20 | from editor import Editor | ||
21 | from git_config import GitConfig, IsId | 20 | from git_config import GitConfig, IsId |
22 | from import_tar import ImportTar | 21 | from import_tar import ImportTar |
23 | from import_zip import ImportZip | 22 | from import_zip import ImportZip |
@@ -42,9 +41,7 @@ class Manifest(object): | |||
42 | self.repodir = os.path.abspath(repodir) | 41 | self.repodir = os.path.abspath(repodir) |
43 | self.topdir = os.path.dirname(self.repodir) | 42 | self.topdir = os.path.dirname(self.repodir) |
44 | self.manifestFile = os.path.join(self.repodir, MANIFEST_FILE_NAME) | 43 | self.manifestFile = os.path.join(self.repodir, MANIFEST_FILE_NAME) |
45 | |||
46 | self.globalConfig = GitConfig.ForUser() | 44 | self.globalConfig = GitConfig.ForUser() |
47 | Editor.globalConfig = self.globalConfig | ||
48 | 45 | ||
49 | self.repoProject = MetaProject(self, 'repo', | 46 | self.repoProject = MetaProject(self, 'repo', |
50 | gitdir = os.path.join(repodir, 'repo/.git'), | 47 | gitdir = os.path.join(repodir, 'repo/.git'), |