Changeset - c9dc3cd9ce14
[Not reviewed]
Merge default
0 6 0
Marcin Kuzminski - 14 years ago 2012-05-15 23:27:52
marcin@python-works.com
merge with beta
3 files changed with 11 insertions and 15 deletions:
0 comments (0 inline, 0 general)
README.rst
Show inline comments
 
@@ -6,25 +6,25 @@ About
 
-----
 

	
 
``RhodeCode`` is a fast and powerful management tool for Mercurial_ and GIT_ 
 
with a built in push/pull server and full text search and code-review.
 
It works on http/https and has a built in permission/authentication system with 
 
the ability to authenticate via LDAP or ActiveDirectory. RhodeCode also provides
 
simple API so it's easy integrable with existing external systems.
 

	
 
RhodeCode is similar in some respects to github_ or bitbucket_, 
 
however RhodeCode can be run as standalone hosted application on your own server.
 
It is open source and donation ware and focuses more on providing a customized, 
 
self administered interface for Mercurial_ and GIT_  repositories. 
 
RhodeCode works on *nix systems and Windows it is powered by a vcs_ library 
 
RhodeCode works on \*nix systems and Windows it is powered by a vcs_ library 
 
that Lukasz Balcerzak and Marcin Kuzminski created to handle multiple 
 
different version control systems.
 

	
 
RhodeCode uses `PEP386 versioning <http://www.python.org/dev/peps/pep-0386/>`_
 

	
 
Installation
 
------------
 
Stable releases of RhodeCode are best installed via::
 

	
 
    easy_install rhodecode
 

	
 
Or::
rhodecode/controllers/files.py
Show inline comments
 
@@ -17,24 +17,25 @@
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import os
 
import logging
 
import traceback
 
import tempfile
 

	
 
from pylons import request, response, tmpl_context as c, url
 
from pylons.i18n.translation import _
 
from pylons.controllers.util import redirect
 
from pylons.decorators import jsonify
 

	
 
from rhodecode.lib import diffs
 
from rhodecode.lib import helpers as h
 

	
 
from rhodecode.lib.compat import OrderedDict
 
from rhodecode.lib.utils2 import convert_line_endings, detect_mode, safe_str
 
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
 
@@ -350,43 +351,40 @@ class FilesController(BaseRepoController
 
                for k, v in c.rhodecode_repo._repo.ui.configitems('hooks'):
 
                    c.rhodecode_repo._repo.ui.setconfig('hooks', k, None)
 

	
 
            cs = c.rhodecode_repo.get_changeset(revision)
 
            content_type = settings.ARCHIVE_SPECS[fileformat][0]
 
        except ChangesetDoesNotExistError:
 
            return _('Unknown revision %s') % revision
 
        except EmptyRepositoryError:
 
            return _('Empty repository')
 
        except (ImproperArchiveTypeError, KeyError):
 
            return _('Unknown archive type')
 

	
 
        archive = tempfile.NamedTemporaryFile(mode='w+r+b')
 
        cs.fill_archive(stream=archive, kind=fileformat, subrepos=subrepos)
 

	
 
        response.content_type = content_type
 
        response.content_disposition = 'attachment; filename=%s-%s%s' \
 
            % (repo_name, revision, ext)
 

	
 
        import tempfile
 
        archive = tempfile.mkstemp()[1]
 
        t = open(archive, 'wb')
 
        cs.fill_archive(stream=t, kind=fileformat, subrepos=subrepos)
 
            % (repo_name, revision[:12], ext)
 
        response.content_length = str(os.path.getsize(archive.name))
 

	
 
        def get_chunked_archive(archive):
 
            stream = open(archive, 'rb')
 
        def get_chunked_archive(tmpfile):
 
            while True:
 
                data = stream.read(4096)
 
                data = tmpfile.read(16 * 1024)
 
                if not data:
 
                    os.remove(archive)
 
                    tmpfile.close()
 
                    break
 
                yield data
 

	
 
        return get_chunked_archive(archive)
 
        return get_chunked_archive(tmpfile=archive)
 

	
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def diff(self, repo_name, f_path):
 
        ignore_whitespace = request.GET.get('ignorews') == '1'
 
        line_context = request.GET.get('context', 3)
 
        diff1 = request.GET.get('diff1', '')
 
        diff2 = request.GET.get('diff2', '')
 
        c.action = request.GET.get('diff')
 
        c.no_changes = diff1 == diff2
 
        c.f_path = f_path
 
        c.big_diff = False
rhodecode/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -254,26 +254,24 @@ class MercurialChangeset(BaseChangeset):
 
                           ' with archival data')
 

	
 
        if prefix is None:
 
            prefix = '%s-%s' % (self.repository.name, self.short_id)
 
        elif prefix.startswith('/'):
 
            raise VCSError("Prefix cannot start with leading slash")
 
        elif prefix.strip() == '':
 
            raise VCSError("Prefix cannot be empty")
 

	
 
        archival.archive(self.repository._repo, stream, self.raw_id,
 
                         kind, prefix=prefix, subrepos=subrepos)
 

	
 
        #stream.close()
 

	
 
        if stream.closed and hasattr(stream, 'name'):
 
            stream = open(stream.name, 'rb')
 
        elif hasattr(stream, 'mode') and 'r' not in stream.mode:
 
            stream = open(stream.name, 'rb')
 
        else:
 
            stream.seek(0)
 

	
 
    def get_nodes(self, path):
 
        """
 
        Returns combined ``DirNode`` and ``FileNode`` objects list representing
 
        state of changeset at the given ``path``. If node at the given ``path``
 
        is not instance of ``DirNode``, ChangesetError would be raised.
0 comments (0 inline, 0 general)