Commit 52d2aefd authored by Julien Muchembled's avatar Julien Muchembled

Take TemplateTool_filter* scripts into account when displaying SVN status tree

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40068 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9cae8b08
...@@ -826,19 +826,30 @@ class SubversionTool(BaseTool): ...@@ -826,19 +826,30 @@ class SubversionTool(BaseTool):
# Business template root directory is the root of the tree # Business template root directory is the root of the tree
root = Dir(business_template.getTitle(), "normal") root = Dir(business_template.getTitle(), "normal")
something_modified = False something_modified = False
template_tool = self.getPortalObject().portal_templates
if template_tool.getDiffFilterScriptList():
client_diff = self._getClient().diff
def hasDiff(path):
return template_tool.getFilteredDiff(client_diff(path, None, None))
else:
def hasDiff(path):
return True
statusObj_list = self.status(os.path.join(bt_path, \ statusObj_list = self.status(os.path.join(bt_path, \
business_template.getTitle()), update=False) business_template.getTitle()), update=False)
# We browse the files returned by svn status # We browse the files returned by svn status
for status_obj in statusObj_list : for status_obj in statusObj_list :
# can be (normal, added, modified, deleted, conflicted, unversioned) # can be (normal, added, modified, deleted, conflicted, unversioned)
status = str(status_obj.getTextStatus())
if str(status_obj.getReposTextStatus()) != 'none': if str(status_obj.getReposTextStatus()) != 'none':
status = "outdated" status = "outdated"
if (show_unmodified or status != "normal") and status != "unversioned": else:
status = str(status_obj.getTextStatus())
if status == "unversioned" or \
status == "normal" and not show_unmodified:
continue
full_path = status_obj.getPath()
if status != "modified" or hasDiff(full_path):
something_modified = True something_modified = True
# Get object path # Get object path
full_path = status_obj.getPath()
relative_path = full_path.replace(bt_path, '') relative_path = full_path.replace(bt_path, '')
filename = os.path.basename(relative_path) filename = os.path.basename(relative_path)
......
...@@ -97,6 +97,9 @@ class DiffFile: ...@@ -97,6 +97,9 @@ class DiffFile:
tmp.append(line) tmp.append(line)
self.children.append(CodeBlock(os.linesep.join(tmp))) self.children.append(CodeBlock(os.linesep.join(tmp)))
def __len__(self):
return len(self.children)
def toHTML(self): def toHTML(self):
""" return HTML diff """ return HTML diff
""" """
...@@ -104,7 +107,7 @@ class DiffFile: ...@@ -104,7 +107,7 @@ class DiffFile:
if self.binary: if self.binary:
return '<b>Folder or binary file or just no changes!</b><br/><br/><br/>' return '<b>Folder or binary file or just no changes!</b><br/><br/><br/>'
if not len(self.children): if not self:
return '' return ''
html_list = [] html_list = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment