diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 17 |
1 files changed, 11 insertions, 6 deletions
| @@ -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) |
