changeset 4007:3e8f48ccca86

Added some missing tests for copy+chmod, copy+chmod+modify on diff parser
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 17 Jun 2013 20:10:47 +0200
parents cdf10b3df899
children d8364b7e3451
files rhodecode/tests/fixtures/hg_diff_copy_and_chmod_file.diff rhodecode/tests/fixtures/hg_diff_copy_and_modify_file.diff rhodecode/tests/fixtures/hg_diff_copy_chmod_and_edit_file.diff rhodecode/tests/models/test_diff_parsers.py
diffstat 4 files changed, 52 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rhodecode/tests/fixtures/hg_diff_copy_and_chmod_file.diff	Mon Jun 17 20:10:47 2013 +0200
@@ -0,0 +1,5 @@
+diff --git a/file3 b/file4
+old mode 100644
+new mode 100755
+copy from file3
+copy to file4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rhodecode/tests/fixtures/hg_diff_copy_and_modify_file.diff	Mon Jun 17 20:10:47 2013 +0200
@@ -0,0 +1,9 @@
+diff --git a/file2 b/file3
+copy from file2
+copy to file3
+--- a/file2
++++ b/file3
+@@ -1,2 +1,3 @@
+ line1
+ line2
++line3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rhodecode/tests/fixtures/hg_diff_copy_chmod_and_edit_file.diff	Mon Jun 17 20:10:47 2013 +0200
@@ -0,0 +1,13 @@
+diff --git a/file4 b/file5
+old mode 100755
+new mode 100644
+copy from file4
+copy to file5
+--- a/file4
++++ b/file5
+@@ -1,3 +1,4 @@
+-line1
+ line2
+ line3
++line4
++line5
--- a/rhodecode/tests/models/test_diff_parsers.py	Mon Jun 17 12:41:28 2013 -0400
+++ b/rhodecode/tests/models/test_diff_parsers.py	Mon Jun 17 20:10:47 2013 +0200
@@ -223,6 +223,31 @@
           'deleted': 0,
           'binary': True,
           'ops': {COPIED_FILENODE: 'file copied from file1 to file2'}}),
+    ],
+    'hg_diff_copy_and_modify_file.diff': [
+        ('file3', 'M',
+         {'added': 1,
+          'deleted': 0,
+          'binary': False,
+          'ops': {COPIED_FILENODE: 'file copied from file2 to file3',
+                  MOD_FILENODE: 'modified file'}}),
+    ],
+    'hg_diff_copy_and_chmod_file.diff': [
+        ('file4', 'M',
+         {'added': 0,
+          'deleted': 0,
+          'binary': True,
+          'ops': {COPIED_FILENODE: 'file copied from file3 to file4',
+                  CHMOD_FILENODE: 'modified file chmod 100644 => 100755'}}),
+    ],
+    'hg_diff_copy_chmod_and_edit_file.diff': [
+        ('file5', 'M',
+         {'added': 2,
+          'deleted': 1,
+          'binary': False,
+          'ops': {COPIED_FILENODE: 'file copied from file4 to file5',
+                  CHMOD_FILENODE: 'modified file chmod 100755 => 100644',
+                  MOD_FILENODE: 'modified file'}}),
     ]
 #     'large_diff.diff': [
 #         ('.hgignore', 'A', {'deleted': 0, 'binary': False, 'added': 3, 'ops': {1: 'new file 100644'}}),