summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-07-03 16:37:30 -0700
committerShawn O. Pearce <sop@google.com>2009-07-03 20:50:52 -0700
commit87bda12e85ffb98778d7ac881edb0210b74c0491 (patch)
treeccdbd92a16ccb4fe9409ee5b864c0e02412e942a /subcmds/sync.py
parent5f947bba69de81f58f1adef10225c04727fa0ed5 (diff)
downloadgit-repo-87bda12e85ffb98778d7ac881edb0210b74c0491.tar.gz
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 <sop@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py10
1 files changed, 9 insertions, 1 deletions
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():