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

Side by Side Diff: scm.py

Issue 14104005: Fix 236148: Avoid triggering a pager in internal git commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fixed some tests and other calls too. Created 7 years, 7 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 | « git_cl.py ('k') | tests/git_cl_test.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) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """SCM-specific utility classes.""" 5 """SCM-specific utility classes."""
6 6
7 import cStringIO 7 import cStringIO
8 import glob 8 import glob
9 import logging 9 import logging
10 import os 10 import os
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 else: 92 else:
93 return 0 93 return 0
94 94
95 95
96 class GIT(object): 96 class GIT(object):
97 current_version = None 97 current_version = None
98 98
99 @staticmethod 99 @staticmethod
100 def Capture(args, cwd, **kwargs): 100 def Capture(args, cwd, **kwargs):
101 return subprocess2.check_output( 101 return subprocess2.check_output(
102 ['git'] + args, cwd=cwd, stderr=subprocess2.PIPE, **kwargs) 102 ['git', '--no-pager'] + args,
103 cwd=cwd, stderr=subprocess2.PIPE, **kwargs)
103 104
104 @staticmethod 105 @staticmethod
105 def CaptureStatus(files, cwd, upstream_branch): 106 def CaptureStatus(files, cwd, upstream_branch):
106 """Returns git status. 107 """Returns git status.
107 108
108 @files can be a string (one file) or a list of files. 109 @files can be a string (one file) or a list of files.
109 110
110 Returns an array of (status, file) tuples.""" 111 Returns an array of (status, file) tuples."""
111 if upstream_branch is None: 112 if upstream_branch is None:
112 upstream_branch = GIT.GetUpstreamBranch(cwd) 113 upstream_branch = GIT.GetUpstreamBranch(cwd)
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 # revert, like for properties. 1087 # revert, like for properties.
1087 if not os.path.isdir(cwd): 1088 if not os.path.isdir(cwd):
1088 # '.' was deleted. It's not worth continuing. 1089 # '.' was deleted. It's not worth continuing.
1089 return 1090 return
1090 try: 1091 try:
1091 SVN.Capture(['revert', file_status[1]], cwd=cwd) 1092 SVN.Capture(['revert', file_status[1]], cwd=cwd)
1092 except subprocess2.CalledProcessError: 1093 except subprocess2.CalledProcessError:
1093 if not os.path.exists(file_path): 1094 if not os.path.exists(file_path):
1094 continue 1095 continue
1095 raise 1096 raise
OLDNEW
« no previous file with comments | « git_cl.py ('k') | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698