Commits

Jannis Leidel  committed cd7194f

Makes sure to look for the egg-info directory also in subdirectories during installation.

  • Participants
  • Parent commits 3fef222

Comments (0)

Files changed (1)

     def backends(self):
         return self._registry.values()
 
+    @property
+    def dirnames(self):
+        return [backend.dirname for backend in self.backends]
+
     def register(self, cls):
         if not hasattr(cls, 'name'):
             logger.warn('Cannot register VCS %s' % cls.__name__)
                 base = self.source_dir
             else:
                 base = os.path.join(self.source_dir, 'pip-egg-info')
-            filenames = os.listdir(base)
+            filenames = []
             if self.editable:
+                for root, dirs, files in os.walk(base):
+                    for dir in vcs.dirnames:
+                        if dir in dirs:
+                            dirs.remove(dir)
+                    filenames.extend([os.path.join(root, dir)
+                                     for dir in dirs])
                 filenames = [f for f in filenames if f.endswith('.egg-info')]
             assert len(filenames) == 1, "Unexpected files/directories in %s: %s" % (base, ' '.join(filenames))
             self._egg_info_path = os.path.join(base, filenames[0])
 
     def __init__(self, url=None, *args, **kwargs):
         self.url = url
-        self.dirname = '.%s' % self.name
         super(VersionControl, self).__init__(*args, **kwargs)
 
     def _filter(self, line):
 
 class Subversion(VersionControl):
     name = 'svn'
+    dirname = '.svn'
     schemes = ('svn', 'svn+ssh')
     bundle_file = 'svn-checkout.txt'
     guide = ('# This was an svn checkout; to make it a checkout again run:\n'
 
 class Git(VersionControl):
     name = 'git'
+    dirname = '.git'
     schemes = ('git', 'git+http', 'git+ssh')
     bundle_file = 'git-clone.txt'
     guide = ('# This was a Git repo; to make it a repo again run:\n'
 
 class Mercurial(VersionControl):
     name = 'hg'
+    dirname = '.hg'
     schemes = ('hg', 'hg+http', 'hg+ssh')
     bundle_file = 'hg-clone.txt'
     guide = ('# This was a Mercurial repo; to make it a repo again run:\n'
 
 class Bazaar(VersionControl):
     name = 'bzr'
+    dirname = '.bzr'
     bundle_file = 'bzr-branch.txt'
     schemes = ('bzr', 'bzr+http', 'bzr+https', 'bzr+ssh', 'bzr+sftp')
     guide = ('# This was a Bazaar branch; to make it a branch again run:\n'