summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/init.py9
-rw-r--r--subcmds/sync.py10
2 files changed, 18 insertions, 1 deletions
diff --git a/subcmds/init.py b/subcmds/init.py
index 53c3a010..b5207fbf 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -22,6 +22,7 @@ from error import ManifestParseError
22from project import SyncBuffer 22from project import SyncBuffer
23from git_command import git_require, MIN_GIT_VERSION 23from git_command import git_require, MIN_GIT_VERSION
24from manifest_xml import XmlManifest 24from manifest_xml import XmlManifest
25from subcmds.sync import _ReloadManifest
25 26
26class Init(InteractiveCommand, MirrorSafeCommand): 27class Init(InteractiveCommand, MirrorSafeCommand):
27 common = True 28 common = True
@@ -143,9 +144,17 @@ to update the working directory files.
143 print >>sys.stderr, 'fatal: cannot obtain manifest %s' % r.url 144 print >>sys.stderr, 'fatal: cannot obtain manifest %s' % r.url
144 sys.exit(1) 145 sys.exit(1)
145 146
147 if not is_new:
148 # Force the manifest to load if it exists, the old graph
149 # may be needed inside of _ReloadManifest().
150 #
151 self.manifest.projects
152
146 syncbuf = SyncBuffer(m.config) 153 syncbuf = SyncBuffer(m.config)
147 m.Sync_LocalHalf(syncbuf) 154 m.Sync_LocalHalf(syncbuf)
148 syncbuf.Finish() 155 syncbuf.Finish()
156 _ReloadManifest(self)
157 self._ApplyOptions(opt, is_new)
149 158
150 if not self.manifest.InitBranch(): 159 if not self.manifest.InitBranch():
151 print >>sys.stderr, 'fatal: cannot create branch in manifest' 160 print >>sys.stderr, 'fatal: cannot create branch in manifest'
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 1537c9a2..5fc834d0 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -215,8 +215,9 @@ uncommitted changes are present' % project.relpath
215 mp.Sync_LocalHalf(syncbuf) 215 mp.Sync_LocalHalf(syncbuf)
216 if not syncbuf.Finish(): 216 if not syncbuf.Finish():
217 sys.exit(1) 217 sys.exit(1)
218 _ReloadManifest(self)
219 mp = self.manifest.manifestProject
218 220
219 self.GetManifest(reparse=True)
220 all = self.GetProjects(args, missing_ok=True) 221 all = self.GetProjects(args, missing_ok=True)
221 missing = [] 222 missing = []
222 for project in all: 223 for project in all:
@@ -243,6 +244,13 @@ uncommitted changes are present' % project.relpath
243 if not syncbuf.Finish(): 244 if not syncbuf.Finish():
244 sys.exit(1) 245 sys.exit(1)
245 246
247def _ReloadManifest(cmd):
248 old = cmd.manifest
249 new = cmd.GetManifest(reparse=True)
250
251 if old.__class__ != new.__class__:
252 print >>sys.stderr, 'NOTICE: manifest format has changed ***'
253 new.Upgrade_Local(old)
246 254
247def _PostRepoUpgrade(manifest): 255def _PostRepoUpgrade(manifest):
248 for project in manifest.projects.values(): 256 for project in manifest.projects.values():