# HG changeset patch # User Mads Kiilerich # Date 1479246821 -3600 # Node ID 73654990ba75b5b8e3c04261f64bad4e515706bf # Parent 8076de6f78af1a6e559eb2b944f85366525b8880 pullrequests: fix 'upgrade' from revision to branch when creating PR This will do that the default title for the PR created from a non-head revision will contain a short hash instead a long. org_ref_type was set to 'branch' while org_ref_name remained the full hash. h.short_ref would thus not truncate. Instead, we keep the org_ref_type as 'rev' while storing the branch name in the database. diff -r 8076de6f78af -r 73654990ba75 kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py Tue Nov 15 22:53:41 2016 +0100 +++ b/kallithea/controllers/pullrequests.py Tue Nov 15 22:53:41 2016 +0100 @@ -328,9 +328,8 @@ org_ref_name, org_rev) = org_ref.split(':') if org_ref_type == 'rev': - org_ref_type = 'branch' cs = org_repo.scm_instance.get_changeset(org_rev) - org_ref = '%s:%s:%s' % (org_ref_type, cs.branch, cs.raw_id) + org_ref = 'branch:%s:%s' % (cs.branch, cs.raw_id) other_repo_name = _form['other_repo'] other_ref = _form['other_ref'] # will have symbolic name and head revision