diff --git a/project.py b/project.py index f05ce66a..ab28f2c3 100644 --- a/project.py +++ b/project.py @@ -1041,7 +1041,7 @@ class Project(object): verbose=False, output_redir=None, is_new=None, - current_branch_only=False, + current_branch_only=None, force_sync=False, clone_bundle=True, tags=True, @@ -1116,7 +1116,7 @@ class Project(object): and self._ApplyCloneBundle(initial=is_new, quiet=quiet, verbose=verbose)): is_new = False - if not current_branch_only: + if current_branch_only is None: if self.sync_c: current_branch_only = True elif not self.manifest._loaded: diff --git a/repo b/repo index b3f3673b..4068b127 100755 --- a/repo +++ b/repo @@ -324,6 +324,9 @@ def InitParser(parser, gitc_init=False): group.add_option(*cbr_opts, dest='current_branch_only', action='store_true', help='fetch only current manifest branch from server') + group.add_option('--no-current-branch', + dest='current_branch_only', action='store_false', + help='fetch all manifest branches from server') group.add_option('--no-tags', dest='tags', default=True, action='store_false', help="don't fetch tags in the manifest") diff --git a/subcmds/info.py b/subcmds/info.py index 8e017ed8..2be56109 100644 --- a/subcmds/info.py +++ b/subcmds/info.py @@ -39,6 +39,9 @@ class Info(PagedCommand): p.add_option('-c', '--current-branch', dest="current_branch", action="store_true", help="consider only checked out branches") + p.add_option('--no-current-branch', + dest='current_branch', action='store_false', + help='consider all local branches') # Turn this into a warning & remove this someday. p.add_option('-b', dest='current_branch', action='store_true', diff --git a/subcmds/overview.py b/subcmds/overview.py index 4f62f94f..202a5eba 100644 --- a/subcmds/overview.py +++ b/subcmds/overview.py @@ -37,6 +37,9 @@ are displayed. p.add_option('-c', '--current-branch', dest="current_branch", action="store_true", help="Consider only checked out branches") + p.add_option('--no-current-branch', + dest='current_branch', action='store_false', + help='consider all local branches') # Turn this into a warning & remove this someday. p.add_option('-b', dest='current_branch', action='store_true', diff --git a/subcmds/sync.py b/subcmds/sync.py index 9f8de9e5..f06c61c5 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -213,6 +213,9 @@ later is required to fix a server side protocol bug. p.add_option('-c', '--current-branch', dest='current_branch_only', action='store_true', help='fetch only current branch from server') + p.add_option('--no-current-branch', + dest='current_branch_only', action='store_false', + help='fetch all branches from server') p.add_option('-m', '--manifest-name', dest='manifest_name', help='temporary manifest to use for this sync', metavar='NAME.xml') diff --git a/subcmds/upload.py b/subcmds/upload.py index 57434b18..c497d877 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -174,6 +174,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/ p.add_option('-c', '--current-branch', dest='current_branch', action='store_true', help='Upload current git branch.') + p.add_option('--no-current-branch', + dest='current_branch', action='store_false', + help='Upload all git branches.') # Turn this into a warning & remove this someday. p.add_option('--cbr', dest='current_branch', action='store_true',