Changeset - 395a3196de73
[Not reviewed]
CONTRIBUTORS
Show inline comments
 
@@ -15,4 +15,4 @@ List of contributors to RhodeCode projec
 
    Les Peabody <lpeabody@gmail.com>
 
    Jonas Oberschweiber <jonas.oberschweiber@d-velop.de>
 
    Matt Zuba <matt.zuba@goodwillaz.org>
 
    
 
\ No newline at end of file
 
    Aras Pranckevicius <aras@unity3d.com>
 
\ No newline at end of file
development.ini
Show inline comments
 
@@ -74,17 +74,17 @@ proxypass_auth_enabled = false
 
## 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><id>
 

	
 
#issue_prefix = #
 
issue_prefix = #
 

	
 

	
 
####################################
docs/changelog.rst
Show inline comments
 
@@ -33,8 +33,9 @@ news
 
- 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
 
-----
docs/setup.rst
Show inline comments
 
@@ -434,16 +434,19 @@ messages and replace that with an url to
 
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 #<number> 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 
 
`<a href="https://myissueserver.com/issue/300">ISSUE-300</a>`  
 
`url_pat` is the regular expression that will fetch issues from commit messages.
 
Default regex will match issues in format of #<number> 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::
 
 
 
  <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a>  
 

	
 
Hook management
 
---------------
production.ini
Show inline comments
 
@@ -77,9 +77,9 @@ proxypass_auth_enabled = false
 
#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><id>
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -77,9 +77,9 @@ proxypass_auth_enabled = false
 
#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><id>
rhodecode/controllers/admin/repos.py
Show inline comments
 
@@ -278,7 +278,7 @@ class ReposController(BaseController):
 
        return redirect(url('repos'))
 

	
 

	
 
    @HasRepoPermissionAllDecorator('repository.admin')   
 
    @HasRepoPermissionAllDecorator('repository.admin')
 
    def delete_perm_user(self, repo_name):
 
        """
 
        DELETE an existing repository permission user
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -37,8 +37,7 @@ from rhodecode.lib.base import BaseRepoC
 
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 @@ class ChangelogController(BaseRepoContro
 

	
 
    def index(self):
 
        limit = 100
 
        default = 40
 
        default = 20
 
        if request.params.get('size'):
 
            try:
 
                int_size = int(request.params.get('size'))
rhodecode/lib/helpers.py
Show inline comments
 
@@ -739,36 +739,42 @@ def urlify_text(text_):
 

	
 
    def url_func(match_obj):
 
        url_full = match_obj.groups()[0]
 
        return '<a href="%(url)s">%(url)s</a>' % ({'url':url_full})
 
        return '<a href="%(url)s">%(url)s</a>' % ({'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 = (
 
                '<a class="%(cls)s" href="%(url)s">'
 
                ' %(issue-prefix)s%(id-repr)s'
 
                ' <a class="%(cls)s" href="%(url)s">'
 
                '%(issue-prefix)s%(id-repr)s'
 
                '</a>'
 
                )
 
                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 @@ def urlify_commit(text_):
 

	
 
    return text_
 

	
 

	
 
def rst(source):
 
    return literal('<div class="rst-block">%s</div>' %
 
                   MarkupRenderer.rst(source))
 

	
 

	
 
def rst_w_mentions(source):
 
    """
 
    Wrapped rst renderer with @mention highlighting
rhodecode/lib/rcmail/response.py
Show inline comments
 
@@ -141,7 +141,7 @@ class MailResponse(object):
 
    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
rhodecode/public/css/style.css
Show inline comments
 
@@ -1130,7 +1130,27 @@ tbody .yui-dt-editable { cursor: pointer
 
	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 @@ h3.files_location {
 
	padding: 5px !important;
 
}
 
 
.tablerow0 {
 
	background-color: #F8F8F8;
 
}
 
 
.tablerow1 {
 
	background-color: #F8F8F8;
 
    background-color: #FFFFFF;
 
}
 
 
.changeset_id {
 
@@ -2246,7 +2270,7 @@ h3.files_location {
 
}
 
 
#graph_content #rev_range_container {
 
	padding: 5px 20px;
 
	padding: 7px 20px;
 
	float: left;
 
}
 
 
@@ -2276,6 +2300,7 @@ h3.files_location {
 
 
#graph_content .container .left .date {
 
	color: #444444;
 
	padding-left: 22px;
 
}
 
 
#graph_content .container .left .author {
 
@@ -2532,7 +2557,10 @@ table.code-browser .browser-file {
 
    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-title{
 
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 @@ table.code-difftable .code pre{
 
	cursor: auto !important;
 
	background-color: inherit !important;
 
	
 
}
 
\ No newline at end of file
 
}
rhodecode/public/js/graph.js
Show inline comments
 
@@ -63,18 +63,14 @@ function BranchRenderer() {
 
		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 @@ function BranchRenderer() {
 
				}
 
				
 
				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 @@ function BranchRenderer() {
 
			color = node[1]
 
			
 
			radius = this.dot_radius;
 

	
 
			x = pad-(Math.round(this.cell[0] * scale/2 * column + radius) + 15 - (column*4));
 
		
 
			this.ctx.beginPath();
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -657,7 +657,6 @@ var get_group_name = function(node){
 
	return name
 
}
 
var get_date = function(node){
 
	console.log(node.firstElementChild)
 
	var date_ = node.firstElementChild.innerHTML;
 
	return date_
 
}
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -44,11 +44,11 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
					</div>
 
					
 
				%for cnt,cs in enumerate(c.pagination):
 
					<div id="chg_${cnt+1}" class="container ${'tablerow1' if cnt%2==0 else 'tablerow2'}">
 
					<div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}">
 
						<div class="left">
 
							<div>
 
							${h.checkbox(cs.short_id,class_="changeset_range")}
 
							<span class="tooltip" title="${cs.date}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span>
 
							<span class="tooltip" title="${h.age(cs.date)}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span>
 
							</div>
 
							<div class="author">
 
								<div class="gravatar">
 
@@ -56,9 +56,11 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
								</div>
 
								<div title="${cs.author}" class="user">${h.person(cs.author)}</div>
 
							</div>
 
                            <div class="date">${cs.date}</div>
 
						</div>
 
						<div class="mid">
 
							<div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
 
                            <div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div>
 
                            <div class="expand ${'tablerow%s' % (cnt%2)}">&darr; ${_('show more')} &darr;</div>
 
						</div>	
 
						<div class="right">
 
									<div id="${cs.raw_id}_changes_info" class="changes">
 
@@ -132,6 +134,34 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
                        }
 
                    });					
 
					
 
                    var msgs = YUQ('.message');
 
                    // get firts element height;
 
                    var el = YUQ('.container')[0];
 
                    var row_h = el.clientHeight;
 
                    for(var i=0;i<msgs.length;i++){
 
                    	var m = msgs[i];
 

	
 
                    	var h = m.clientHeight;
 
                    	var pad = YUD.getStyle(m,'padding');
 
                    	if(h > 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 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
                    // 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 @@ ${c.repo_name} ${_('Changelog')} - ${c.r
 
		%endif  
 
    </div>
 
</div>    
 
</%def>
 
\ No newline at end of file
 
</%def>
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -27,15 +27,15 @@
 
    <div class="table">
 
		<div class="diffblock">
 
			<div class="code-header">
 
                <div class="date">${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))}
 
                <div class="date">
 
                  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}</div>
 
                <span class="diff-actions">
 
                  <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show')}" title="${_('raw diff')}"><img class="icon" src="${h.url('/images/icons/page_white_text.png')}"/></a>
 
                  <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" title="${_('download diff')}"><img class="icon" src="${h.url('/images/icons/down_16.png')}"/></a>
 
                <div class="diff-actions">
 
                  <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show')}" title="${_('raw diff')}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
 
                  <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" title="${_('download diff')}"><img class="icon" src="${h.url('/images/icons/page_white_get.png')}"/></a>
 
                  ${c.ignorews_url()}
 
                  ${c.context_url()}
 
                </span>
 
                </div>
 
                <div class="comments-number" style="float:right;padding-right:5px">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div>
 
			</div>
 
		</div>
 
@@ -49,7 +49,7 @@
 
	                     <span>${h.person(c.changeset.author)}</span><br/>
 
	                     <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/>
 
	                 </div>
 
	                 <div class="message">${h.urlify_commit(h.wrap_paragraphs(c.changeset.message))}</div>
 
	                 <div class="message">${h.urlify_commit(h.wrap_paragraphs(c.changeset.message),c.repo_name)}</div>
 
	             </div>
 
	             <div class="right">
 
		             <div class="changes">
 
@@ -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);
 
              }
rhodecode/templates/changeset/changeset_range.html
Show inline comments
 
@@ -41,7 +41,7 @@
 
                <td>${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))}</td>
 
                <td><div class="author">${h.person(cs.author)}</div></td>
 
                <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td>
 
                <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message))}</div></td>
 
                <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td>
 
                </tr>
 
            %endfor
 
            </table>
rhodecode/templates/changeset/diff_block.html
Show inline comments
 
@@ -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)))}
 
                </div>
 
                <span class="diff-actions">
 
                  <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff',fulldiff=1)}" title="${_('diff')}"><img class="icon" src="${h.url('/images/icons/page_white_text.png')}"/></a>
 
                  <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw')}" title="${_('raw diff')}"><img class="icon" src="${h.url('/images/icons/page_white_text.png')}"/></a>
 
                  <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download')}" title="${_('download diff')}"><img class="icon" src="${h.url('/images/icons/down_16.png')}"/></a>
 
                <div class="diff-actions">
 
                  <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff',fulldiff=1)}" title="${_('diff')}"><img class="icon" src="${h.url('/images/icons/page_white_go.png')}"/></a>
 
                  <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw')}" title="${_('raw diff')}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
 
                  <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download')}" title="${_('download diff')}"><img class="icon" src="${h.url('/images/icons/page_white_get.png')}"/></a>
 
                  ${c.ignorews_url(h.FID(filenode.changeset.raw_id,filenode.path))}
 
                  ${c.context_url(h.FID(filenode.changeset.raw_id,filenode.path))}
 
                </span>
 
                </div>
 
                <span style="float:right;margin-top:-3px">
 
                  <label>
 
                  ${_('show inline comments')}
0 comments (0 inline, 0 general)