summaryrefslogtreecommitdiffstats
path: root/subcmds/init.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/init.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/init.py')
-rw-r--r--subcmds/init.py9
1 files changed, 9 insertions, 0 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'