Changeset - b8d5a5c9f66d
[Not reviewed]
Merge default
0 8 0
Marcin Kuzminski - 14 years ago 2012-05-16 01:25:00
marcin@python-works.com
merge with beta
7 files changed with 13 insertions and 13 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/files.py
Show inline comments
 
@@ -360,9 +360,9 @@ class FilesController(BaseRepoController
 
        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)
 
@@ -373,9 +373,10 @@ class FilesController(BaseRepoController
 
                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
Show inline comments
 
@@ -64,7 +64,7 @@ class PasswordGenerator(object):
 
        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
Show inline comments
 
@@ -215,7 +215,6 @@ def safe_str(unicode_, to_encoding=None)
 
    try:
 
        import chardet
 
        encoding = chardet.detect(unicode_)['encoding']
 
        print encoding
 
        if encoding is None:
 
            raise UnicodeEncodeError()
 

	
rhodecode/lib/vcs/backends/git/changeset.py
Show inline comments
 
@@ -240,11 +240,11 @@ class GitChangeset(BaseChangeset):
 
        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/utils/__init__.py
Show inline comments
 
@@ -90,7 +90,6 @@ def safe_str(unicode_, to_encoding=None)
 
    try:
 
        import chardet
 
        encoding = chardet.detect(unicode_)['encoding']
 
        print encoding
 
        if encoding is None:
 
            raise UnicodeEncodeError()
 

	
rhodecode/model/user.py
Show inline comments
 
@@ -531,7 +531,6 @@ class UserModel(BaseModel):
 

	
 
        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
Show inline comments
 
@@ -190,10 +190,11 @@ class TestFilesController(TestController
 
        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))
 

	
 
@@ -202,7 +203,8 @@ class TestFilesController(TestController
 
             [('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):
0 comments (0 inline, 0 general)