summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2011-11-30 13:41:02 -0800
committerShawn O. Pearce <sop@google.com>2011-11-30 13:41:02 -0800
commit34fb20f67c7bdca2b1321a40f2fd558f9a34d866 (patch)
treeb3f9f06b115d2d52aa01c6deda8a3f3c3af345c2
parentecff4f17b08f791466b73d935c772de57f2257e6 (diff)
downloadgit-repo-34fb20f67c7bdca2b1321a40f2fd558f9a34d866.tar.gz
Revert "Default repo manifest settings in git config"v1.7.8.1
This reverts commit ee1c2f5717fcc137ab887a4aae8a08d50a539b9a. This breaks a lot of buildbot systems. Rolling it back for now until we can understand what the breakage was and how to fix it.
-rw-r--r--manifest_xml.py6
-rwxr-xr-xrepo4
-rw-r--r--subcmds/init.py39
3 files changed, 6 insertions, 43 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index c9e5c405..9189eec4 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -228,11 +228,7 @@ class XmlManifest(object):
228 @property 228 @property
229 def manifest_server(self): 229 def manifest_server(self):
230 self._Load() 230 self._Load()
231 231 return self._manifest_server
232 if self._manifest_server:
233 return self._manifest_server
234
235 return self.manifestProject.config.GetString('repo.manifest-server')
236 232
237 @property 233 @property
238 def IsMirror(self): 234 def IsMirror(self):
diff --git a/repo b/repo
index 0b20a9b8..2a13af5b 100755
--- a/repo
+++ b/repo
@@ -28,7 +28,7 @@ if __name__ == '__main__':
28del magic 28del magic
29 29
30# increment this whenever we make important changes to this script 30# increment this whenever we make important changes to this script
31VERSION = (1, 14) 31VERSION = (1, 13)
32 32
33# increment this if the MAINTAINER_KEYS block is modified 33# increment this if the MAINTAINER_KEYS block is modified
34KEYRING_VERSION = (1,0) 34KEYRING_VERSION = (1,0)
@@ -154,7 +154,7 @@ def _Init(args):
154 """Installs repo by cloning it over the network. 154 """Installs repo by cloning it over the network.
155 """ 155 """
156 opt, args = init_optparse.parse_args(args) 156 opt, args = init_optparse.parse_args(args)
157 if args: 157 if args or not opt.manifest_url:
158 init_optparse.print_usage() 158 init_optparse.print_usage()
159 sys.exit(1) 159 sys.exit(1)
160 160
diff --git a/subcmds/init.py b/subcmds/init.py
index a653c80d..1cba3665 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -23,7 +23,6 @@ from error import ManifestParseError
23from project import SyncBuffer 23from project import SyncBuffer
24from git_config import GitConfig 24from git_config import GitConfig
25from git_command import git_require, MIN_GIT_VERSION 25from git_command import git_require, MIN_GIT_VERSION
26from git_config import GitConfig
27 26
28class Init(InteractiveCommand, MirrorSafeCommand): 27class Init(InteractiveCommand, MirrorSafeCommand):
29 common = True 28 common = True
@@ -37,20 +36,6 @@ The latest repo source code and manifest collection is downloaded
37from the server and is installed in the .repo/ directory in the 36from the server and is installed in the .repo/ directory in the
38current working directory. 37current working directory.
39 38
40The optional -u argument can be used to specify a URL to the
41manifest project. It is also possible to have a git configuration
42section as below to use 'identifier' as argument to -u:
43
44 [repo-manifest "identifier"]
45 url = ...
46 server = ...
47 reference = ...
48
49Only the url is required - the others are optional.
50
51If no -u argument is specified, the 'repo-manifest' section named
52'default' will be used if present.
53
54The optional -b argument can be used to select the manifest branch 39The optional -b argument can be used to select the manifest branch
55to checkout and use. If no branch is specified, master is assumed. 40to checkout and use. If no branch is specified, master is assumed.
56 41
@@ -84,7 +69,7 @@ to update the working directory files.
84 # Manifest 69 # Manifest
85 g = p.add_option_group('Manifest options') 70 g = p.add_option_group('Manifest options')
86 g.add_option('-u', '--manifest-url', 71 g.add_option('-u', '--manifest-url',
87 dest='manifest_url', default='default', 72 dest='manifest_url',
88 help='manifest repository location', metavar='URL') 73 help='manifest repository location', metavar='URL')
89 g.add_option('-b', '--manifest-branch', 74 g.add_option('-b', '--manifest-branch',
90 dest='manifest_branch', 75 dest='manifest_branch',
@@ -123,25 +108,10 @@ to update the working directory files.
123 def _SyncManifest(self, opt): 108 def _SyncManifest(self, opt):
124 m = self.manifest.manifestProject 109 m = self.manifest.manifestProject
125 is_new = not m.Exists 110 is_new = not m.Exists
126 manifest_server = None
127
128 # The manifest url may point out a manifest section in the config
129 key = 'repo-manifest.%s.' % opt.manifest_url
130 if GitConfig.ForUser().GetString(key + 'url'):
131 opt.manifest_url = GitConfig.ForUser().GetString(key + 'url')
132
133 # Also copy other options to the manifest config if not specified already.
134 if not opt.reference:
135 opt.reference = GitConfig.ForUser().GetString(key + 'reference')
136 manifest_server = GitConfig.ForUser().GetString(key + 'server')
137 111
138 if is_new: 112 if is_new:
139 if not opt.manifest_url or opt.manifest_url == 'default': 113 if not opt.manifest_url:
140 print >>sys.stderr, """\ 114 print >>sys.stderr, 'fatal: manifest url (-u) is required.'
141fatal: missing manifest url (-u) and no default found.
142
143 tip: The global git configuration key 'repo-manifest.default.url' can
144 be used to specify a default url."""
145 sys.exit(1) 115 sys.exit(1)
146 116
147 if not opt.quiet: 117 if not opt.quiet:
@@ -165,9 +135,6 @@ fatal: missing manifest url (-u) and no default found.
165 r.ResetFetch() 135 r.ResetFetch()
166 r.Save() 136 r.Save()
167 137
168 if manifest_server:
169 m.config.SetString('repo.manifest-server', manifest_server)
170
171 if opt.reference: 138 if opt.reference:
172 m.config.SetString('repo.reference', opt.reference) 139 m.config.SetString('repo.reference', opt.reference)
173 140