diff --git a/product/ERP5Subversion/Tool/SubversionTool.py b/product/ERP5Subversion/Tool/SubversionTool.py index 37f77e32bedee061e1e4fb5dfabef27e4b05aeb8..da015a57f42505d5185ebdd7d656e9e4e358c27f 100644 --- a/product/ERP5Subversion/Tool/SubversionTool.py +++ b/product/ERP5Subversion/Tool/SubversionTool.py @@ -826,19 +826,30 @@ class SubversionTool(BaseTool): # Business template root directory is the root of the tree root = Dir(business_template.getTitle(), "normal") 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, \ business_template.getTitle()), update=False) # We browse the files returned by svn status for status_obj in statusObj_list : # can be (normal, added, modified, deleted, conflicted, unversioned) - status = str(status_obj.getTextStatus()) if str(status_obj.getReposTextStatus()) != 'none': 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 # Get object path - full_path = status_obj.getPath() relative_path = full_path.replace(bt_path, '') filename = os.path.basename(relative_path) diff --git a/product/ERP5Type/DiffUtils.py b/product/ERP5Type/DiffUtils.py index 40808195c0b8dddfa7f1c7d77eb8affd1f23fb3f..2626cfee8297f984defb06a0df89750d2b38f0ec 100644 --- a/product/ERP5Type/DiffUtils.py +++ b/product/ERP5Type/DiffUtils.py @@ -97,6 +97,9 @@ class DiffFile: tmp.append(line) self.children.append(CodeBlock(os.linesep.join(tmp))) + def __len__(self): + return len(self.children) + def toHTML(self): """ return HTML diff """ @@ -104,7 +107,7 @@ class DiffFile: if self.binary: return '<b>Folder or binary file or just no changes!</b><br/><br/><br/>' - if not len(self.children): + if not self: return '' html_list = []