diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/init.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 75a58f11..ec87d036 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -21,6 +21,7 @@ from command import InteractiveCommand, MirrorSafeCommand | |||
21 | from error import ManifestParseError | 21 | from error import ManifestParseError |
22 | from project import SyncBuffer | 22 | from project import SyncBuffer |
23 | from git_command import git_require, MIN_GIT_VERSION | 23 | from git_command import git_require, MIN_GIT_VERSION |
24 | from manifest_xml import XmlManifest | ||
24 | 25 | ||
25 | class Init(InteractiveCommand, MirrorSafeCommand): | 26 | class Init(InteractiveCommand, MirrorSafeCommand): |
26 | common = True | 27 | common = True |
@@ -37,10 +38,6 @@ current working directory. | |||
37 | The optional -b argument can be used to select the manifest branch | 38 | The optional -b argument can be used to select the manifest branch |
38 | to checkout and use. If no branch is specified, master is assumed. | 39 | to checkout and use. If no branch is specified, master is assumed. |
39 | 40 | ||
40 | The optional -m argument can be used to specify an alternate manifest | ||
41 | to be used. If no manifest is specified, the manifest default.xml | ||
42 | will be used. | ||
43 | |||
44 | Switching Manifest Branches | 41 | Switching Manifest Branches |
45 | --------------------------- | 42 | --------------------------- |
46 | 43 | ||
@@ -65,9 +62,11 @@ to update the working directory files. | |||
65 | g.add_option('-b', '--manifest-branch', | 62 | g.add_option('-b', '--manifest-branch', |
66 | dest='manifest_branch', | 63 | dest='manifest_branch', |
67 | help='manifest branch or revision', metavar='REVISION') | 64 | help='manifest branch or revision', metavar='REVISION') |
68 | g.add_option('-m', '--manifest-name', | 65 | if isinstance(self.manifest, XmlManifest) \ |
69 | dest='manifest_name', default='default.xml', | 66 | or not self.manifest.manifestProject.Exists: |
70 | help='initial manifest file', metavar='NAME.xml') | 67 | g.add_option('-m', '--manifest-name', |
68 | dest='manifest_name', default='default.xml', | ||
69 | help='initial manifest file', metavar='NAME.xml') | ||
71 | g.add_option('--mirror', | 70 | g.add_option('--mirror', |
72 | dest='mirror', action='store_true', | 71 | dest='mirror', action='store_true', |
73 | help='mirror the forrest') | 72 | help='mirror the forrest') |
@@ -216,7 +215,8 @@ to update the working directory files. | |||
216 | def Execute(self, opt, args): | 215 | def Execute(self, opt, args): |
217 | git_require(MIN_GIT_VERSION, fail=True) | 216 | git_require(MIN_GIT_VERSION, fail=True) |
218 | self._SyncManifest(opt) | 217 | self._SyncManifest(opt) |
219 | self._LinkManifest(opt.manifest_name) | 218 | if isinstance(self.manifest, XmlManifest): |
219 | self._LinkManifest(opt.manifest_name) | ||
220 | 220 | ||
221 | if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: | 221 | if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: |
222 | self._ConfigureUser() | 222 | self._ConfigureUser() |