def _check_scm(self):
     try:
         self.info('Checking whether {0} is a mercurial repository'.format(self.scm_url))
         parsing_result = remote_parser.parse_url(self.scm_url, 'tip')
     except Exception as e:
         try:
             self.info('Checking whether {0} is a git repository'.format(self.scm_url))
             self.files = set(lsgit.list_git_files(self.scm_url, allow_depth=False))
             self.scm = 'git'
         except Exception as e:
             self.info('Checking whether {0} is a subversion repository'.format(self.scm_url))
             # FIXME detect directory
             # Plugin for which detection is useful: #2805
             self.scm_url = 'https://' + self.name + '.googlecode.com/svn'
             scm_cache = get_scm_cache()
             try:
                 self.files = scm_cache[self.scm_url]
                 self.debug('Obtained file list from cache for URL {0}'.format(self.scm_url))
             except KeyError:
                 self.files = set(lssvn.list_svn_files(self.scm_url))
                 self.info('Subversion files: {0!r}'.format(self.files))
                 trunkfiles = {tf[6:] for tf in self.files if tf.startswith('trunk/')}
                 if trunkfiles:
                     self.scm_url += '/trunk'
                     self.files = trunkfiles
                     self.info('Found trunk/ directory, leaving only files in there: {0!r}'.format(self.files))
             self.scm = 'svn'
     else:
         self.files = set(next(iter(parsing_result['tips'])).files)
         self.scm = 'hg'
 def files(self):
     return set(lssvn.list_svn_files(self.scm_url))