diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/start.py | 3 | ||||
| -rw-r--r-- | subcmds/sync.py | 11 | ||||
| -rw-r--r-- | subcmds/upload.py | 10 |
3 files changed, 14 insertions, 10 deletions
diff --git a/subcmds/start.py b/subcmds/start.py index d1430a9d..290b6897 100644 --- a/subcmds/start.py +++ b/subcmds/start.py | |||
| @@ -54,8 +54,7 @@ revision specified in the manifest. | |||
| 54 | if not opt.all: | 54 | if not opt.all: |
| 55 | projects = args[1:] | 55 | projects = args[1:] |
| 56 | if len(projects) < 1: | 56 | if len(projects) < 1: |
| 57 | print("error: at least one project must be specified", file=sys.stderr) | 57 | projects = ['.',] # start it in the local project by default |
| 58 | sys.exit(1) | ||
| 59 | 58 | ||
| 60 | all_projects = self.GetProjects(projects, | 59 | all_projects = self.GetProjects(projects, |
| 61 | missing_ok=bool(self.gitc_manifest)) | 60 | missing_ok=bool(self.gitc_manifest)) |
diff --git a/subcmds/sync.py b/subcmds/sync.py index 9124a653..ecf2ffc0 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -397,9 +397,12 @@ later is required to fix a server side protocol bug. | |||
| 397 | return fetched | 397 | return fetched |
| 398 | 398 | ||
| 399 | def _GCProjects(self, projects): | 399 | def _GCProjects(self, projects): |
| 400 | gitdirs = {} | 400 | gc_gitdirs = {} |
| 401 | for project in projects: | 401 | for project in projects: |
| 402 | gitdirs[project.gitdir] = project.bare_git | 402 | if len(project.manifest.GetProjectsWithName(project.name)) > 1: |
| 403 | print('Shared project %s found, disabling pruning.' % project.name) | ||
| 404 | project.bare_git.config('--replace-all', 'gc.pruneExpire', 'never') | ||
| 405 | gc_gitdirs[project.gitdir] = project.bare_git | ||
| 403 | 406 | ||
| 404 | has_dash_c = git_require((1, 7, 2)) | 407 | has_dash_c = git_require((1, 7, 2)) |
| 405 | if multiprocessing and has_dash_c: | 408 | if multiprocessing and has_dash_c: |
| @@ -409,7 +412,7 @@ later is required to fix a server side protocol bug. | |||
| 409 | jobs = min(self.jobs, cpu_count) | 412 | jobs = min(self.jobs, cpu_count) |
| 410 | 413 | ||
| 411 | if jobs < 2: | 414 | if jobs < 2: |
| 412 | for bare_git in gitdirs.values(): | 415 | for bare_git in gc_gitdirs.values(): |
| 413 | bare_git.gc('--auto') | 416 | bare_git.gc('--auto') |
| 414 | return | 417 | return |
| 415 | 418 | ||
| @@ -431,7 +434,7 @@ later is required to fix a server side protocol bug. | |||
| 431 | finally: | 434 | finally: |
| 432 | sem.release() | 435 | sem.release() |
| 433 | 436 | ||
| 434 | for bare_git in gitdirs.values(): | 437 | for bare_git in gc_gitdirs.values(): |
| 435 | if err_event.isSet(): | 438 | if err_event.isSet(): |
| 436 | break | 439 | break |
| 437 | sem.acquire() | 440 | sem.acquire() |
diff --git a/subcmds/upload.py b/subcmds/upload.py index 4b05f1e8..1172dadc 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
| @@ -454,7 +454,11 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
| 454 | if avail: | 454 | if avail: |
| 455 | pending.append((project, avail)) | 455 | pending.append((project, avail)) |
| 456 | 456 | ||
| 457 | if pending and (not opt.bypass_hooks): | 457 | if not pending: |
| 458 | print("no branches ready for upload", file=sys.stderr) | ||
| 459 | return | ||
| 460 | |||
| 461 | if not opt.bypass_hooks: | ||
| 458 | hook = RepoHook('pre-upload', self.manifest.repo_hooks_project, | 462 | hook = RepoHook('pre-upload', self.manifest.repo_hooks_project, |
| 459 | self.manifest.topdir, | 463 | self.manifest.topdir, |
| 460 | self.manifest.manifestProject.GetRemote('origin').url, | 464 | self.manifest.manifestProject.GetRemote('origin').url, |
| @@ -474,9 +478,7 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
| 474 | cc = _SplitEmails(opt.cc) | 478 | cc = _SplitEmails(opt.cc) |
| 475 | people = (reviewers, cc) | 479 | people = (reviewers, cc) |
| 476 | 480 | ||
| 477 | if not pending: | 481 | if len(pending) == 1 and len(pending[0][1]) == 1: |
| 478 | print("no branches ready for upload", file=sys.stderr) | ||
| 479 | elif len(pending) == 1 and len(pending[0][1]) == 1: | ||
| 480 | self._SingleBranch(opt, pending[0][1][0], people) | 482 | self._SingleBranch(opt, pending[0][1][0], people) |
| 481 | else: | 483 | else: |
| 482 | self._MultipleBranches(opt, pending, people) | 484 | self._MultipleBranches(opt, pending, people) |
