# HG changeset patch # User Marcin Kuzminski # Date 2012-09-03 21:59:31 # Node ID 9ae95fdeca184f2404205645f06c6597b74ef2db # Parent c85746b607bdb3a98f1e0379f7fb5ab3f7ee4bd7 # Parent 85bb0866d44425075df23a8f5f824ae567164427 merge with beta diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -195,6 +195,8 @@ class SummaryController(BaseRepoControll try: # get's the landing revision! or tip if fails cs = db_repo.get_landing_changeset() + if isinstance(cs, EmptyChangeset): + raise EmptyRepositoryError() renderer = MarkupRenderer() for f in README_FILES: try: diff --git a/rhodecode/lib/compat.py b/rhodecode/lib/compat.py --- a/rhodecode/lib/compat.py +++ b/rhodecode/lib/compat.py @@ -407,6 +407,15 @@ except ImportError: #============================================================================== +# bytes +#============================================================================== +if __py_version__ >= (2, 6): + _bytes = bytes +else: + # in py2.6 bytes is a synonim for str + _bytes = str + +#============================================================================== # deque #============================================================================== @@ -416,11 +425,11 @@ else: #need to implement our own deque with maxlen class deque(object): - def __init__(self, iterable=(), maxlen=-1): + def __init__(self, iterable=(), maxlen= -1): if not hasattr(self, 'data'): self.left = self.right = 0 self.data = {} - self.maxlen = maxlen + self.maxlen = maxlen or -1 self.extend(iterable) def append(self, x): @@ -537,9 +546,9 @@ else: #============================================================================== if __py_version__ >= (2, 6): - from threading import Event + from threading import Event, Thread else: - from threading import _Verbose, Condition, Lock + from threading import _Verbose, Condition, Lock, Thread def Event(*args, **kwargs): return _Event(*args, **kwargs) diff --git a/rhodecode/lib/subprocessio.py b/rhodecode/lib/subprocessio.py --- a/rhodecode/lib/subprocessio.py +++ b/rhodecode/lib/subprocessio.py @@ -24,11 +24,10 @@ If not, see ccm: kr.clear() @@ -180,7 +180,7 @@ class BufferedGenerator(): self.worker.data_added.wait(0.2) if len(self.data): self.worker.keep_reading.set() - return bytes(self.data.popleft()) + return _bytes(self.data.popleft()) elif self.worker.EOF.is_set(): raise StopIteration diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -91,7 +91,7 @@ def repo_name_slug(value): slug = remove_formatting(value) slug = strip_tags(slug) - for c in """=[]\;'"<>,/~!@#$%^&*()+{}|: """: + for c in """`?=[]\;'"<>,/~!@#$%^&*()+{}|: """: slug = slug.replace(c, '-') slug = recursive_replace(slug, '-') slug = collapse(slug, '-') diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -1534,7 +1534,7 @@ class ChangesetComment(Base, BaseModel): hl_lines = Column('hl_lines', Unicode(512), nullable=True) f_path = Column('f_path', Unicode(1000), nullable=True) user_id = Column('user_id', Integer(), ForeignKey('users.user_id'), nullable=False) - text = Column('text', Unicode(25000), nullable=False) + text = Column('text', UnicodeText(25000), nullable=False) created_on = Column('created_on', DateTime(timezone=False), nullable=False, default=datetime.datetime.now) modified_at = Column('modified_at', DateTime(timezone=False), nullable=False, default=datetime.datetime.now) diff --git a/rhodecode/public/js/rhodecode.js b/rhodecode/public/js/rhodecode.js --- a/rhodecode/public/js/rhodecode.js +++ b/rhodecode/public/js/rhodecode.js @@ -372,18 +372,18 @@ var q_filter = function(target,nodes,dis } }; -var tableTr = function(cls,body){ - var tr = document.createElement('tr'); - YUD.addClass(tr, cls); - - +var tableTr = function(cls, body){ + var _el = document.createElement('div'); var cont = new YAHOO.util.Element(body); var comment_id = fromHTML(body).children[0].id.split('comment-')[1]; - tr.id = 'comment-tr-{0}'.format(comment_id); - tr.innerHTML = ''+ - ''+ - '{0}'.format(body); - return tr; + var id = 'comment-tr-{0}'.format(comment_id); + var _html = (''+ + ''+ + ''+ + ''+ + '
{2}
').format(id, cls, body); + _el.innerHTML = _html; + return _el.children[0].children[0].children[0]; }; /** comments **/ @@ -395,7 +395,7 @@ var createInlineForm = function(parent_t var tmpl = YUD.get('comment-inline-form-template').innerHTML; tmpl = tmpl.format(f_path, line); var form = tableTr('comment-form-inline',tmpl) - + // create event for hide button form = new YAHOO.util.Element(form); var form_hide_button = new YAHOO.util.Element(YUD.getElementsByClassName('hide-inline-form',null,form)[0]); @@ -444,13 +444,11 @@ var injectInlineForm = function(tr){ } } YUD.insertAfter(form,parent); - var f = YUD.get(form); - var overlay = YUD.getElementsByClassName('overlay',null,f)[0]; var _form = YUD.getElementsByClassName('inline-form',null,f)[0]; - form.on('submit',function(e){ + YUE.on(YUD.get(_form), 'submit',function(e){ YUE.preventDefault(e); //ajax submit diff --git a/rhodecode/templates/index_base.html b/rhodecode/templates/index_base.html --- a/rhodecode/templates/index_base.html +++ b/rhodecode/templates/index_base.html @@ -42,7 +42,7 @@ %if c.visual.stylify_metatags: - ${h.desc_stylize(gr.group_description)} + ${h.urlify_text(h.desc_stylize(gr.group_description))} %else: ${gr.group_description} %endif diff --git a/rhodecode/tests/test_libs.py b/rhodecode/tests/test_libs.py --- a/rhodecode/tests/test_libs.py +++ b/rhodecode/tests/test_libs.py @@ -22,7 +22,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +from __future__ import with_statement import unittest import datetime import hashlib