From 0836c56149bcdd5aa3a7e4a6d7f04d350aac2c44 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Fri, 22 Jan 2010 01:10:06 +0000 Subject: [PATCH] Fix svn mv/cp/ren diff for real this time, for try jobs. TEST=send a try job with a file moved with modified content BUG=6825 Review URL: http://codereview.chromium.org/554013 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@36828 0039d316-1c4b-4281-b951-d872f2087c98 --- scm.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scm.py b/scm.py index 2ec5825c32..c47a00c246 100644 --- a/scm.py +++ b/scm.py @@ -611,10 +611,7 @@ class SVN(object): command = ["diff", "--config-dir", bogus_dir, filename] if revision: command.extend(['--revision', revision]) - data = SVN.Capture(command, None) - if data: - pass - elif SVN.IsMoved(filename): + if SVN.IsMoved(filename): if full_move: file_content = gclient_utils.FileRead(filename, 'rb') # Prepend '+' to every lines. @@ -629,12 +626,13 @@ class SVN(object): data += "@@ -0,0 +1,%d @@\n" % nb_lines data += ''.join(file_content) else: - # svn diff on a mv/cp'd file outputs nothing. - # We put in an empty Index entry so upload.py knows about them. - data = "Index: %s\n" % filename + # svn diff on a mv/cp'd file outputs nothing if there was no change. + data = SVN.Capture(command, None) + if not data: + # We put in an empty Index entry so upload.py knows about them. + data = "Index: %s\n" % filename else: - # The file is not modified anymore. It should be removed from the set. - pass + data = SVN.Capture(command, None) finally: shutil.rmtree(bogus_dir) return data