Changeset - 494eab6ec837
[Not reviewed]
default
0 2 0
Mads Kiilerich - 12 years ago 2014-07-04 14:12:06
madski@unity3d.com
pull requests: shorten revision numbers in automatic titles

- but it would perhaps be better to use branch names ...
2 files changed with 9 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -366,7 +366,7 @@ class PullrequestsController(BaseRepoCon
 
        org_repo_name = _form['org_repo']
 
        org_ref = _form['org_ref'] # will have merge_rev as rev but symbolic name
 
        org_repo = RepoModel()._get_repo(org_repo_name)
 
        (_org_ref_type,
 
        (org_ref_type,
 
         org_ref_name,
 
         org_rev) = org_ref.split(':')
 

	
 
@@ -392,7 +392,8 @@ class PullrequestsController(BaseRepoCon
 

	
 
        title = _form['pullrequest_title']
 
        if not title:
 
            title = '%s#%s to %s#%s' % (org_repo_name, org_ref_name, other_repo_name, other_ref_name)
 
            title = '%s#%s to %s#%s' % (org_repo_name, h.short_ref(org_ref_type, org_ref_name),
 
                                        other_repo_name, h.short_ref(other_ref_type, other_ref_name))
 
        description = _form['pullrequest_desc'].strip() or _('No description')
 
        try:
 
            pull_request = PullRequestModel().create(
kallithea/lib/helpers.py
Show inline comments
 
@@ -1379,6 +1379,11 @@ def rst_w_mentions(source):
 
    return literal('<div class="rst-block">%s</div>' %
 
                   MarkupRenderer.rst_with_mentions(source))
 

	
 
def short_ref(ref_type, ref_name):
 
    if ref_type == 'rev':
 
        return short_id(ref_name)
 
    return ref_name
 

	
 
def link_to_ref(repo_name, ref_type, ref_name, rev=None):
 
    """
 
    Return full markup for a href to changeset_home for a changeset.
 
@@ -1386,10 +1391,7 @@ def link_to_ref(repo_name, ref_type, ref
 
    ref_name is shortened if ref_type is 'rev'.
 
    if rev is specified show it too, explicitly linking to that revision.
 
    """
 
    if ref_type == 'rev':
 
        txt = short_id(ref_name)
 
    else:
 
        txt = ref_name
 
    txt = short_ref(ref_type, ref_name)
 
    if ref_type == 'branch':
 
        u = url('changelog_home', repo_name=repo_name, branch=ref_name)
 
    else:
0 comments (0 inline, 0 general)