diff options
author | Anatol Pomazau <anatol@google.com> | 2012-04-20 14:41:59 -0700 |
---|---|---|
committer | Anatol Pomazau <anatol@google.com> | 2012-04-23 14:10:52 -0700 |
commit | 79770d269e319dee578beed682669703d4c764ba (patch) | |
tree | 23e733be2bf80454de9352225366b92ef5cc9139 /project.py | |
parent | c39864f5e12fa4a6d3f2cdb4921afc021406d106 (diff) | |
download | git-repo-79770d269e319dee578beed682669703d4c764ba.tar.gz |
Add sync-c option to manifest
There are use-cases when fetching all branch is impractical and
we really need to fetch only one branch/tag.
e.g. there is a large project with binaries and every update of a
binary file is put to a separate branch.
The whole project history might be too large to allow users fetch it.
Add 'sync-c' option to 'project' and 'default' tags to make it possible
to configure 'sync-c' behavior at per-project and per-manifest level.
Note that currently there is no possibility to revert boolean flag from
command line. If 'sync-c' is set in manifest then you cannot make
full fetch by providing a repo tool argument.
Change-Id: Ie36fe5737304930493740370239403986590f593
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -510,7 +510,8 @@ class Project(object): | |||
510 | revisionExpr, | 510 | revisionExpr, |
511 | revisionId, | 511 | revisionId, |
512 | rebase = True, | 512 | rebase = True, |
513 | groups = None): | 513 | groups = None, |
514 | sync_c = False): | ||
514 | self.manifest = manifest | 515 | self.manifest = manifest |
515 | self.name = name | 516 | self.name = name |
516 | self.remote = remote | 517 | self.remote = remote |
@@ -531,6 +532,7 @@ class Project(object): | |||
531 | 532 | ||
532 | self.rebase = rebase | 533 | self.rebase = rebase |
533 | self.groups = groups | 534 | self.groups = groups |
535 | self.sync_c = sync_c | ||
534 | 536 | ||
535 | self.snapshots = {} | 537 | self.snapshots = {} |
536 | self.copyfiles = [] | 538 | self.copyfiles = [] |
@@ -964,6 +966,7 @@ class Project(object): | |||
964 | and self._ApplyCloneBundle(initial=is_new, quiet=quiet): | 966 | and self._ApplyCloneBundle(initial=is_new, quiet=quiet): |
965 | is_new = False | 967 | is_new = False |
966 | 968 | ||
969 | current_branch_only = current_branch_only or self.sync_c or self.manifest.default.sync_c | ||
967 | if not self._RemoteFetch(initial=is_new, quiet=quiet, alt_dir=alt_dir, | 970 | if not self._RemoteFetch(initial=is_new, quiet=quiet, alt_dir=alt_dir, |
968 | current_branch_only=current_branch_only): | 971 | current_branch_only=current_branch_only): |
969 | return False | 972 | return False |