diff --git a/kallithea/lib/vcs/backends/hg/repository.py b/kallithea/lib/vcs/backends/hg/repository.py --- a/kallithea/lib/vcs/backends/hg/repository.py +++ b/kallithea/lib/vcs/backends/hg/repository.py @@ -264,7 +264,7 @@ class MercurialRepository(BaseRepository self.get_changeset(rev1) self.get_changeset(rev2) if path: - file_filter = match(self.path, '', [path]) + file_filter = match(self.path, '', [path], exact=True) else: file_filter = None diff --git a/kallithea/public/less/style.less b/kallithea/public/less/style.less --- a/kallithea/public/less/style.less +++ b/kallithea/public/less/style.less @@ -757,7 +757,7 @@ div.comment-prev-next-links div.next-com #repos_list_wrap_wrapper { /* make icon-folder and repotag the same width */ .icon-folder:before { - margin: 0; // default margin would otherwise add to the total width + margin: 0; // default margin would otherwise add to the total width width: 24px; text-align: left; } diff --git a/kallithea/tests/vcs/test_repository.py b/kallithea/tests/vcs/test_repository.py --- a/kallithea/tests/vcs/test_repository.py +++ b/kallithea/tests/vcs/test_repository.py @@ -78,6 +78,14 @@ class RepositoryGetDiffTest(_BackendTest ], 'removed': [FileNode('foobar')], }, + { + 'message': u'Commit that contains glob pattern in filename', + 'author': 'Jane Doe ', + 'date': datetime.datetime(2010, 1, 1, 22), + 'added': [ + FileNode('README{', content='Strangely-named README file'), + ], + }, ] return commits @@ -85,6 +93,11 @@ class RepositoryGetDiffTest(_BackendTest with pytest.raises(ChangesetDoesNotExistError): self.repo.get_diff('a' * 40, 'b' * 40) + def test_glob_patterns_in_filename_do_not_raise_exception(self): + revs = self.repo.revisions + + diff = self.repo.get_diff(revs[2], revs[3], path='README{') # should not raise + class TestGitRepositoryGetDiff(RepositoryGetDiffTest): backend_alias = 'git' @@ -152,6 +165,18 @@ index c11c37d41d33fb47741cff93fa5f9d798c +FOOBAR ''' + def test_fourth_changeset_diff(self): + revs = self.repo.revisions + assert self.repo.get_diff(revs[2], revs[3]) == '''diff --git a/README{ b/README{ +new file mode 100644 +index 0000000000000000000000000000000000000000..cdc0c1b5d234feedb37bbac19cd1b6442061102d +--- /dev/null ++++ b/README{ +@@ -0,0 +1 @@ ++Strangely-named README file +\ No newline at end of file +''' + class TestHgRepositoryGetDiff(RepositoryGetDiffTest): backend_alias = 'hg' @@ -213,6 +238,17 @@ diff --git a/foobar3 b/foobar3 +FOOBAR ''' + def test_fourth_changeset_diff(self): + revs = self.repo.revisions + assert self.repo.get_diff(revs[2], revs[3]) == '''diff --git a/README{ b/README{ +new file mode 100644 +--- /dev/null ++++ b/README{ +@@ -0,0 +1,1 @@ ++Strangely-named README file +\ No newline at end of file +''' + # For each backend create test case class for alias in SCM_TESTS: