Patchwork [3,of,5,v2] archival: drop py2.5 taropen workaround

login
register
mail settings
Submitter timeless@mozdev.org
Date Oct. 20, 2015, 12:34 a.m.
Message ID <fc33b48966cfa28f7abc.1445301294@waste.org>
Download mbox | patch
Permalink /patch/11203/
State Accepted
Headers show

Comments

timeless@mozdev.org - Oct. 20, 2015, 12:34 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1444944158 14400
#      Thu Oct 15 17:22:38 2015 -0400
# Node ID fc33b48966cfa28f7abc415cf6ba98a37bbf4e52
# Parent  30001a3db4191ec0eac6c7b3519d7c04cfc57279
archival: drop py2.5 taropen workaround
Matt Mackall - Oct. 20, 2015, 8:43 p.m.
On Mon, 2015-10-19 at 19:34 -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1444944158 14400
> #      Thu Oct 15 17:22:38 2015 -0400
> # Node ID fc33b48966cfa28f7abc415cf6ba98a37bbf4e52
> # Parent  30001a3db4191ec0eac6c7b3519d7c04cfc57279
> archival: drop py2.5 taropen workaround

This one broke tests, dropped for now.

-- 
Mathematics is the supreme nostalgia of our time.

Patch

diff --git a/mercurial/archival.py b/mercurial/archival.py
--- a/mercurial/archival.py
+++ b/mercurial/archival.py
@@ -154,11 +154,7 @@ 
             else:
                 return tarfile.open(name, mode + kind, fileobj)
 
-        if isinstance(dest, str):
-            self.z = taropen(dest, mode='w:')
-        else:
-            # Python 2.5-2.5.1 have a regression that requires a name arg
-            self.z = taropen(name='', mode='w|', fileobj=dest)
+        self.z = taropen(dest, mode='w:')
 
     def addfile(self, name, mode, islink, data):
         i = tarfile.TarInfo(name)