summaryrefslogtreecommitdiffstats
path: root/subcmds/init.py
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 /subcmds/init.py
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.
Diffstat (limited to 'subcmds/init.py')
-rw-r--r--subcmds/init.py39
1 files changed, 3 insertions, 36 deletions
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