From 87bda12e85ffb98778d7ac881edb0210b74c0491 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 3 Jul 2009 16:37:30 -0700 Subject: sync: Support upgrading manifest formats If the manifest format changes during init or sync we need to do a full reparse of the manifest, and possibly allow the new object to reconfigure the local workspace to match its expectations. Signed-off-by: Shawn O. Pearce --- subcmds/init.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'subcmds/init.py') 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 from project import SyncBuffer from git_command import git_require, MIN_GIT_VERSION from manifest_xml import XmlManifest +from subcmds.sync import _ReloadManifest class Init(InteractiveCommand, MirrorSafeCommand): common = True @@ -143,9 +144,17 @@ to update the working directory files. print >>sys.stderr, 'fatal: cannot obtain manifest %s' % r.url sys.exit(1) + if not is_new: + # Force the manifest to load if it exists, the old graph + # may be needed inside of _ReloadManifest(). + # + self.manifest.projects + syncbuf = SyncBuffer(m.config) m.Sync_LocalHalf(syncbuf) syncbuf.Finish() + _ReloadManifest(self) + self._ApplyOptions(opt, is_new) if not self.manifest.InitBranch(): print >>sys.stderr, 'fatal: cannot create branch in manifest' -- cgit v1.2.3-54-g00ecf