diff options
Diffstat (limited to 'subcmds/sync.py')
| -rw-r--r-- | subcmds/sync.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index ceb81eaa..d89c2b8c 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -117,6 +117,8 @@ later is required to fix a server side protocol bug. | |||
| 117 | print >>sys.stderr, 'error: Cannot fetch %s' % project.name | 117 | print >>sys.stderr, 'error: Cannot fetch %s' % project.name |
| 118 | sys.exit(1) | 118 | sys.exit(1) |
| 119 | pm.end() | 119 | pm.end() |
| 120 | for project in projects: | ||
| 121 | project.bare_git.gc('--auto') | ||
| 120 | return fetched | 122 | return fetched |
| 121 | 123 | ||
| 122 | def UpdateProjectList(self): | 124 | def UpdateProjectList(self): |
| @@ -215,7 +217,14 @@ uncommitted changes are present' % project.relpath | |||
| 215 | # bail out now; the rest touches the working tree | 217 | # bail out now; the rest touches the working tree |
| 216 | return | 218 | return |
| 217 | 219 | ||
| 218 | self.manifest._Unload() | 220 | if mp.HasChanges: |
| 221 | syncbuf = SyncBuffer(mp.config) | ||
| 222 | mp.Sync_LocalHalf(syncbuf) | ||
| 223 | if not syncbuf.Finish(): | ||
| 224 | sys.exit(1) | ||
| 225 | _ReloadManifest(self) | ||
| 226 | mp = self.manifest.manifestProject | ||
| 227 | |||
| 219 | all = self.GetProjects(args, missing_ok=True) | 228 | all = self.GetProjects(args, missing_ok=True) |
| 220 | missing = [] | 229 | missing = [] |
| 221 | for project in all: | 230 | for project in all: |
| @@ -242,6 +251,14 @@ uncommitted changes are present' % project.relpath | |||
| 242 | if not syncbuf.Finish(): | 251 | if not syncbuf.Finish(): |
| 243 | sys.exit(1) | 252 | sys.exit(1) |
| 244 | 253 | ||
| 254 | def _ReloadManifest(cmd): | ||
| 255 | old = cmd.manifest | ||
| 256 | new = cmd.GetManifest(reparse=True) | ||
| 257 | |||
| 258 | if old.__class__ != new.__class__: | ||
| 259 | print >>sys.stderr, 'NOTICE: manifest format has changed ***' | ||
| 260 | new.Upgrade_Local(old) | ||
| 261 | |||
| 245 | def _PostRepoUpgrade(manifest): | 262 | def _PostRepoUpgrade(manifest): |
| 246 | for project in manifest.projects.values(): | 263 | for project in manifest.projects.values(): |
| 247 | if project.Exists: | 264 | if project.Exists: |
