Mercurial > hgsubversion
changeset 25:99f8e4b535e9
svn 1.4 and 1.5 have different ideas of diff output for prop changes.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Thu, 09 Oct 2008 23:37:22 -0500 |
parents | 5954a514ae26 |
children | bfbce70a9a57 |
files | fetch_command.py tests/test_fetch_command.py tests/test_fetch_command_regexes.py |
diffstat | 3 files changed, 27 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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 \- \* ''')
--- 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):
--- 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',