Changeset - 4725d097c3c0
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-03-03 23:20:58
marcin@python-works.com
check if given f_path in diff is not a dir by any chance
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/files.py
Show inline comments
 
@@ -486,6 +486,8 @@ class FilesController(BaseRepoController
 
                c.changeset_1 = c.rhodecode_repo.get_changeset(diff1)
 
                try:
 
                    node1 = c.changeset_1.get_node(f_path)
 
                    if node1.is_dir():
 
                        raise NodeError('%s path is a %s not a file' % (node1, type(node1)))
 
                except NodeDoesNotExistError:
 
                    c.changeset_1 = EmptyChangeset(cs=diff1,
 
                                                   revision=c.changeset_1.revision,
 
@@ -499,6 +501,7 @@ class FilesController(BaseRepoController
 
                c.changeset_2 = c.rhodecode_repo.get_changeset(diff2)
 
                try:
 
                    node2 = c.changeset_2.get_node(f_path)
 
                    raise NodeError('%s path is a %s not a file' % (node2, type(node2)))
 
                except NodeDoesNotExistError:
 
                    c.changeset_2 = EmptyChangeset(cs=diff2,
 
                                                   revision=c.changeset_2.revision,
0 comments (0 inline, 0 general)