From 96fdcef9e3087d71266d5c78e4a9716e3afa6d41 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Fri, 10 Apr 2009 16:29:20 -0700 Subject: [PATCH] Add 'repo sync -n' to only do the network transfer This makes it easier to update all repositories, without actually impacting the working directory, or learning about how to use `repo forall -c 'git fetch $REPO_REMOTE' `. Signed-off-by: Shawn O. Pearce --- subcmds/sync.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subcmds/sync.py b/subcmds/sync.py index d3f6adc1..01e2eba6 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -47,6 +47,9 @@ the manifest. """ def _Options(self, p): + p.add_option('-n','--network-only', + dest='network_only', action='store_true', + help="fetch only, don't update working tree") p.add_option('--no-repo-verify', dest='no_repo_verify', action='store_true', help='do not verify repo source code') @@ -90,6 +93,10 @@ the manifest. else: print >>sys.stderr, 'warning: Skipped upgrade to unverified version' + if opt.network_only: + # bail out now; the rest touches the working tree + return + if mp.HasChanges: if not mp.Sync_LocalHalf(): sys.exit(1)