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

Unified Diff: tests/patch_test.py

Issue 10962038: Fix applying git diff with new file mode 644 on a svn checkout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing_support/patches_data.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/patch_test.py
diff --git a/tests/patch_test.py b/tests/patch_test.py
index 6aa7cd17be65808b075bf697d8e75bb5caf09526..5a442d07fecc47096ee06ee6b436f60829b6ffa3 100755
--- a/tests/patch_test.py
+++ b/tests/patch_test.py
@@ -32,7 +32,6 @@ class PatchTest(unittest.TestCase):
patchlevel=0,
svn_properties=None,
nb_hunks=None):
- svn_properties = svn_properties or []
self.assertEquals(p.filename, filename)
self.assertEquals(p.source_filename, source_filename)
self.assertEquals(p.is_binary, is_binary)
@@ -51,6 +50,8 @@ class PatchTest(unittest.TestCase):
self.assertEquals(len(p.hunks), nb_hunks)
else:
self.assertEquals(None, nb_hunks)
+ if hasattr(p, 'svn_properties'):
+ self.assertEquals(p.svn_properties, svn_properties or [])
def testFilePatchDelete(self):
p = patch.FilePatchDelete('foo', False)
@@ -89,6 +90,14 @@ class PatchTest(unittest.TestCase):
p, 'git_cl/git-cl', GIT.MODE_EXE_JUNK, is_git_diff=True, patchlevel=1,
svn_properties=[('svn:executable', '*')], nb_hunks=0)
+ def testFilePatchDiffHeaderNotExecutable(self):
+ p = patch.FilePatchDiff(
+ 'build/android/ant/create.js', GIT.NEW_NOT_EXECUTABLE, [])
+ self._check_patch(
+ p, 'build/android/ant/create.js', GIT.NEW_NOT_EXECUTABLE,
+ is_git_diff=True, patchlevel=1, is_new=True,
+ nb_hunks=1)
+
def testFilePatchDiffSvnNew(self):
# The code path is different for git and svn.
p = patch.FilePatchDiff('foo', RAW.NEW, [])
« no previous file with comments | « testing_support/patches_data.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698