Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: gclient_scm.py

Issue 3174020: Add stdout param to SubprocessCallAndFilter(). (Closed)
Patch Set: fix unit test Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gclient.py ('k') | gclient_utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Gclient-specific SCM-specific operations.""" 5 """Gclient-specific SCM-specific operations."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import posixpath 9 import posixpath
10 import re 10 import re
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 """Generates a patch file which can be applied to the root of the 147 """Generates a patch file which can be applied to the root of the
148 repository. 148 repository.
149 149
150 The patch file is generated from a diff of the merge base of HEAD and 150 The patch file is generated from a diff of the merge base of HEAD and
151 its upstream branch. 151 its upstream branch.
152 """ 152 """
153 path = os.path.join(self._root_dir, self.relpath) 153 path = os.path.join(self._root_dir, self.relpath)
154 merge_base = self._Run(['merge-base', 'HEAD', 'origin']) 154 merge_base = self._Run(['merge-base', 'HEAD', 'origin'])
155 command = ['diff', merge_base] 155 command = ['diff', merge_base]
156 filterer = DiffFilterer(self.relpath) 156 filterer = DiffFilterer(self.relpath)
157 scm.GIT.RunAndFilterOutput(command, path, False, False, filterer.Filter) 157 scm.GIT.RunAndFilterOutput(command, path, False, False, filterer.Filter,
158 stdout=options.stdout)
158 159
159 def update(self, options, args, file_list): 160 def update(self, options, args, file_list):
160 """Runs git to update or transparently checkout the working copy. 161 """Runs git to update or transparently checkout the working copy.
161 162
162 All updated files will be appended to file_list. 163 All updated files will be appended to file_list.
163 164
164 Raises: 165 Raises:
165 Error: if can't get URL for relative path. 166 Error: if can't get URL for relative path.
166 """ 167 """
167 168
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 def pack(self, options, args, file_list): 700 def pack(self, options, args, file_list):
700 """Generates a patch file which can be applied to the root of the 701 """Generates a patch file which can be applied to the root of the
701 repository.""" 702 repository."""
702 path = os.path.join(self._root_dir, self.relpath) 703 path = os.path.join(self._root_dir, self.relpath)
703 if not os.path.isdir(path): 704 if not os.path.isdir(path):
704 raise gclient_utils.Error('Directory %s is not present.' % path) 705 raise gclient_utils.Error('Directory %s is not present.' % path)
705 command = ['diff', '-x', '--ignore-eol-style'] 706 command = ['diff', '-x', '--ignore-eol-style']
706 command.extend(args) 707 command.extend(args)
707 708
708 filterer = DiffFilterer(self.relpath) 709 filterer = DiffFilterer(self.relpath)
709 scm.SVN.RunAndFilterOutput(command, path, False, False, filterer.Filter) 710 scm.SVN.RunAndFilterOutput(command, path, False, False, filterer.Filter,
711 stdout=options.stdout)
710 712
711 def update(self, options, args, file_list): 713 def update(self, options, args, file_list):
712 """Runs svn to update or transparently checkout the working copy. 714 """Runs svn to update or transparently checkout the working copy.
713 715
714 All updated files will be appended to file_list. 716 All updated files will be appended to file_list.
715 717
716 Raises: 718 Raises:
717 Error: if can't get URL for relative path. 719 Error: if can't get URL for relative path.
718 """ 720 """
719 # Only update if git is not controlling the directory. 721 # Only update if git is not controlling the directory.
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 963
962 This method returns a new list to be used as a command.""" 964 This method returns a new list to be used as a command."""
963 new_command = command[:] 965 new_command = command[:]
964 if revision: 966 if revision:
965 new_command.extend(['--revision', str(revision).strip()]) 967 new_command.extend(['--revision', str(revision).strip()])
966 # --force was added to 'svn update' in svn 1.5. 968 # --force was added to 'svn update' in svn 1.5.
967 if ((options.force or options.manually_grab_svn_rev) and 969 if ((options.force or options.manually_grab_svn_rev) and
968 scm.SVN.AssertVersion("1.5")[0]): 970 scm.SVN.AssertVersion("1.5")[0]):
969 new_command.append('--force') 971 new_command.append('--force')
970 return new_command 972 return new_command
OLDNEW
« no previous file with comments | « gclient.py ('k') | gclient_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698