summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-10 16:29:20 -0700
committerShawn O. Pearce <sop@google.com>2009-04-10 17:07:52 -0700
commit96fdcef9e3087d71266d5c78e4a9716e3afa6d41 (patch)
tree2c98825daced9c0ab44f7be11048c438094684eb /subcmds/sync.py
parent2a1ccb2b0ca6a975614b96271fccd82a58394157 (diff)
downloadgit-repo-96fdcef9e3087d71266d5c78e4a9716e3afa6d41.tar.gz
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>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py7
1 files changed, 7 insertions, 0 deletions
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.
47""" 47"""
48 48
49 def _Options(self, p): 49 def _Options(self, p):
50 p.add_option('-n','--network-only',
51 dest='network_only', action='store_true',
52 help="fetch only, don't update working tree")
50 p.add_option('--no-repo-verify', 53 p.add_option('--no-repo-verify',
51 dest='no_repo_verify', action='store_true', 54 dest='no_repo_verify', action='store_true',
52 help='do not verify repo source code') 55 help='do not verify repo source code')
@@ -90,6 +93,10 @@ the manifest.
90 else: 93 else:
91 print >>sys.stderr, 'warning: Skipped upgrade to unverified version' 94 print >>sys.stderr, 'warning: Skipped upgrade to unverified version'
92 95
96 if opt.network_only:
97 # bail out now; the rest touches the working tree
98 return
99
93 if mp.HasChanges: 100 if mp.HasChanges:
94 if not mp.Sync_LocalHalf(): 101 if not mp.Sync_LocalHalf():
95 sys.exit(1) 102 sys.exit(1)