From 9bb1816bdc2c21811ea6a87ba6eb745bdf3c041c Mon Sep 17 00:00:00 2001 From: Nico Sallembien Date: Mon, 7 Dec 2009 15:38:01 -0800 Subject: Fixing project renaming bug. This bug happens when a project gets added to the manifest, and then is renamed. Users who happened to have run "repo sync" after the project was added but before the rename happened will try to read the data from the old project, as the manifest was only updated after all projects were updated successfully. --- subcmds/sync.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'subcmds/sync.py') diff --git a/subcmds/sync.py b/subcmds/sync.py index bd07dd9f..ceb81eaa 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -111,7 +111,6 @@ later is required to fix a server side protocol bug. pm = Progress('Fetching projects', len(projects)) for project in projects: pm.update() - if project.Sync_NetworkHalf(): fetched.add(project.gitdir) else: @@ -192,6 +191,15 @@ uncommitted changes are present' % project.relpath if opt.repo_upgraded: _PostRepoUpgrade(self.manifest) + if not opt.local_only: + mp.Sync_NetworkHalf() + + if mp.HasChanges: + syncbuf = SyncBuffer(mp.config) + mp.Sync_LocalHalf(syncbuf) + if not syncbuf.Finish(): + sys.exit(1) + self.manifest._Unload() all = self.GetProjects(args, missing_ok=True) if not opt.local_only: @@ -199,7 +207,6 @@ uncommitted changes are present' % project.relpath now = time.time() if (24 * 60 * 60) <= (now - rp.LastFetch): to_fetch.append(rp) - to_fetch.append(mp) to_fetch.extend(all) fetched = self._Fetch(to_fetch) @@ -208,12 +215,6 @@ uncommitted changes are present' % project.relpath # bail out now; the rest touches the working tree return - if mp.HasChanges: - syncbuf = SyncBuffer(mp.config) - mp.Sync_LocalHalf(syncbuf) - if not syncbuf.Finish(): - sys.exit(1) - self.manifest._Unload() all = self.GetProjects(args, missing_ok=True) missing = [] @@ -241,7 +242,6 @@ uncommitted changes are present' % project.relpath if not syncbuf.Finish(): sys.exit(1) - def _PostRepoUpgrade(manifest): for project in manifest.projects.values(): if project.Exists: -- cgit v1.2.3-54-g00ecf