Browse Source

Dirty fix false alarm of dangling header reported in issue #14

Matthew Wang 11 years ago
parent
commit
6a6249f4c6
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      cdiff.py
  2. 1
    1
      tests/test_cdiff.py

+ 1
- 1
cdiff.py View File

408
         '----' likely to see in diff from yaml file
408
         '----' likely to see in diff from yaml file
409
         """
409
         """
410
         return line.startswith('-') and not self.is_old_path(line) and \
410
         return line.startswith('-') and not self.is_old_path(line) and \
411
-            not re.match(r'^-{5,}$', line.rstrip())
411
+            not re.match(r'^-{72}$', line.rstrip())
412
 
412
 
413
     def is_new(self, line):
413
     def is_new(self, line):
414
         return line.startswith('+') and not self.is_new_path(line)
414
         return line.startswith('+') and not self.is_new_path(line)

+ 1
- 1
tests/test_cdiff.py View File

411
 
411
 
412
     def test_is_old_neg(self):
412
     def test_is_old_neg(self):
413
         self.assertFalse(self.diff.is_old('--- considered as old path'))
413
         self.assertFalse(self.diff.is_old('--- considered as old path'))
414
-        self.assertFalse(self.diff.is_old('-------------'))  # svn log --diff
414
+        self.assertFalse(self.diff.is_old('-' * 72))         # svn log --diff
415
 
415
 
416
     def test_is_new(self):
416
     def test_is_new(self):
417
         self.assertTrue(self.diff.is_new('+hello world'))
417
         self.assertTrue(self.diff.is_new('+hello world'))