diff options
-rw-r--r-- | manifest.py | 3 | ||||
-rw-r--r-- | manifest_xml.py | 6 | ||||
-rw-r--r-- | subcmds/init.py | 7 |
3 files changed, 12 insertions, 4 deletions
diff --git a/manifest.py b/manifest.py index 0762098b..a2fc9601 100644 --- a/manifest.py +++ b/manifest.py | |||
@@ -40,5 +40,8 @@ class Manifest(object): | |||
40 | def projects(self): | 40 | def projects(self): |
41 | return {} | 41 | return {} |
42 | 42 | ||
43 | def InitBranch(self): | ||
44 | pass | ||
45 | |||
43 | def SetMRefs(self, project): | 46 | def SetMRefs(self, project): |
44 | pass | 47 | pass |
diff --git a/manifest_xml.py b/manifest_xml.py index 66cdf3e3..45896be9 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -169,6 +169,12 @@ class XmlManifest(Manifest): | |||
169 | self._Load() | 169 | self._Load() |
170 | return self._default | 170 | return self._default |
171 | 171 | ||
172 | def InitBranch(self): | ||
173 | m = self.manifestProject | ||
174 | if m.CurrentBranch is None: | ||
175 | return m.StartBranch('default') | ||
176 | return True | ||
177 | |||
172 | def SetMRefs(self, project): | 178 | def SetMRefs(self, project): |
173 | if self.branch: | 179 | if self.branch: |
174 | project._InitAnyMRef(R_M + self.branch) | 180 | project._InitAnyMRef(R_M + self.branch) |
diff --git a/subcmds/init.py b/subcmds/init.py index ec87d036..0075b0b4 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -130,10 +130,9 @@ to update the working directory files. | |||
130 | m.Sync_LocalHalf(syncbuf) | 130 | m.Sync_LocalHalf(syncbuf) |
131 | syncbuf.Finish() | 131 | syncbuf.Finish() |
132 | 132 | ||
133 | if is_new or m.CurrentBranch is None: | 133 | if not self.manifest.InitBranch(): |
134 | if not m.StartBranch('default'): | 134 | print >>sys.stderr, 'fatal: cannot create branch in manifest' |
135 | print >>sys.stderr, 'fatal: cannot create default in manifest' | 135 | sys.exit(1) |
136 | sys.exit(1) | ||
137 | 136 | ||
138 | def _LinkManifest(self, name): | 137 | def _LinkManifest(self, name): |
139 | if not name: | 138 | if not name: |