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

Side by Side Diff: trunk/tools/depot_tools/scm.py

Issue 13877013: Revert 194740 "Explicitly pass "--diff-cmd diff" to "svn diff", ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« 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) 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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 SVN.CaptureLocalInfo([filename], cwd), 796 SVN.CaptureLocalInfo([filename], cwd),
797 bogus_dir, 797 bogus_dir,
798 full_move, 798 full_move,
799 revision) 799 revision)
800 finally: 800 finally:
801 gclient_utils.RemoveDirectory(bogus_dir) 801 gclient_utils.RemoveDirectory(bogus_dir)
802 802
803 @staticmethod 803 @staticmethod
804 def _DiffItemInternal(filename, cwd, info, bogus_dir, full_move, revision): 804 def _DiffItemInternal(filename, cwd, info, bogus_dir, full_move, revision):
805 """Grabs the diff data.""" 805 """Grabs the diff data."""
806 command = ["diff", "--diff-cmd", "diff", "--config-dir", bogus_dir, 806 command = ["diff", "--config-dir", bogus_dir, filename]
807 filename]
808 if revision: 807 if revision:
809 command.extend(['--revision', revision]) 808 command.extend(['--revision', revision])
810 data = None 809 data = None
811 if SVN.IsMovedInfo(info): 810 if SVN.IsMovedInfo(info):
812 if full_move: 811 if full_move:
813 if info.get("Node Kind") == "directory": 812 if info.get("Node Kind") == "directory":
814 # Things become tricky here. It's a directory copy/move. We need to 813 # Things become tricky here. It's a directory copy/move. We need to
815 # diff all the files inside it. 814 # diff all the files inside it.
816 # This will put a lot of pressure on the heap. This is why StringIO 815 # This will put a lot of pressure on the heap. This is why StringIO
817 # is used and converted back into a string at the end. The reason to 816 # is used and converted back into a string at the end. The reason to
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 src = srcurl[len(file_root)+1:] 908 src = srcurl[len(file_root)+1:]
910 try: 909 try:
911 srcinfo = SVN.CaptureRemoteInfo(srcurl) 910 srcinfo = SVN.CaptureRemoteInfo(srcurl)
912 except subprocess2.CalledProcessError, e: 911 except subprocess2.CalledProcessError, e:
913 if not 'Not a valid URL' in e.stderr: 912 if not 'Not a valid URL' in e.stderr:
914 raise 913 raise
915 # Assume the file was deleted. No idea how to figure out at which 914 # Assume the file was deleted. No idea how to figure out at which
916 # revision the file was deleted. 915 # revision the file was deleted.
917 srcinfo = {'Revision': rev} 916 srcinfo = {'Revision': rev}
918 if (srcinfo.get('Revision') != rev and 917 if (srcinfo.get('Revision') != rev and
919 SVN.Capture(['diff', '--diff-cmd', 'diff', '-r', 918 SVN.Capture(['diff', '-r', '%d:head' % rev, srcurl], cwd)):
920 '%d:head' % rev, srcurl], cwd)):
921 metaheaders.append("#$ svn cp -r %d %s %s " 919 metaheaders.append("#$ svn cp -r %d %s %s "
922 "### WARNING: note non-trunk copy\n" % 920 "### WARNING: note non-trunk copy\n" %
923 (rev, src, filename)) 921 (rev, src, filename))
924 else: 922 else:
925 metaheaders.append("#$ cp %s %s\n" % (src, 923 metaheaders.append("#$ cp %s %s\n" % (src,
926 filename)) 924 filename))
927 925
928 if metaheaders: 926 if metaheaders:
929 diffs.append("### BEGIN SVN COPY METADATA\n") 927 diffs.append("### BEGIN SVN COPY METADATA\n")
930 diffs.extend(metaheaders) 928 diffs.extend(metaheaders)
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 # revert, like for properties. 1096 # revert, like for properties.
1099 if not os.path.isdir(cwd): 1097 if not os.path.isdir(cwd):
1100 # '.' was deleted. It's not worth continuing. 1098 # '.' was deleted. It's not worth continuing.
1101 return 1099 return
1102 try: 1100 try:
1103 SVN.Capture(['revert', file_status[1]], cwd=cwd) 1101 SVN.Capture(['revert', file_status[1]], cwd=cwd)
1104 except subprocess2.CalledProcessError: 1102 except subprocess2.CalledProcessError:
1105 if not os.path.exists(file_path): 1103 if not os.path.exists(file_path):
1106 continue 1104 continue
1107 raise 1105 raise
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