ソースを参照

Handle a diff with only an svn property change

Steven Myint 11 年 前
コミット
5ddd06fd05
共有6 個のファイルを変更した24 個の追加3 個の削除を含む
  1. 4
    3
      cdiff.py
  2. 4
    0
      tests/svn-property/in.diff
  3. 5
    0
      tests/svn-property/out.normal
  4. 5
    0
      tests/svn-property/out.side-by-side
  5. 5
    0
      tests/svn-property/out.w70
  6. 1
    0
      tests/test_cdiff.py

+ 4
- 3
cdiff.py ファイルの表示

@@ -480,10 +480,11 @@ class DiffParser(object):
480 480
                 self._type = 'unified'
481 481
                 break
482 482
         else:
483
-            if size < 4:
483
+            if size < 5:
484 484
                 # It's safe to consider as udiff if patch stream contains no
485
-                # more than 3 lines, happens with `git diff` on a file that
486
-                # only has perm bits changes
485
+                # more than 4 lines. happens with `git diff` on a file that
486
+                # only has perm bits changes or `svn diff` with property
487
+                # changes.
487 488
                 #
488 489
                 self._type = 'unified'
489 490
             else:

+ 4
- 0
tests/svn-property/in.diff ファイルの表示

@@ -0,0 +1,4 @@
1
+Index: foo
2
+===================================================================
3
+Cannot display: file marked as a binary type.
4
+svn:mime-type = application/octet-stream

+ 5
- 0
tests/svn-property/out.normal ファイルの表示

@@ -0,0 +1,5 @@
1
+Index: foo
2
+===================================================================
3
+Cannot display: file marked as a binary type.
4
+svn:mime-type = application/octet-stream
5
+

+ 5
- 0
tests/svn-property/out.side-by-side ファイルの表示

@@ -0,0 +1,5 @@
1
+Index: foo
2
+===================================================================
3
+Cannot display: file marked as a binary type.
4
+svn:mime-type = application/octet-stream
5
+

+ 5
- 0
tests/svn-property/out.w70 ファイルの表示

@@ -0,0 +1,5 @@
1
+Index: foo
2
+===================================================================
3
+Cannot display: file marked as a binary type.
4
+svn:mime-type = application/octet-stream
5
+

+ 1
- 0
tests/test_cdiff.py ファイルの表示

@@ -441,6 +441,7 @@ spam
441 441
 --- a
442 442
 spam
443 443
 +++ b
444
+
444 445
 """
445 446
         items = patch.splitlines(True)
446 447
         stream = cdiff.PatchStream(Sequential(items))