Add selector for VCS type. Publish project:created.
authorGordon P. Hemsley <gphemsley@gmail.com>
Thu, 02 Jul 2009 15:59:47 -0400
changeset 2046 900841e4e52979dab23e4c0ad341e1f90ff35253
parent 2025 3f40541b2a41994941c21a5f76c9b35f2a6c4735
child 2047 cef488528a5129f98c9aaddd9e4c15cf593a8182
push id936
push userkdangoor@mozilla.com
push dateThu, 09 Jul 2009 12:29:11 +0000
Add selector for VCS type. Publish project:created.
frontend/js/bespin/vcs.js
--- a/frontend/js/bespin/vcs.js
+++ b/frontend/js/bespin/vcs.js
@@ -176,16 +176,22 @@ bespin.vcs.commands.addCommand({
                 + '<input type="password" name="kcpass" id="kcpass"></td></tr>'
 
                 + '<tr><td>URL:</td>'
                 + '<td><input type="text" name="source" value="' + url + '" style="width: 85%"></td></tr>'
 
                 + '<tr><td>Project name:</td>'
                 + '<td><input type="text" name="dest" value=""> (defaults to last part of URL path)</td></tr>'
 
+                + '<tr><td>VCS Type:</td><td><select name="vcs" id="vcs">'
+                + '<option value="">Auto-detect from URL</option>'
+                + '<option value="hg">Mercurial (hg)</option>'
+                + '<option value="svn">Subversion (svn)</option>'
+                + '</select></td></tr>'
+
                 + '<tr><td>Authentication:</td><td><select name="remoteauth" id="remoteauth">'
                 + '<option value="">None (read-only access to the remote repo)</option>'
                 + '<option value="write">Only for writing</option>'
                 + '<option value="both">For reading and writing</option>'
                 + '</select></td></tr>'
 
                 + '<tr id="push_row" style="display:none" class="authfields"><td>Push to URL</td>'
                 + '<td><input type="text" name="push" style="width: 85%" value="' + url + '"></td></tr>'
@@ -248,17 +254,17 @@ bespin.vcs.commands.addCommand({
                 delete data.username;
                 delete data.password;
             } else {
                 if (data.authtype == "ssh") {
                     delete data.password;
                 }
             }
             data = dojo.objectToQuery(data);
-            bespin.get('server').clone(data, instruction, bespin.vcs._createStandardHandler(instruction));
+            bespin.get('server').clone(data, instruction, bespin.vcs._createStandardHandler(instruction), { onSuccess: function() { bespin.publish("project:created", { project: project }) } });
         }));
 
         dojo.byId("kcpass").focus();
     }
 });
 
 /**
  * Commit command.