diff options
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index a3d06922..c5955a38 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -131,6 +131,9 @@ later is required to fix a server side protocol bug. | |||
131 | p.add_option('-d','--detach', | 131 | p.add_option('-d','--detach', |
132 | dest='detach_head', action='store_true', | 132 | dest='detach_head', action='store_true', |
133 | help='detach projects back to manifest revision') | 133 | help='detach projects back to manifest revision') |
134 | p.add_option('-c','--current-branch', | ||
135 | dest='current_branch_only', action='store_true', | ||
136 | help='fetch only current branch from server') | ||
134 | p.add_option('-q','--quiet', | 137 | p.add_option('-q','--quiet', |
135 | dest='quiet', action='store_true', | 138 | dest='quiet', action='store_true', |
136 | help='be more quiet') | 139 | help='be more quiet') |
@@ -179,7 +182,8 @@ later is required to fix a server side protocol bug. | |||
179 | # - We always make sure we unlock the lock if we locked it. | 182 | # - We always make sure we unlock the lock if we locked it. |
180 | try: | 183 | try: |
181 | try: | 184 | try: |
182 | success = project.Sync_NetworkHalf(quiet=opt.quiet) | 185 | success = project.Sync_NetworkHalf(quiet=opt.quiet, |
186 | current_branch_only=opt.current_branch_only) | ||
183 | 187 | ||
184 | # Lock around all the rest of the code, since printing, updating a set | 188 | # Lock around all the rest of the code, since printing, updating a set |
185 | # and Progress.update() are not thread safe. | 189 | # and Progress.update() are not thread safe. |
@@ -212,7 +216,8 @@ later is required to fix a server side protocol bug. | |||
212 | if self.jobs == 1: | 216 | if self.jobs == 1: |
213 | for project in projects: | 217 | for project in projects: |
214 | pm.update() | 218 | pm.update() |
215 | if project.Sync_NetworkHalf(quiet=opt.quiet): | 219 | if project.Sync_NetworkHalf(quiet=opt.quiet, |
220 | current_branch_only=opt.current_branch_only): | ||
216 | fetched.add(project.gitdir) | 221 | fetched.add(project.gitdir) |
217 | else: | 222 | else: |
218 | print >>sys.stderr, 'error: Cannot fetch %s' % project.name | 223 | print >>sys.stderr, 'error: Cannot fetch %s' % project.name |
@@ -388,7 +393,8 @@ uncommitted changes are present' % project.relpath | |||
388 | _PostRepoUpgrade(self.manifest) | 393 | _PostRepoUpgrade(self.manifest) |
389 | 394 | ||
390 | if not opt.local_only: | 395 | if not opt.local_only: |
391 | mp.Sync_NetworkHalf(quiet=opt.quiet) | 396 | mp.Sync_NetworkHalf(quiet=opt.quiet, |
397 | current_branch_only=opt.current_branch_only) | ||
392 | 398 | ||
393 | if mp.HasChanges: | 399 | if mp.HasChanges: |
394 | syncbuf = SyncBuffer(mp.config) | 400 | syncbuf = SyncBuffer(mp.config) |