# HG changeset patch # User Augie Fackler # Date 1418075392 18000 # Node ID ada9b39a9eb82d341d64c10fce1bbd46fff36425 # Parent cc1e2c8cdaa62b626969ff0ba618ddc3a22b8d2e 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. diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- 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()