summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2010-10-29 12:05:43 -0700
committerShawn O. Pearce <sop@google.com>2010-10-29 12:08:57 -0700
commit16614f86b3cc8d61ccae7197624fa93fc752767b (patch)
tree218818ddc0e9521a85aa804477e59fff6f28364e /project.py
parent88443387b1b0508f43b57e104821c6b375806fea (diff)
downloadgit-repo-16614f86b3cc8d61ccae7197624fa93fc752767b.tar.gz
sync --quiet: be more quiet
Change-Id: I5e8363c7b32e4546d1236cfc5a32e01c3e5ea8e6 Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/project.py b/project.py
index 8ffed842..ce85b863 100644
--- a/project.py
+++ b/project.py
@@ -618,18 +618,19 @@ class Project(object):
618 618
619## Sync ## 619## Sync ##
620 620
621 def Sync_NetworkHalf(self): 621 def Sync_NetworkHalf(self, quiet=False):
622 """Perform only the network IO portion of the sync process. 622 """Perform only the network IO portion of the sync process.
623 Local working directory/branch state is not affected. 623 Local working directory/branch state is not affected.
624 """ 624 """
625 is_new = not self.Exists 625 is_new = not self.Exists
626 if is_new: 626 if is_new:
627 print >>sys.stderr 627 if not quiet:
628 print >>sys.stderr, 'Initializing project %s ...' % self.name 628 print >>sys.stderr
629 print >>sys.stderr, 'Initializing project %s ...' % self.name
629 self._InitGitDir() 630 self._InitGitDir()
630 631
631 self._InitRemote() 632 self._InitRemote()
632 if not self._RemoteFetch(initial = is_new): 633 if not self._RemoteFetch(initial=is_new, quiet=quiet):
633 return False 634 return False
634 635
635 #Check that the requested ref was found after fetch 636 #Check that the requested ref was found after fetch
@@ -642,7 +643,7 @@ class Project(object):
642 # 643 #
643 rev = self.revisionExpr 644 rev = self.revisionExpr
644 if rev.startswith(R_TAGS): 645 if rev.startswith(R_TAGS):
645 self._RemoteFetch(None, rev[len(R_TAGS):]) 646 self._RemoteFetch(None, rev[len(R_TAGS):], quiet=quiet)
646 647
647 if self.worktree: 648 if self.worktree:
648 self._InitMRef() 649 self._InitMRef()
@@ -1025,7 +1026,9 @@ class Project(object):
1025 1026
1026## Direct Git Commands ## 1027## Direct Git Commands ##
1027 1028
1028 def _RemoteFetch(self, name=None, tag=None, initial=False): 1029 def _RemoteFetch(self, name=None, tag=None,
1030 initial=False,
1031 quiet=False):
1029 if not name: 1032 if not name:
1030 name = self.remote.name 1033 name = self.remote.name
1031 1034
@@ -1088,6 +1091,8 @@ class Project(object):
1088 ref_dir = None 1091 ref_dir = None
1089 1092
1090 cmd = ['fetch'] 1093 cmd = ['fetch']
1094 if quiet:
1095 cmd.append('--quiet')
1091 if not self.worktree: 1096 if not self.worktree:
1092 cmd.append('--update-head-ok') 1097 cmd.append('--update-head-ok')
1093 cmd.append(name) 1098 cmd.append(name)