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

Side by Side Diff: scm.py

Issue 555198: Always return a tuple from GIT.Capture (Closed)
Patch Set: Created 10 years, 10 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 | « no previous file | no next file » | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2006-2009 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 glob 7 import glob
8 import os 8 import os
9 import re 9 import re
10 import shutil 10 import shutil
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 Returns: 54 Returns:
55 The output sent to stdout as a string. 55 The output sent to stdout as a string.
56 """ 56 """
57 c = [GIT.COMMAND] 57 c = [GIT.COMMAND]
58 c.extend(args) 58 c.extend(args)
59 try: 59 try:
60 return gclient_utils.CheckCall(c, in_directory, print_error) 60 return gclient_utils.CheckCall(c, in_directory, print_error)
61 except gclient_utils.CheckCallError: 61 except gclient_utils.CheckCallError:
62 if error_ok: 62 if error_ok:
63 return '' 63 return ('', '')
64 raise 64 raise
65 65
66 @staticmethod 66 @staticmethod
67 def CaptureStatus(files, upstream_branch='origin'): 67 def CaptureStatus(files, upstream_branch='origin'):
68 """Returns git status. 68 """Returns git status.
69 69
70 @files can be a string (one file) or a list of files. 70 @files can be a string (one file) or a list of files.
71 71
72 Returns an array of (status, file) tuples.""" 72 Returns an array of (status, file) tuples."""
73 command = ["diff", "--name-status", "-r", "%s.." % upstream_branch] 73 command = ["diff", "--name-status", "-r", "%s.." % upstream_branch]
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 if not cur_dir_repo_root: 733 if not cur_dir_repo_root:
734 return None 734 return None
735 735
736 while True: 736 while True:
737 parent = os.path.dirname(directory) 737 parent = os.path.dirname(directory)
738 if (SVN.CaptureInfo(parent, print_error=False).get( 738 if (SVN.CaptureInfo(parent, print_error=False).get(
739 "Repository Root") != cur_dir_repo_root): 739 "Repository Root") != cur_dir_repo_root):
740 break 740 break
741 directory = parent 741 directory = parent
742 return GetCasedPath(directory) 742 return GetCasedPath(directory)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698