Patchwork [2,of,6] setup: only munge mercurial/__init__.py

login
register
mail settings
Submitter timeless@mozdev.org
Date March 8, 2016, 5:33 a.m.
Message ID <6c3d93079648b1993ef0.1457415200@waste.org>
Download mbox | patch
Permalink /patch/13666/
State Accepted
Headers show

Comments

timeless@mozdev.org - March 8, 2016, 5:33 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1452572286 0
#      Tue Jan 12 04:18:06 2016 +0000
# Node ID 6c3d93079648b1993ef0d14488634b82665f7a30
# Parent  49a623b73dd3cceb46f088006d005e2314c056bb
setup: only munge mercurial/__init__.py

Before this, we were also rewriting mercurial/hgweb/__init__.py
and others...

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -346,7 +346,8 @@ 
     def copy_file(self, *args, **kwargs):
         dst, copied = build_py.copy_file(self, *args, **kwargs)
 
-        if copied and dst.endswith('__init__.py'):
+        if (copied and dst.endswith('__init__.py') and
+            os.path.split(dst)[-2].endswith('mercurial')):
             if self.distribution.pure:
                 modulepolicy = 'py'
             else: