Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

vcs commit now provides an input box for entering commit messages

(no more single line commit messages, yay :)

also bumps the requirement for uvc to the new 0.3 release which adds svn
support.
  • Loading branch information...
commit 2d26d93443345bfa59b759d3ef378b496dfeb26b 1 parent c6d518d
@bespin authored
Showing with 36 additions and 18 deletions.
  1. +35 −17 frontend/js/bespin/vcs.js
  2. +1 −1  requirements.txt
View
52 frontend/js/bespin/vcs.js
@@ -287,32 +287,50 @@ bespin.vcs.commands.addCommand({
/**
* Commit command.
- * Commit the specified files or all outstanding changes
+ * Commit all outstanding changes
*/
bespin.vcs.commands.addCommand({
name: 'commit',
takes: ['message'],
aliases: [ 'ci' ],
- preview: 'Commit to the repository',
+ preview: 'Commit to the local (in-bespin) repository',
execute: function(instruction, message) {
- if (!message) {
- instruction.addErrorOutput("You must enter a log message");
- return;
- }
- var project;
+ var doCommit = function(message) {
+ var project;
- bespin.withComponent('editSession', function(editSession) {
- project = editSession.project;
- });
+ bespin.withComponent('editSession', function(editSession) {
+ project = editSession.project;
+ });
- if (!project) {
- instruction.addErrorOutput("You need to pass in a project");
- return;
+ if (!project) {
+ instruction.addErrorOutput("You need to pass in a project");
+ return;
+ }
+ bespin.get('server').vcs(project,
+ { command: [ 'commit', '-m', message ] },
+ instruction,
+ bespin.vcs._createStandardHandler(instruction));
+ }
+
+ if (!message) {
+ var messageForm = dojo.create("form", {onsubmit:
+ function() {
+ doCommit(messagefield.value);
+ instruction.unlink();
+ instruction.commandLine.focus();
+ }});
+ dojo.create("div", {}, messageForm).innerHTML = "Commit message:<br>";
+ var messagefield = dojo.create("textarea", {rows: 5, cols: 65},
+ messageForm);
+ dojo.create("div", {}, messageForm).innerHTML = "<br>";
+ dojo.create("input", {type: "submit"}, messageForm);
+
+ instruction.setElement(messageForm);
+
+ setTimeout(function() { messagefield.focus() }, 10);
+ } else {
+ doCommit(message);
}
- bespin.get('server').vcs(project,
- { command: [ 'commit', '-m', message ] },
- instruction,
- bespin.vcs._createStandardHandler(instruction));
}
});
View
2  requirements.txt
@@ -11,4 +11,4 @@ virtualenv
http://httplib2.googlecode.com/files/httplib2-0.4.0.tar.gz
http://pypi.python.org/packages/source/p/path.py/path-2.2.zip#md5=941660081788282887f652510d80e64e
PyCrypto
-uvc>0.2.1
+uvc>=0.3
Please sign in to comment.
Something went wrong with that request. Please try again.