changeset 1277:ada9b39a9eb8

stupid: remove code that's only used by hg < 1.9 Mercurial 1.9 is over three years old at this point, so I'm willing to drop this code, as there's been an Ubuntu LTS release since then.
author Augie Fackler <raf@durin42.com>
date Mon, 08 Dec 2014 16:49:52 -0500
parents cc1e2c8cdaa6
children 2ae577a4cd56
files hgsubversion/stupid.py
diffstat 1 files changed, 1 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/stupid.py
+++ b/hgsubversion/stupid.py
@@ -171,40 +171,7 @@ def filteriterhunks(meta):
                 yield data
     return filterhunks
 
-def patchrepoold(ui, meta, parentctx, patchfp):
-    files = {}
-    try:
-        oldpatchfile = patch.patchfile
-        olditerhunks = patch.iterhunks
-        patch.patchfile = mempatchproxy(parentctx, files)
-        patch.iterhunks = filteriterhunks(meta)
-        try:
-            # We can safely ignore the changed list since we are
-            # handling non-git patches. Touched files are known
-            # by our memory patcher.
-            patch_st = patch.applydiff(ui, patchfp, {}, strip=0)
-        finally:
-            patch.patchfile = oldpatchfile
-            patch.iterhunks = olditerhunks
-    except patch.PatchError:
-        # TODO: this happens if the svn server has the wrong mime
-        # type stored and doesn't know a file is binary. It would
-        # be better to do one file at a time and only do a
-        # full fetch on files that had problems.
-        raise BadPatchApply('patching failed')
-    # if this patch didn't apply right, fall back to exporting the
-    # entire rev.
-    if patch_st == -1:
-        assert False, ('This should only happen on case-insensitive'
-                       ' volumes.')
-    elif patch_st == 1:
-        # When converting Django, I saw fuzz on .po files that was
-        # causing revisions to end up failing verification. If that
-        # can be fixed, maybe this won't ever be reached.
-        raise BadPatchApply('patching succeeded with fuzz')
-    return files
-
-try:
+if True:
     class svnbackend(patch.repobackend):
         def getfile(self, fname):
             # In Mercurial >= 3.2, if fname is missing, data will be None and we
@@ -220,12 +187,8 @@ try:
             if islink:
                 data = 'link ' + data
             return data, (islink, isexec)
-except AttributeError:
-    svnbackend = None
 
 def patchrepo(ui, meta, parentctx, patchfp):
-    if not svnbackend:
-        return patchrepoold(ui, meta, parentctx, patchfp)
     store = patch.filestore(util.getfilestoresize(ui))
     try:
         touched = set()