105
105
# path: The path to the file to be updated. Only one file may be
108
# action=svnpublish: Set the "published" flag on a file to True.
109
# path: The path to the file to be published. Can be specified
112
# action=svnunpublish: Set the "published" flag on a file to False.
113
# path: The path to the file to be unpublished. Can be specified
108
116
# action=svncommit: Commit a file(s) or directory(s) to the repository.
109
117
# path: The path to the file or directory to be committed. Can be
110
118
# specified multiple times. Directories are committed
430
438
except pysvn.ClientError:
431
439
raise ActionError("One or more files could not be reverted")
441
def action_svnpublish(req, fields):
442
"""Sets svn property "ivle:published" on each file specified.
446
paths = fields.getlist('path')
447
paths = map(lambda path: actionpath_to_local(req, path), paths)
451
# Note: Property value doesn't matter
452
svnclient.propset("ivle:published", "", path, recurse=False)
453
except pysvn.ClientError:
454
raise ActionError("One or more files could not be updated")
456
def action_svnunpublish(req, fields):
457
"""Deletes svn property "ivle:published" on each file specified.
461
paths = fields.getlist('path')
462
paths = map(lambda path: actionpath_to_local(req, path), paths)
466
svnclient.propdel("ivle:published", path, recurse=False)
467
except pysvn.ClientError:
468
raise ActionError("One or more files could not be updated")
433
470
def action_svncommit(req, fields):
434
471
"""Performs a "svn commit" to each file specified.
460
497
"svnadd" : action_svnadd,
461
498
"svnupdate" : action_svnupdate,
462
499
"svnrevert" : action_svnrevert,
500
"svnpublish" : action_svnpublish,
501
"svnunpublish" : action_svnunpublish,
463
502
"svncommit" : action_svncommit,