Commits

Marcin Kuzminski committed b8d5a5c Merge

merge with beta

  • Participants
  • Parent commits 058fc80, 24095ab
  • Branches default

Comments (0)

Files changed (8)

rhodecode/controllers/files.py

         except (ImproperArchiveTypeError, KeyError):
             return _('Unknown archive type')
 
-        archive = tempfile.NamedTemporaryFile(mode='w+r+b')
+        archive = tempfile.NamedTemporaryFile(mode='w+r+b', delete=False)
         cs.fill_archive(stream=archive, kind=fileformat, subrepos=subrepos)
-
+        archive.close()
         response.content_type = content_type
         response.content_disposition = 'attachment; filename=%s-%s%s' \
             % (repo_name, revision[:12], ext)
                 data = tmpfile.read(16 * 1024)
                 if not data:
                     tmpfile.close()
+                    os.unlink(tmpfile.name)
                     break
                 yield data
-        return get_chunked_archive(tmpfile=archive)
+        return get_chunked_archive(tmpfile=open(archive.name,'rb'))
 
     @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
                                    'repository.admin')

rhodecode/lib/auth.py

         passwd_gen = PasswordGenerator()
         #print 8-letter password containing only big and small letters
             of alphabet
-        print passwd_gen.gen_password(8, passwd_gen.ALPHABETS_BIG_SMALL)
+        passwd_gen.gen_password(8, passwd_gen.ALPHABETS_BIG_SMALL)
     """
     ALPHABETS_NUM = r'''1234567890'''
     ALPHABETS_SMALL = r'''qwertyuiopasdfghjklzxcvbnm'''

rhodecode/lib/utils2.py

     try:
         import chardet
         encoding = chardet.detect(unicode_)['encoding']
-        print encoding
         if encoding is None:
             raise UnicodeEncodeError()
 

rhodecode/lib/vcs/backends/git/changeset.py

         which is generally not good. Should be replaced with algorithm
         iterating commits.
         """
-        cmd = 'log --pretty="format: --%%H--" --name-status -p %s -- "%s"' % (
+        cmd = 'log --pretty="format: %%H" -s -p %s -- "%s"' % (
                   self.id, path
                )
         so, se = self.repository.run_git_command(cmd)
-        ids = re.findall(r'(?:--)(\w{40})(?:--)', so)
+        ids = re.findall(r'[0-9a-fA-F]{40}', so)
         return [self.repository.get_changeset(id) for id in ids]
 
     def get_file_annotate(self, path):

rhodecode/lib/vcs/backends/hg/changeset.py

File contents unchanged.

rhodecode/lib/vcs/utils/__init__.py

     try:
         import chardet
         encoding = chardet.detect(unicode_)['encoding']
-        print encoding
         if encoding is None:
             raise UnicodeEncodeError()
 

rhodecode/model/user.py

 
         for perm in user_repo_group_perms_from_users_groups:
             g_k = perm.UsersGroupRepoGroupToPerm.group.group_name
-            print perm, g_k
             p = perm.Permission.permission_name
             cur_perm = user.permissions[GK][g_k]
             # overwrite permission only if it's greater than permission

rhodecode/tests/functional/test_files.py

         self.log_user()
 
         for arch_ext, info in ARCHIVE_SPECS.items():
+            short = '27cd5cce30c9%s' % arch_ext
             fname = '27cd5cce30c96924232dffcd24178a07ffeb5dfc%s' % arch_ext
-            filename = '%s-%s' % (HG_REPO, fname)
-
-            response = self.app.get(url(controller='files', action='archivefile',
+            filename = '%s-%s' % (HG_REPO, short)
+            response = self.app.get(url(controller='files', 
+                                        action='archivefile',
                                         repo_name=HG_REPO,
                                         fname=fname))
 
              [('Pragma', 'no-cache'),
               ('Cache-Control', 'no-cache'),
               ('Content-Type', '%s; charset=utf-8' % info[0]),
-              ('Content-Disposition', 'attachment; filename=%s' % filename),]
+              ('Content-Disposition', 'attachment; filename=%s' % filename),
+             ]
             )
 
     def test_archival_wrong_ext(self):