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
116
108
# action=svncommit: Commit a file(s) or directory(s) to the repository.
117
109
# path: The path to the file or directory to be committed. Can be
118
110
# specified multiple times. Directories are committed
438
430
except pysvn.ClientError:
439
431
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.
443
Should only be called on directories (only effective on directories
448
paths = fields.getlist('path')
449
paths = map(lambda path: actionpath_to_local(req, path), paths)
453
# Note: Property value doesn't matter
454
svnclient.propset("ivle:published", "", path, recurse=False)
455
except pysvn.ClientError:
456
raise ActionError("One or more files could not be updated")
458
def action_svnunpublish(req, fields):
459
"""Deletes svn property "ivle:published" on each file specified.
463
paths = fields.getlist('path')
464
paths = map(lambda path: actionpath_to_local(req, path), paths)
468
svnclient.propdel("ivle:published", path, recurse=False)
469
except pysvn.ClientError:
470
raise ActionError("One or more files could not be updated")
472
433
def action_svncommit(req, fields):
473
434
"""Performs a "svn commit" to each file specified.
499
460
"svnadd" : action_svnadd,
500
461
"svnupdate" : action_svnupdate,
501
462
"svnrevert" : action_svnrevert,
502
"svnpublish" : action_svnpublish,
503
"svnunpublish" : action_svnunpublish,
504
463
"svncommit" : action_svncommit,