Merge ~twom/launchpad:friendly-git-ref-names into launchpad:master

Proposed by Tom Wardill
Status: Merged
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~twom/launchpad:friendly-git-ref-names
Merge into: launchpad:master
Diff against target: 17 lines (+4/-2)
1 file modified
lib/lp/code/browser/gitref.py (+4/-2)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+380300@code.launchpad.net

Commit message

Make target branch a more friendly name

Description of the change

Remove the refs/heads from the start of the default target name as it looks a bit unfriendly.
Use the same method as GitRefMixin.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/code/browser/gitref.py b/lib/lp/code/browser/gitref.py
2index edbb0bf..99d4882 100644
3--- a/lib/lp/code/browser/gitref.py
4+++ b/lib/lp/code/browser/gitref.py
5@@ -287,8 +287,10 @@ class GitRefRegisterMergeProposalView(LaunchpadFormView):
6 None)
7 # If we have a target, and the user hasn't entered a value.
8 if term and not self.widgets['target_git_path'].hasInput():
9- self.widgets['target_git_path'].setRenderedValue(
10- term.value.default_branch)
11+ branch_display = term.value.default_branch
12+ if branch_display.startswith("refs/heads/"):
13+ branch_display = branch_display[len("refs/heads/"):]
14+ self.widgets['target_git_path'].setRenderedValue(branch_display)
15
16 @action('Propose Merge', name='register',
17 failure=LaunchpadFormView.ajax_failure_handler)

Subscribers

People subscribed via source and target branches

to status/vote changes: