diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -930,6 +930,25 @@ class Repository(Base, BaseModel): def last_db_change(self): return self.updated_on + def clone_url(self, **override): + from pylons import url + from urlparse import urlparse + import urllib + parsed_url = urlparse(url('home', qualified=True)) + default_clone_uri = '%(scheme)s://%(user)s%(pass)s%(netloc)s%(prefix)s%(path)s' + decoded_path = safe_unicode(urllib.unquote(parsed_url.path)) + args = { + 'user': '', + 'pass': '', + 'scheme': parsed_url.scheme, + 'netloc': parsed_url.netloc, + 'prefix': decoded_path, + 'path': self.repo_name + } + + args.update(override) + return default_clone_uri % args + #========================================================================== # SCM PROPERTIES #========================================================================== @@ -1794,6 +1813,14 @@ class PullRequest(Base, BaseModel): def revisions(self, val): self._revisions = ':'.join(val) + @property + def org_ref_parts(self): + return self.org_ref.split(':') + + @property + def other_ref_parts(self): + return self.other_ref.split(':') + author = relationship('User', lazy='joined') reviewers = relationship('PullRequestReviewers', cascade="all, delete, delete-orphan") diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css +++ b/rhodecode/public/css/style.css @@ -2778,7 +2778,9 @@ h3.files_location { margin: 0px 2px; } -.right .logtags .branchtag,.logtags .branchtag { +.right .logtags .branchtag, +.logtags .branchtag, +.spantag { padding: 1px 3px 1px 3px; background-color: #bfbfbf; font-size: 10px; diff --git a/rhodecode/templates/pullrequests/pullrequest_show.html b/rhodecode/templates/pullrequests/pullrequest_show.html --- a/rhodecode/templates/pullrequests/pullrequest_show.html +++ b/rhodecode/templates/pullrequests/pullrequest_show.html @@ -51,6 +51,24 @@ %endif +
+
+ +
+
+
+ ##%if h.is_hg(c.pull_request.org_repo): + ## ${_('Mercurial repository')} + ##%elif h.is_git(c.pull_request.org_repo): + ## ${_('Git repository')} + ##%endif + ${c.pull_request.org_ref_parts[0]} + : + ${c.pull_request.org_ref_parts[1]} + ${c.pull_request.org_repo.clone_url()} +
+
+
${h.literal(c.pull_request.description)}