- # save the changes to a local branch
-# repo.write_lock()
- print request.user
-# repo.switch_to_branch(request.user.name)
-# repo.add_file(path, form.cleaned_data['text'])
-
- # add references to comment
- issues = _get_issues_for_file(path)
- commit_message = _add_references(form.cleaned_data['commit_message'], issues)
- print 'Commiting with: ' + commit_message
-
-# repo.commit(message=commit_message, user=form.cleaned_data['user'])
- return HttpResponse( json.dumps({'message': commit_message}) )
+ print 'Saving whole text.', request.user.username
+ def save_action():
+ repo.add_file(path, form.cleaned_data['content'])
+ repo.commit(message='Local save at %s' % time.ctime(), user=request.user.username)
+
+ repo.in_branch('local_'+request.user.username, save_action);
+ return HttpResponse( json.dumps({'result': 'ok', 'errors': []}) );