# HG changeset patch # User Augie Fackler # Date 1223613442 18000 # Node ID 99f8e4b535e9880c32b6d26236101f762b80a5f2 # Parent 5954a514ae267c6723e34f57bafa9a8919d35e78 svn 1.4 and 1.5 have different ideas of diff output for prop changes. diff --git a/fetch_command.py b/fetch_command.py --- a/fetch_command.py +++ b/fetch_command.py @@ -151,13 +151,13 @@ Cannot display: file marked as a binary property_exec_set_re = re.compile(r'''Property changes on: ([^\n]*) _* -Added: svn:executable +(?:Added|Name): svn:executable \+ \* ''') property_exec_removed_re = re.compile(r'''Property changes on: ([^\n]*) _* -Deleted: svn:executable +(?:Deleted|Name): svn:executable - \* ''') @@ -167,13 +167,13 @@ any_file_re = re.compile(r'''^Index: ([^ property_special_set_re = re.compile(r'''Property changes on: ([^\n]*) _* -Added: svn:special +(?:Added|Name): svn:special \+ \* ''') property_special_removed_re = re.compile(r'''Property changes on: ([^\n]*) _* -Added: svn:special +(?:Deleted|Name): svn:special \- \* ''') diff --git a/tests/test_fetch_command.py b/tests/test_fetch_command.py --- a/tests/test_fetch_command.py +++ b/tests/test_fetch_command.py @@ -21,9 +21,9 @@ class TestBasicRepoLayout(unittest.TestC def tearDown(self): shutil.rmtree(self.tmpdir) os.chdir(self.oldwd) - + def _load_fixture_and_fetch(self, fixture_name): - return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, + return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, self.wc_path) def test_fresh_fetch_single_rev(self): diff --git a/tests/test_fetch_command_regexes.py b/tests/test_fetch_command_regexes.py --- a/tests/test_fetch_command_regexes.py +++ b/tests/test_fetch_command_regexes.py @@ -29,18 +29,37 @@ Index: trunk/functional_tests/doc_tests/ =================================================================== """ +special_delta = """Index: delta +=================================================================== +--- delta(revision 0) ++++ delta(revision 9) +@@ -0,0 +1 @@ ++link alpha +\ No newline at end of file + +Property changes on: delta +___________________________________________________________________ +Name: svn:special + + * + +""" + class RegexTests(unittest.TestCase): def test_empty_file_re(self): matches = fetch_command.empty_file_patch_wont_make_re.findall(two_empties) assert sorted(matches) == ['__init__.py', 'bar/__init__.py'] - + def test_any_matches_just_one(self): pat = '''Index: trunk/django/contrib/admin/urls/__init__.py =================================================================== ''' matches = fetch_command.any_file_re.findall(pat) assert len(matches) == 1 - + + def test_special_re(self): + matches = fetch_command.property_special_set_re.findall(special_delta) + assert len(matches) == 1 + def test_any_file_re(self): matches = fetch_command.any_file_re.findall(two_empties) assert sorted(matches) == ['__init__.py', 'bar/__init__.py',