changeset 860:4cf20a687bff

stupid: ignore directories svn:mergeinfo in svn >= 1.7 For instance, test_fetch_renames.test_case_stupid emits this diff: Index: E =================================================================== --- E (revision 2) +++ E (revision 3) Property changes on: E ___________________________________________________________________ Added: svn:mergeinfo
author Patrick Mezard <patrick@mezard.eu>
date Thu, 19 Apr 2012 15:08:04 +0200
parents 1d07e86f5797
children 6fc7f74f0cf6
files hgsubversion/stupid.py
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/stupid.py
+++ b/hgsubversion/stupid.py
@@ -80,6 +80,10 @@ class filediff:
     def isempty(self):
         return (not self.diff and not self.binary and not self.hasprops)
 
+    def maybedir(self):
+        return (not self.diff and not self.binary and self.hasprops
+                and self.symlink is None and self.executable is None)
+
 def parsediff(diff):
     changes = {}
     headers = headers_re.split(diff)[1:]
@@ -320,6 +324,23 @@ def diff_branchrev(ui, svn, meta, branch
     touched_files.update(files_data)
     touched_files.update(unknown_files)
 
+    # As of svn 1.7, diff may contain a lot of property changes for
+    # directories. We do not what to include these in our touched
+    # files list so we try to filter them while minimizing the number
+    # of svn API calls.
+    property_files = set(f.name for f in changed if f.maybedir())
+    property_files.discard('.')
+    touched_files.discard('.')
+    branchprefix = (branchpath and branchpath + '/') or branchpath
+    for f in list(property_files):
+        if f in parentctx:
+            continue
+        # We can be smarter here by checking if f is a subcomponent
+        # of a know path in parentctx or touched_files. KISS for now.
+        kind = svn.checkpath(branchprefix + f, r.revnum)
+        if kind == 'd':
+            touched_files.discard(f)
+
     copies = getcopies(svn, meta, branch, branchpath, r, touched_files,
                        parentctx)