diff options
| author | Shawn O. Pearce <sop@google.com> | 2010-12-07 10:31:19 -0800 |
|---|---|---|
| committer | Shawn O. Pearce <sop@google.com> | 2010-12-07 11:13:29 -0800 |
| commit | 13f3da50d40b89ee5b05f5f3de9542c20edac6d1 (patch) | |
| tree | d085b6f6b498bde85a1969fce884dd24e88d03d5 /subcmds/init.py | |
| parent | 3218c13205694434edb2375ab8a8515554eed366 (diff) | |
| parent | 2b8db3ce3e7344b9f3b5216637c5af0d54be5656 (diff) | |
| download | git-repo-13f3da50d40b89ee5b05f5f3de9542c20edac6d1.tar.gz | |
Merge branch 'stable'
* stable: (33 commits)
Added feature to print a <notice> from manifest at the end of a sync.
sync: Use --force-broken to continue other projects
upload: Remove --replace option
sync --quiet: be more quiet
sync: Enable use of git clone --reference
Only delete corrupt pickle config files if they exist
Don't allow git fetch to start ControlMaster
Check for existing SSH ControlMaster
Fix for handling values of EDITOR which contain a space.
upload: Fix --replace flag
rebase: Pass through more options
upload: Allow review.HOST.username to override email
upload -t: Automatically include local branch name
Warn users before uploading if there are local changes
sync: Try fetching a tag as a last resort before giving up
rebase: Automatically rebase branch on upstrea
upload: Automatically --cc folks in review.URL.autocopy
Fix format string bugs in grep
Do not invoke ssh with -p argument when no port has been specified.
Allow files to be copied into new folders
...
Conflicts:
git_config.py
manifest_xml.py
subcmds/init.py
subcmds/sync.py
subcmds/upload.py
Change-Id: I4756a6908277e91505c35287a122a775b68f4df5
Diffstat (limited to 'subcmds/init.py')
| -rw-r--r-- | subcmds/init.py | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index cdbbfdf7..2ca4e163 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -40,6 +40,17 @@ current working directory. | |||
| 40 | The optional -b argument can be used to select the manifest branch | 40 | The optional -b argument can be used to select the manifest branch |
| 41 | to checkout and use. If no branch is specified, master is assumed. | 41 | to checkout and use. If no branch is specified, master is assumed. |
| 42 | 42 | ||
| 43 | The optional -m argument can be used to specify an alternate manifest | ||
| 44 | to be used. If no manifest is specified, the manifest default.xml | ||
| 45 | will be used. | ||
| 46 | |||
| 47 | The --reference option can be used to point to a directory that | ||
| 48 | has the content of a --mirror sync. This will make the working | ||
| 49 | directory use as much data as possible from the local reference | ||
| 50 | directory when fetching from the server. This will make the sync | ||
| 51 | go a lot faster by reducing data traffic on the network. | ||
| 52 | |||
| 53 | |||
| 43 | Switching Manifest Branches | 54 | Switching Manifest Branches |
| 44 | --------------------------- | 55 | --------------------------- |
| 45 | 56 | ||
| @@ -76,7 +87,9 @@ to update the working directory files. | |||
| 76 | g.add_option('--mirror', | 87 | g.add_option('--mirror', |
| 77 | dest='mirror', action='store_true', | 88 | dest='mirror', action='store_true', |
| 78 | help='mirror the forrest') | 89 | help='mirror the forrest') |
| 79 | 90 | g.add_option('--reference', | |
| 91 | dest='reference', | ||
| 92 | help='location of mirror directory', metavar='DIR') | ||
| 80 | 93 | ||
| 81 | # Tool | 94 | # Tool |
| 82 | g = p.add_option_group('repo Version options') | 95 | g = p.add_option_group('repo Version options') |
| @@ -132,6 +145,9 @@ to update the working directory files. | |||
| 132 | r.ResetFetch() | 145 | r.ResetFetch() |
| 133 | r.Save() | 146 | r.Save() |
| 134 | 147 | ||
| 148 | if opt.reference: | ||
| 149 | m.config.SetString('repo.reference', opt.reference) | ||
| 150 | |||
| 135 | if opt.mirror: | 151 | if opt.mirror: |
| 136 | if is_new: | 152 | if is_new: |
| 137 | m.config.SetString('repo.mirror', 'true') | 153 | m.config.SetString('repo.mirror', 'true') |
| @@ -162,7 +178,11 @@ to update the working directory files. | |||
| 162 | syncbuf = SyncBuffer(m.config) | 178 | syncbuf = SyncBuffer(m.config) |
| 163 | m.Sync_LocalHalf(syncbuf) | 179 | m.Sync_LocalHalf(syncbuf) |
| 164 | syncbuf.Finish() | 180 | syncbuf.Finish() |
| 181 | |||
| 182 | if isinstance(self.manifest, XmlManifest): | ||
| 183 | self._LinkManifest(opt.manifest_name) | ||
| 165 | _ReloadManifest(self) | 184 | _ReloadManifest(self) |
| 185 | |||
| 166 | self._ApplyOptions(opt, is_new) | 186 | self._ApplyOptions(opt, is_new) |
| 167 | 187 | ||
| 168 | if not self.manifest.InitBranch(): | 188 | if not self.manifest.InitBranch(): |
| @@ -200,8 +220,9 @@ to update the working directory files. | |||
| 200 | 220 | ||
| 201 | print '' | 221 | print '' |
| 202 | print 'Your identity is: %s <%s>' % (name, email) | 222 | print 'Your identity is: %s <%s>' % (name, email) |
| 203 | sys.stdout.write('is this correct [yes/no]? ') | 223 | sys.stdout.write('is this correct [y/n]? ') |
| 204 | if 'yes' == sys.stdin.readline().strip(): | 224 | a = sys.stdin.readline().strip() |
| 225 | if a in ('yes', 'y', 't', 'true'): | ||
| 205 | break | 226 | break |
| 206 | 227 | ||
| 207 | if name != mp.UserName: | 228 | if name != mp.UserName: |
| @@ -249,8 +270,6 @@ to update the working directory files. | |||
| 249 | def Execute(self, opt, args): | 270 | def Execute(self, opt, args): |
| 250 | git_require(MIN_GIT_VERSION, fail=True) | 271 | git_require(MIN_GIT_VERSION, fail=True) |
| 251 | self._SyncManifest(opt) | 272 | self._SyncManifest(opt) |
| 252 | if isinstance(self.manifest, XmlManifest): | ||
| 253 | self._LinkManifest(opt.manifest_name) | ||
| 254 | 273 | ||
| 255 | if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: | 274 | if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: |
| 256 | self._ConfigureUser() | 275 | self._ConfigureUser() |
