~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/fileservice/action.py

  • Committer: mattgiuca
  • Date: 2008-01-10 07:47:34 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:168
fileservice: Added action svncommit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
427
427
    except pysvn.ClientError:
428
428
        raise ActionError("One or more files could not be reverted")
429
429
 
 
430
def action_svncommit(req, fields):
 
431
    """Performs a "svn commit" to each file specified.
 
432
 
 
433
    Reads fields: 'path' (multiple), 'logmsg' (optional)
 
434
    """
 
435
    paths = fields.getlist('path')
 
436
    paths = map(lambda path: actionpath_to_local(req, str(path)), paths)
 
437
    logmsg = str(fields.getfirst('logmsg', DEFAULT_LOGMESSAGE))
 
438
    if logmsg == '': logmsg = DEFAULT_LOGMESSAGE
 
439
 
 
440
    try:
 
441
        svnclient.checkin(paths, logmsg, recurse=True)
 
442
    except pysvn.ClientError:
 
443
        raise ActionError("One or more files could not be committed")
 
444
 
430
445
# Table of all action functions #
431
446
# Each function has the interface f(req, fields).
432
447
 
442
457
    "svnadd" : action_svnadd,
443
458
    "svnupdate" : action_svnupdate,
444
459
    "svnrevert" : action_svnrevert,
 
460
    "svncommit" : action_svncommit,
445
461
}