diff options
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index d6ea442a..7b77388b 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -185,6 +185,8 @@ later is required to fix a server side protocol bug. | |||
185 | t.join() | 185 | t.join() |
186 | 186 | ||
187 | pm.end() | 187 | pm.end() |
188 | for project in projects: | ||
189 | project.bare_git.gc('--auto') | ||
188 | return fetched | 190 | return fetched |
189 | 191 | ||
190 | def UpdateProjectList(self): | 192 | def UpdateProjectList(self): |
@@ -334,7 +336,14 @@ uncommitted changes are present' % project.relpath | |||
334 | # bail out now; the rest touches the working tree | 336 | # bail out now; the rest touches the working tree |
335 | return | 337 | return |
336 | 338 | ||
337 | self.manifest._Unload() | 339 | if mp.HasChanges: |
340 | syncbuf = SyncBuffer(mp.config) | ||
341 | mp.Sync_LocalHalf(syncbuf) | ||
342 | if not syncbuf.Finish(): | ||
343 | sys.exit(1) | ||
344 | _ReloadManifest(self) | ||
345 | mp = self.manifest.manifestProject | ||
346 | |||
338 | all = self.GetProjects(args, missing_ok=True) | 347 | all = self.GetProjects(args, missing_ok=True) |
339 | missing = [] | 348 | missing = [] |
340 | for project in all: | 349 | for project in all: |
@@ -361,10 +370,16 @@ uncommitted changes are present' % project.relpath | |||
361 | if not syncbuf.Finish(): | 370 | if not syncbuf.Finish(): |
362 | sys.exit(1) | 371 | sys.exit(1) |
363 | 372 | ||
364 | # If there's a notice that's supposed to print at the end of the sync, print | 373 | def _ReloadManifest(cmd): |
365 | # it now... | 374 | old = cmd.manifest |
366 | if self.manifest.notice: | 375 | new = cmd.GetManifest(reparse=True) |
367 | print self.manifest.notice | 376 | |
377 | if old.__class__ != new.__class__: | ||
378 | print >>sys.stderr, 'NOTICE: manifest format has changed ***' | ||
379 | new.Upgrade_Local(old) | ||
380 | else: | ||
381 | if new.notice: | ||
382 | print new.notice | ||
368 | 383 | ||
369 | def _PostRepoUpgrade(manifest): | 384 | def _PostRepoUpgrade(manifest): |
370 | for project in manifest.projects.values(): | 385 | for project in manifest.projects.values(): |