diff fetch_command.py @ 89:edeec6829d80

SubversionRepo: remember svn.diff3() does not work Calling it repeatedly is expensive, files and directories are created, svn transport layer is reset.
author Patrick Mezard <pmezard@gmail.com>
date Fri, 14 Nov 2008 16:18:24 -0600
parents 3b60f223893a
children 4c419603d41b
line wrap: on
line diff
--- a/fetch_command.py
+++ b/fetch_command.py
@@ -368,28 +368,20 @@ def stupid_svn_server_pull_rev(ui, svn, 
         link_files = {}
         exec_files = {}
         try:
-            try:
-                if br_p == b:
-                    # letting patch handle binaries sounded
-                    # cool, but it breaks patch in sad ways
-                    d = svn.get_unified_diff(diff_path, r.revnum, deleted=False,
-                                             ignore_type=False)
-                else:
-                    d = svn.get_unified_diff(diff_path, r.revnum,
-                                             other_path=make_diff_path(br_p),
-                                             other_rev=parent_rev,
-                                             deleted=True, ignore_type=True)
-                    if d:
-                        ui.status('Branch creation with mods, pulling full rev.\n')
-                        raise BadPatchApply()
-            except core.SubversionException, e:
-                # "Can't write to stream: The handle is invalid."
-                # This error happens systematically under Windows, possibly
-                # related to file handles being non-write shareable by default.
-                if e.apr_err != 720006:
-                    raise
-                raise BadPatchApply()
-            
+            if br_p == b:
+                # letting patch handle binaries sounded
+                # cool, but it breaks patch in sad ways
+                d = svn.get_unified_diff(diff_path, r.revnum, deleted=False,
+                                         ignore_type=False)
+            else:
+                d = svn.get_unified_diff(diff_path, r.revnum,
+                                         other_path=make_diff_path(br_p),
+                                         other_rev=parent_rev,
+                                         deleted=True, ignore_type=True)
+                if d:
+                    ui.status('Branch creation with mods, pulling full rev.\n')
+                    raise BadPatchApply()
+
             for m in binary_file_re.findall(d):
                 # we have to pull each binary file by hand as a fulltext,
                 # which sucks but we've got no choice
@@ -517,7 +509,9 @@ def stupid_svn_server_pull_rev(ui, svn, 
                 os.remove(path)
                 link_files[m] = link_path
                 files_touched.add(m)
-        except (core.SubversionException, BadPatchApply), e:
+        except (core.SubversionException,
+                BadPatchApply,
+                svnwrap.SubversionRepoCanNotDiff), e:
             if (hasattr(e, 'apr_err') and e.apr_err != 160013):
                 raise
             # Either this revision or the previous one does not exist.