← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jcsackett/launchpad/branch-name-or-branch-location into lp:launchpad

 

j.c.sackett has proposed merging lp:~jcsackett/launchpad/branch-name-or-branch-location into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jcsackett/launchpad/branch-name-or-branch-location/+merge/91897

Summary
=======
After landing a quick fix to update the preview branch from
~name/project/branch to lp:~name/project/branch, Aaron Bentley correctly
pointed out that the code was reference branch name, but its was for branch
location.

This branch updates the code to reference location rather than name, as that
is more correct, and consistent with adding the 'lp:~' to the preview.
-- 
https://code.launchpad.net/~jcsackett/launchpad/branch-name-or-branch-location/+merge/91897
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/branch-name-or-branch-location into lp:launchpad.
=== modified file 'lib/lp/code/javascript/util.js'
--- lib/lp/code/javascript/util.js	2012-02-03 21:29:22 +0000
+++ lib/lp/code/javascript/util.js	2012-02-07 18:42:22 +0000
@@ -9,15 +9,15 @@
 YUI.add('lp.code.util', function(Y) {
 var ns = Y.namespace('lp.code.util');
 
-var update_branch_unique_name = function() {
-    var unique_name = Y.one("#branch-unique-name");
+var update_branch_unique_location = function() {
+    var unique_location = Y.one("#branch-unique-location");
     var owner = Y.one("[id='field.owner']").get('value');
     var name = Y.one("[id='field.name']").get('value');
-    if (name == '') {
+    if (name === '') {
         name = '<name>';
     }
-    var branch_name = "lp:~" + owner + "/" + target_name + "/" + name;
-    unique_name.set('text', branch_name);
+    var branch_location = "lp:~" + owner + "/" + target_name + "/" + name;
+    unique_location.set('text', branch_name);
 };
 
 var hookUpBranchFieldFunctions = function () {
@@ -39,7 +39,7 @@
     Y.one("[id='field.lifecycle']").on('change', submit_filter);
     var sortby = Y.one("[id='field.sort_by']");
     if (Y.Lang.isValue(sortby)) {
-        sortby.on('change', submit_filter)
+        sortby.on('change', submit_filter);
     }
 };
 

=== modified file 'lib/lp/code/templates/branch-form-macros.pt'
--- lib/lp/code/templates/branch-form-macros.pt	2012-02-01 15:31:32 +0000
+++ lib/lp/code/templates/branch-form-macros.pt	2012-02-07 18:42:22 +0000
@@ -5,9 +5,9 @@
 
 <metal:add-branch define-macro="add-branch-content">
 
-  <div id="branch-unique-name-div" class="hidden">
+  <div id="branch-unique-location-div" class="hidden">
     The resulting location of the branch will be:
-    <strong><span id="branch-unique-name"></span></strong> (<a href="/+help-code/register-branch.html" target="help">Do you need to register?</a>)
+    <strong><span id="branch-unique-location"></span></strong> (<a href="/+help-code/register-branch.html" target="help">Do you need to register?</a>)
   </div>
 
   <div metal:use-macro="context/@@launchpad_form/form">