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/sync.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'subcmds/sync.py') 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 mp.Sync_LocalHalf(syncbuf) if not syncbuf.Finish(): sys.exit(1) + _ReloadManifest(self) + mp = self.manifest.manifestProject - self.GetManifest(reparse=True) all = self.GetProjects(args, missing_ok=True) missing = [] for project in all: @@ -243,6 +244,13 @@ uncommitted changes are present' % project.relpath if not syncbuf.Finish(): sys.exit(1) +def _ReloadManifest(cmd): + old = cmd.manifest + new = cmd.GetManifest(reparse=True) + + if old.__class__ != new.__class__: + print >>sys.stderr, 'NOTICE: manifest format has changed ***' + new.Upgrade_Local(old) def _PostRepoUpgrade(manifest): for project in manifest.projects.values(): -- cgit v1.2.3-54-g00ecf