# HG changeset patch # User Aras Pranckevicius # Date 1326094635 -7200 # Node ID 395a3196de73aeef5924494a1b0a946f7864d47d # Parent d832f2bbb466d1c388bf91bdfa74ab91f4d33c09# Parent 941dee1131365b6b8fd5e60c965546f55ba74faa merge upstream (keeping my graph.js changes) diff -r d832f2bbb466 -r 395a3196de73 CONTRIBUTORS --- a/CONTRIBUTORS Mon Jan 09 09:33:36 2012 +0200 +++ b/CONTRIBUTORS Mon Jan 09 09:37:15 2012 +0200 @@ -15,4 +15,4 @@ Les Peabody Jonas Oberschweiber Matt Zuba - \ No newline at end of file + Aras Pranckevicius \ No newline at end of file diff -r d832f2bbb466 -r 395a3196de73 development.ini --- a/development.ini Mon Jan 09 09:33:36 2012 +0200 +++ b/development.ini Mon Jan 09 09:37:15 2012 +0200 @@ -74,17 +74,17 @@ ## pattern to get the issues from commit messages ## default one used here is #1234 -#url_pat = (?:^#|\s#)(\w+) +url_pat = (?:^#|\s#)(\w+) ## server url to the issue, each {id} will be replaced with id -## fetched from the regex +## fetched from the regex and {repo} is replaced with repository name -#issue_server = https://myissueserver.com/issue/{id} +issue_server_link = https://myissueserver.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by -#issue_prefix = # +issue_prefix = # #################################### diff -r d832f2bbb466 -r 395a3196de73 docs/changelog.rst --- a/docs/changelog.rst Mon Jan 09 09:33:36 2012 +0200 +++ b/docs/changelog.rst Mon Jan 09 09:37:15 2012 +0200 @@ -33,8 +33,9 @@ - implements #330 api method for listing nodes ar particular revision - fixed #331 RhodeCode mangles repository names if the a repository group contains the "full path" to the repositories -- #73 added linking issues in commit messages to choosen issue tracker url +- #73 added linking issues in commit messages to chosen issue tracker url based on user defined regular expression +- new compact changelog with expandable commit messages fixes ----- diff -r d832f2bbb466 -r 395a3196de73 docs/setup.rst --- a/docs/setup.rst Mon Jan 09 09:33:36 2012 +0200 +++ b/docs/setup.rst Mon Jan 09 09:37:15 2012 +0200 @@ -434,16 +434,19 @@ uncomment following variables in the ini file:: url_pat = (?:^#|\s#)(\w+) - issue_server = https://myissueserver.com/issue/{id} + issue_server_link = https://myissueserver.com/{repo}/issue/{id} issue_prefix = # -`url_pat` is the regular expression that will match issues, default given regex -will match issues in format of # eg. #300. -Matched issues will be replace with the `issue_server` url replacing {id} with -id fetched from regex. Since the # is striped `issue_prefix` is added as a -prefix to url. `issue_prefix` can be something different than # if you pass -ISSUE- as issue prefix this will generate an url in format -`ISSUE-300` +`url_pat` is the regular expression that will fetch issues from commit messages. +Default regex will match issues in format of # eg. #300. + +Matched issues will be replace with the link specified as `issue_server_link` +{id} will be replaced with issue id, and {repo} with repository name. +Since the # is striped `issue_prefix` is added as a prefix to url. +`issue_prefix` can be something different than # if you pass +ISSUE- as issue prefix this will generate an url in format:: + + ISSUE-300 Hook management --------------- diff -r d832f2bbb466 -r 395a3196de73 production.ini --- a/production.ini Mon Jan 09 09:33:36 2012 +0200 +++ b/production.ini Mon Jan 09 09:37:15 2012 +0200 @@ -77,9 +77,9 @@ #url_pat = (?:^#|\s#)(\w+) ## server url to the issue, each {id} will be replaced with id -## fetched from the regex +## fetched from the regex and {repo} is replaced with repository name -#issue_server = https://myissueserver.com/issue/{id} +#issue_server_link = https://myissueserver.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by diff -r d832f2bbb466 -r 395a3196de73 rhodecode/config/deployment.ini_tmpl --- a/rhodecode/config/deployment.ini_tmpl Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/config/deployment.ini_tmpl Mon Jan 09 09:37:15 2012 +0200 @@ -77,9 +77,9 @@ #url_pat = (?:^#|\s#)(\w+) ## server url to the issue, each {id} will be replaced with id -## fetched from the regex +## fetched from the regex and {repo} is replaced with repository name -#issue_server = https://myissueserver.com/issue/{id} +#issue_server_link = https://myissueserver.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by diff -r d832f2bbb466 -r 395a3196de73 rhodecode/controllers/admin/repos.py --- a/rhodecode/controllers/admin/repos.py Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/controllers/admin/repos.py Mon Jan 09 09:37:15 2012 +0200 @@ -278,7 +278,7 @@ return redirect(url('repos')) - @HasRepoPermissionAllDecorator('repository.admin') + @HasRepoPermissionAllDecorator('repository.admin') def delete_perm_user(self, repo_name): """ DELETE an existing repository permission user diff -r d832f2bbb466 -r 395a3196de73 rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/controllers/changelog.py Mon Jan 09 09:37:15 2012 +0200 @@ -37,8 +37,7 @@ from rhodecode.lib.helpers import RepoPage from rhodecode.lib.compat import json -from vcs.exceptions import RepositoryError, ChangesetError, \ -ChangesetDoesNotExistError,BranchDoesNotExistError +from vcs.exceptions import RepositoryError, ChangesetDoesNotExistError log = logging.getLogger(__name__) @@ -54,7 +53,7 @@ def index(self): limit = 100 - default = 40 + default = 20 if request.params.get('size'): try: int_size = int(request.params.get('size')) diff -r d832f2bbb466 -r 395a3196de73 rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/lib/helpers.py Mon Jan 09 09:37:15 2012 +0200 @@ -739,36 +739,42 @@ def url_func(match_obj): url_full = match_obj.groups()[0] - return '%(url)s' % ({'url':url_full}) + return '%(url)s' % ({'url': url_full}) return literal(url_pat.sub(url_func, text_)) -def urlify_commit(text_): + +def urlify_commit(text_, repository=None): import re import traceback - + try: conf = config['app_conf'] - + URL_PAT = re.compile(r'%s' % conf.get('url_pat')) - + if URL_PAT: - ISSUE_SERVER = conf.get('issue_server') + ISSUE_SERVER_LNK = conf.get('issue_server_link') ISSUE_PREFIX = conf.get('issue_prefix') + def url_func(match_obj): issue_id = match_obj.groups()[0] tmpl = ( - '' - ' %(issue-prefix)s%(id-repr)s' + ' ' + '%(issue-prefix)s%(id-repr)s' '' ) + url = ISSUE_SERVER_LNK.replace('{id}', issue_id) + if repository: + url = url.replace('{repo}', repository) + return tmpl % ( { - 'cls':'issue-tracker-link', - 'url':ISSUE_SERVER.replace('{id}',issue_id), - 'id-repr':issue_id, - 'issue-prefix':ISSUE_PREFIX, - 'serv':ISSUE_SERVER, + 'cls': 'issue-tracker-link', + 'url': url, + 'id-repr': issue_id, + 'issue-prefix': ISSUE_PREFIX, + 'serv': ISSUE_SERVER_LNK, } ) return literal(URL_PAT.sub(url_func, text_)) @@ -778,10 +784,12 @@ return text_ + def rst(source): return literal('
%s
' % MarkupRenderer.rst(source)) + def rst_w_mentions(source): """ Wrapped rst renderer with @mention highlighting diff -r d832f2bbb466 -r 395a3196de73 rhodecode/lib/rcmail/response.py --- a/rhodecode/lib/rcmail/response.py Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/lib/rcmail/response.py Mon Jan 09 09:37:15 2012 +0200 @@ -141,7 +141,7 @@ MailResponse.to_message. This lets you change it and work with it, then send it out when it's ready. """ - def __init__(self, To=None, From=None, Subject=None, Body=None, Html=None, + def __init__(self, To=None, From=None, Subject=None, Body=None, Html=None, separator="; "): self.Body = Body self.Html = Html diff -r d832f2bbb466 -r 395a3196de73 rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/public/css/style.css Mon Jan 09 09:37:15 2012 +0200 @@ -1130,7 +1130,27 @@ clear: both; overflow: hidden; margin: 0; - padding: 10px 0; + padding: 5px 0; + white-space: pre-wrap; +} +#content div.box div.expand{ +position:absolute; +width:inherit; +height:14px; +font-size:14px; +text-align:left; +cursor: pointer; +font-family: monospace; +color:#003367; +/* +background:-webkit-gradient(linear,0% 50%,100% 50%,color-stop(0%,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1))); +background:-webkit-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +background:-moz-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +background:-o-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +background:-ms-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +background:linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +*/ +display: none; } #content div.box div.message a { @@ -2115,8 +2135,12 @@ padding: 5px !important; } +.tablerow0 { + background-color: #F8F8F8; +} + .tablerow1 { - background-color: #F8F8F8; + background-color: #FFFFFF; } .changeset_id { @@ -2246,7 +2270,7 @@ } #graph_content #rev_range_container { - padding: 5px 20px; + padding: 7px 20px; float: left; } @@ -2276,6 +2300,7 @@ #graph_content .container .left .date { color: #444444; + padding-left: 22px; } #graph_content .container .left .author { @@ -2532,7 +2557,10 @@ margin-left:1px; } - +.diffblock .diff-actions { + padding: 2px 0px 0px 2px; + float: left; +} .diffblock .diff-menu ul li { padding: 0px 0px 0px 0px !important; } @@ -3980,6 +4008,7 @@ div.diffblock .code-header .date{ float:left; text-transform: uppercase; + padding: 2px 0px 0px 2px; } div.diffblock .code-header div{ margin-left:4px; @@ -4092,4 +4121,4 @@ cursor: auto !important; background-color: inherit !important; -} \ No newline at end of file +} diff -r d832f2bbb466 -r 395a3196de73 rhodecode/public/js/graph.js --- a/rhodecode/public/js/graph.js Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/public/js/graph.js Mon Jan 09 09:37:15 2012 +0200 @@ -63,18 +63,14 @@ var rela = document.getElementById('graph'); var pad = pad; var scale = 22; - + for (var i in data) { this.scale(scale); + var row = document.getElementById("chg_"+idx); var next = document.getElementById("chg_"+(idx+1)); var extra = 0; - //skip this since i don't have DATE in my app - //if (next.is('.changesets-date')) { - // extra = next.outerHeight(); - //} - this.cell[1] += row.clientWidth; this.bg[1] += this.bg_height; @@ -102,6 +98,7 @@ } this.setColor(color, 0.0, 0.65); + x = pad-((this.cell[0] + this.box_size * start - 1) + this.bg_height-2); @@ -128,6 +125,7 @@ color = node[1] radius = this.dot_radius; + x = pad-(Math.round(this.cell[0] * scale/2 * column + radius) + 15 - (column*4)); this.ctx.beginPath(); diff -r d832f2bbb466 -r 395a3196de73 rhodecode/public/js/rhodecode.js --- a/rhodecode/public/js/rhodecode.js Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/public/js/rhodecode.js Mon Jan 09 09:37:15 2012 +0200 @@ -657,7 +657,6 @@ return name } var get_date = function(node){ - console.log(node.firstElementChild) var date_ = node.firstElementChild.innerHTML; return date_ } diff -r d832f2bbb466 -r 395a3196de73 rhodecode/templates/changelog/changelog.html --- a/rhodecode/templates/changelog/changelog.html Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/templates/changelog/changelog.html Mon Jan 09 09:37:15 2012 +0200 @@ -44,11 +44,11 @@ %for cnt,cs in enumerate(c.pagination): -
+
${h.checkbox(cs.short_id,class_="changeset_range")} - ${cs.revision}:${h.short_id(cs.raw_id)} + ${cs.revision}:${h.short_id(cs.raw_id)}
@@ -56,9 +56,11 @@
${h.person(cs.author)}
+
${cs.date}
-
${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
+
${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}
+
↓ ${_('show more')} ↓
@@ -132,6 +134,34 @@ } }); + var msgs = YUQ('.message'); + // get firts element height; + var el = YUQ('.container')[0]; + var row_h = el.clientHeight; + for(var i=0;i row_h){ + YUD.setStyle(m.nextElementSibling,'display','block'); + YUD.setStyle(m.nextElementSibling,'margin-top',row_h-(h+14)+'px'); + YUD.setAttribute(m.nextElementSibling,'expand',h); + }; + } + YUE.on(YUQ('.expand'),'click',function(e){ + var elem = e.currentTarget.parentElement.parentElement; + YUD.setStyle(e.currentTarget,'display','none'); + YUD.setStyle(elem,'height',YUD.getAttribute(e.currentTarget,'expand')+'px'); + + //redraw the graph max_w and jsdata are global vars + set_canvas(max_w); + + var r = new BranchRenderer(); + r.render(jsdata,max_w); + + }) + // Fetch changeset details YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ var id = e.currentTarget.id @@ -143,7 +173,6 @@ // change branch filter YUE.on(YUD.get('branch_filter'),'change',function(e){ var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; - console.log(selected_branch); var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; var url = url.replace('__BRANCH__',selected_branch); @@ -188,4 +217,4 @@ %endif
- \ No newline at end of file + diff -r d832f2bbb466 -r 395a3196de73 rhodecode/templates/changeset/changeset.html --- a/rhodecode/templates/changeset/changeset.html Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/templates/changeset/changeset.html Mon Jan 09 09:37:15 2012 +0200 @@ -27,15 +27,15 @@
-
${c.changeset.revision}: - ${h.link_to(h.short_id(c.changeset.raw_id),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} +
+ R${c.changeset.revision}:${h.link_to(h.short_id(c.changeset.raw_id),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} ${c.changeset.date}
- - - +
+ + ${c.ignorews_url()} ${c.context_url()} - +
${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})
@@ -49,7 +49,7 @@ ${h.person(c.changeset.author)}
${h.email_or_none(c.changeset.author)}
-
${h.urlify_commit(h.wrap_paragraphs(c.changeset.message))}
+
${h.urlify_commit(h.wrap_paragraphs(c.changeset.message),c.repo_name)}
@@ -138,15 +138,11 @@ YUE.on(YUQ('.show-inline-comments'),'change',function(e){ var show = 'none'; var target = e.currentTarget; - console.log(target); if(target.checked){ var show = '' } - console.log('aa') var boxid = YUD.getAttribute(target,'id_for'); - console.log(boxid); var comments = YUQ('#{0} .inline-comments'.format(boxid)); - console.log(comments) for(c in comments){ YUD.setStyle(comments[c],'display',show); } diff -r d832f2bbb466 -r 395a3196de73 rhodecode/templates/changeset/changeset_range.html --- a/rhodecode/templates/changeset/changeset_range.html Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/templates/changeset/changeset_range.html Mon Jan 09 09:37:15 2012 +0200 @@ -41,7 +41,7 @@ ${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
${h.person(cs.author)}
${cs.date} -
${h.urlify_commit(h.wrap_paragraphs(cs.message))}
+
${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}
%endfor diff -r d832f2bbb466 -r 395a3196de73 rhodecode/templates/changeset/diff_block.html --- a/rhodecode/templates/changeset/diff_block.html Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/templates/changeset/diff_block.html Mon Jan 09 09:37:15 2012 +0200 @@ -15,13 +15,13 @@ ${h.link_to_if(change!='removed',h.safe_unicode(filenode.path),h.url('files_home',repo_name=c.repo_name, revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))}
- - - - +
+ + + ${c.ignorews_url(h.FID(filenode.changeset.raw_id,filenode.path))} ${c.context_url(h.FID(filenode.changeset.raw_id,filenode.path))} - +