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 <sop@google.com>
diff --git a/subcmds/sync.py b/subcmds/sync.py
index d3f6adc..01e2eba 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -47,6 +47,9 @@
"""
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 @@
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)