diff --git a/subcmds/sync.py b/subcmds/sync.py index bd07dd9..ceb81ea 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: