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

« back to all changes in this revision

Viewing changes to lib/fileservice_lib/action.py

  • Committer: Matt Giuca
  • Date: 2010-02-18 08:33:51 UTC
  • Revision ID: matt.giuca@gmail.com-20100218083351-l6be6fpe244u2x4c
svnlogservice: utf-8 decoding of the relevant parts of the dictionary, so they are put into JSON as unicode strings, not UTF-8 strings which are decoded wrongly. svnlog now displays unicode characters correctly. This is the final fix in Launchpad Bug #523495 -- all Subversion filename issues fixed (except the crash on log and diff directly on a non-ASCII filename, covered by bug #523500).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# IVLE
2
 
# Copyright (C) 2007-2008 The University of Melbourne
3
 
#
4
 
# This program is free software; you can redistribute it and/or modify
5
 
# it under the terms of the GNU General Public License as published by
6
 
# the Free Software Foundation; either version 2 of the License, or
7
 
# (at your option) any later version.
8
 
#
9
 
# This program is distributed in the hope that it will be useful,
10
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
# GNU General Public License for more details.
13
 
#
14
 
# You should have received a copy of the GNU General Public License
15
 
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
 
 
18
 
# Module: File Service / Action
19
 
# Author: Matt Giuca
20
 
# Date: 10/1/2008
21
 
 
22
 
# Handles actions requested by the client as part of the 2-stage process of
23
 
# fileservice (the second part being the return listing).
24
 
 
25
 
### Actions ###
26
 
 
27
 
# The most important argument is "action". This determines which action is
28
 
# taken. Note that action, and all other arguments, are ignored unless the
29
 
# request is a POST request. The other arguments depend upon the action.
30
 
# Note that paths are often specified as arguments. Paths that begin with a
31
 
# slash are taken relative to the user's home directory (the top-level
32
 
# directory seen when fileservice has no arguments or path). Paths without a
33
 
# slash are taken relative to the specified path.
34
 
 
35
 
# action=remove: Delete a file(s) or directory(s) (recursively).
36
 
#       path:   The path to the file or directory to delete. Can be specified
37
 
#               multiple times.
38
 
#
39
 
# action=move: Move or rename a file or directory.
40
 
#       from:   The path to the file or directory to be renamed.
41
 
#       to:     The path of the target filename. Error if the file already
42
 
#               exists.
43
 
#
44
 
# action=putfile: Upload a file to the student workspace, and optionally
45
 
#               accept zip files which will be unpacked.
46
 
#       path:   The path to the file to be written. If it exists, will
47
 
#               overwrite. Error if the target file is a directory.
48
 
#       data:   Bytes to be written to the file verbatim. May either be
49
 
#               a string variable or a file upload.
50
 
#       unpack: Optional. If "true", and the data is a valid ZIP file,
51
 
#               will create a directory instead and unpack the ZIP file
52
 
#               into it.
53
 
#
54
 
# action=putfiles: Upload multiple files to the student workspace, and
55
 
#                 optionally accept zip files which will be unpacked.
56
 
#       path:   The path to the DIRECTORY to place files in. Must not be a
57
 
#               file.
58
 
#       data:   A file upload (may not be a simple string). The filename
59
 
#               will be used to determine the target filename within
60
 
#               the given path.
61
 
#       unpack: Optional. If "true", if any data is a valid ZIP file,
62
 
#               will create a directory instead and unpack the ZIP file
63
 
#               into it.
64
 
#
65
 
# The differences between putfile and putfiles are:
66
 
# * putfile can only accept a single file.
67
 
# * putfile can accept string data, doesn't have to be a file upload.
68
 
# * putfile ignores the upload filename, the entire filename is specified on
69
 
#       path. putfiles calls files after the name on the user's machine.
70
 
#
71
 
# Clipboard-based actions. Cut/copy/paste work in the same way as modern
72
 
# file browsers, by keeping a server-side clipboard of files that have been
73
 
# cut and copied. The clipboard is stored in the session data, so it persists
74
 
# across navigation, tabs and browser windows, but not across browser
75
 
# sessions.
76
 
77
 
# action=copy: Write file(s) to the session-based clipboard. Overrides any
78
 
#               existing clipboard data. Does not actually copy the file.
79
 
#               The files are physically copied when the clipboard is pasted.
80
 
#       path:   The path to the file or directory to copy. Can be specified
81
 
#               multiple times.
82
 
83
 
# action=cut: Write file(s) to the session-based clipboard. Overrides any
84
 
#               existing clipboard data. Does not actually move the file.
85
 
#               The files are physically moved when the clipboard is pasted.
86
 
#       path:   The path to the file or directory to cut. Can be specified
87
 
#               multiple times.
88
 
89
 
# action=paste: Copy or move the files stored in the clipboard. Clears the
90
 
#               clipboard. The files are copied or moved to a specified dir.
91
 
#       path:   The path to the DIRECTORY to paste the files to. Must not
92
 
#               be a file.
93
 
#
94
 
# Subversion actions.
95
 
# action=svnadd: Add an existing file(s) to version control.
96
 
#       path:   The path to the file to be added. Can be specified multiple
97
 
#               times.
98
 
#
99
 
# action=svnrevert: Revert a file(s) to its state as of the current revision
100
 
#               / undo local edits.
101
 
#       path:   The path to the file to be reverted. Can be specified multiple
102
 
#               times.
103
 
#
104
 
# action=svnupdate: Bring a file up to date with the head revision.
105
 
#       path:   The path to the file to be updated. Only one file may be
106
 
#               specified.
107
 
#
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
110
 
#               multiple times.
111
 
#
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
114
 
#               multiple times.
115
 
#
116
 
# action=svncommit: Commit a file(s) or directory(s) to the repository.
117
 
#       path:   The path to the file or directory to be committed. Can be
118
 
#               specified multiple times. Directories are committed
119
 
#               recursively.
120
 
#       logmsg: Text of the log message. Optional. There is a default log
121
 
#               message if unspecified.
122
 
# action=svncheckout: Checkout a file/directory from the repository.
123
 
#       path:   The [repository] path to the file or directory to be
124
 
#               checked out.
125
 
126
 
# TODO: Implement the following actions:
127
 
#   putfiles, svnrevert, svnupdate, svncommit
128
 
# TODO: Implement ZIP unpacking in putfile and putfiles.
129
 
# TODO: svnupdate needs a digest to tell the user the files that were updated.
130
 
#   This can be implemented by some message passing between action and
131
 
#   listing, and having the digest included in the listing. (Problem if
132
 
#   the listing is not a directory, but we could make it an error to do an
133
 
#   update if the path is not a directory).
134
 
 
135
 
import os
136
 
import cStringIO
137
 
import shutil
138
 
 
139
 
import pysvn
140
 
 
141
 
from common import (util, studpath, zip)
142
 
import conf
143
 
 
144
 
def get_login(_realm, _username, _may_save):
145
 
    """Return the subversion credentials for the user."""
146
 
    return (True, conf.login, conf.passwd, True)
147
 
 
148
 
# Make a Subversion client object
149
 
svnclient = pysvn.Client()
150
 
svnclient.callback_get_login = get_login
151
 
 
152
 
DEFAULT_LOGMESSAGE = "No log message supplied."
153
 
 
154
 
# Mime types
155
 
# application/json is the "best" content type but is not good for
156
 
# debugging because Firefox just tries to download it
157
 
mime_dirlisting = "text/html"
158
 
#mime_dirlisting = "application/json"
159
 
 
160
 
class ActionError(Exception):
161
 
    """Represents an error processing an action. This can be
162
 
    raised by any of the action functions, and will be caught
163
 
    by the top-level handler, put into the HTTP response field,
164
 
    and continue.
165
 
 
166
 
    Important Security Consideration: The message passed to this
167
 
    exception will be relayed to the client.
168
 
    """
169
 
    pass
170
 
 
171
 
def handle_action(req, action, fields):
172
 
    """Perform the "action" part of the response.
173
 
    This function should only be called if the response is a POST.
174
 
    This performs the action's side-effect on the server. If unsuccessful,
175
 
    writes the X-IVLE-Action-Error header to the request object. Otherwise,
176
 
    does not touch the request object. Does NOT write any bytes in response.
177
 
 
178
 
    May throw an ActionError. The caller should put this string into the
179
 
    X-IVLE-Action-Error header, and then continue normally.
180
 
 
181
 
    action: String, the action requested. Not sanitised.
182
 
    fields: FieldStorage object containing all arguments passed.
183
 
    """
184
 
    global actions_table        # Table of function objects
185
 
    try:
186
 
        action = actions_table[action]
187
 
    except KeyError:
188
 
        # Default, just send an error but then continue
189
 
        raise ActionError("Unknown action")
190
 
    action(req, fields)
191
 
 
192
 
def actionpath_to_urlpath(req, path):
193
 
    """Determines the URL path (relative to the student home) upon which the
194
 
    action is intended to act. See actionpath_to_local.
195
 
    """
196
 
    if path is None:
197
 
        return req.path
198
 
    elif len(path) > 0 and path[0] == os.sep:
199
 
        # Relative to student home
200
 
        return path[1:]
201
 
    else:
202
 
        # Relative to req.path
203
 
        return os.path.join(req.path, path)
204
 
 
205
 
def actionpath_to_local(req, path):
206
 
    """Determines the local path upon which an action is intended to act.
207
 
    Note that fileservice actions accept two paths: the request path,
208
 
    and the "path" argument given to the action.
209
 
    According to the rules, if the "path" argument begins with a '/' it is
210
 
    relative to the user's home; if it does not, it is relative to the
211
 
    supplied path.
212
 
 
213
 
    This resolves the path, given the request and path argument.
214
 
 
215
 
    May raise an ActionError("Invalid path"). The caller is expected to
216
 
    let this fall through to the top-level handler, where it will be
217
 
    put into the HTTP response field. Never returns None.
218
 
 
219
 
    Does not mutate req.
220
 
    """
221
 
    (_, _, r) = studpath.url_to_jailpaths(actionpath_to_urlpath(req, path))
222
 
    if r is None:
223
 
        raise ActionError("Invalid path")
224
 
    return r
225
 
 
226
 
def movefile(req, frompath, topath, copy=False):
227
 
    """Performs a file move, resolving filenames, checking for any errors,
228
 
    and throwing ActionErrors if necessary. Can also be used to do a copy
229
 
    operation instead.
230
 
 
231
 
    frompath and topath are straight paths from the client. Will be checked.
232
 
    """
233
 
    # TODO: Do an SVN mv if the file is versioned.
234
 
    # TODO: Disallow tampering with student's home directory
235
 
    if frompath is None or topath is None:
236
 
        raise ActionError("Required field missing")
237
 
    frompath = actionpath_to_local(req, frompath)
238
 
    topath = actionpath_to_local(req, topath)
239
 
    if not os.path.exists(frompath):
240
 
        raise ActionError("The source file does not exist")
241
 
    if os.path.exists(topath):
242
 
        if frompath == topath:
243
 
            raise ActionError("Source and destination are the same")
244
 
        raise ActionError("Another file already exists with that name")
245
 
 
246
 
    try:
247
 
        if copy:
248
 
            if os.path.isdir(frompath):
249
 
                shutil.copytree(frompath, topath)
250
 
            else:
251
 
                shutil.copy2(frompath, topath)
252
 
        else:
253
 
            shutil.move(frompath, topath)
254
 
    except OSError:
255
 
        raise ActionError("Could not move the file specified")
256
 
    except shutil.Error:
257
 
        raise ActionError("Could not move the file specified")
258
 
 
259
 
### ACTIONS ###
260
 
 
261
 
def action_remove(req, fields):
262
 
    # TODO: Do an SVN rm if the file is versioned.
263
 
    # TODO: Disallow removal of student's home directory
264
 
    """Removes a list of files or directories.
265
 
 
266
 
    Reads fields: 'path' (multiple)
267
 
    """
268
 
    paths = fields.getlist('path')
269
 
    goterror = False
270
 
    for path in paths:
271
 
        path = actionpath_to_local(req, path)
272
 
        try:
273
 
            if os.path.isdir(path):
274
 
                shutil.rmtree(path)
275
 
            else:
276
 
                os.remove(path)
277
 
        except OSError:
278
 
            goterror = True
279
 
        except shutil.Error:
280
 
            goterror = True
281
 
    if goterror:
282
 
        if len(paths) == 1:
283
 
            raise ActionError("Could not delete the file specified")
284
 
        else:
285
 
            raise ActionError(
286
 
                "Could not delete one or more of the files specified")
287
 
 
288
 
def action_move(req, fields):
289
 
    # TODO: Do an SVN mv if the file is versioned.
290
 
    # TODO: Disallow tampering with student's home directory
291
 
    """Removes a list of files or directories.
292
 
 
293
 
    Reads fields: 'from', 'to'
294
 
    """
295
 
    frompath = fields.getfirst('from')
296
 
    topath = fields.getfirst('to')
297
 
    movefile(req, frompath, topath)
298
 
 
299
 
def action_putfile(req, fields):
300
 
    """Writes data to a file, overwriting it if it exists and creating it if
301
 
    it doesn't.
302
 
 
303
 
    Reads fields: 'path', 'data' (file upload)
304
 
    """
305
 
    # TODO: Read field "unpack".
306
 
    # Important: Data is "None" if the file submitted is empty.
307
 
    path = fields.getfirst('path')
308
 
    data = fields.getfirst('data')
309
 
    if path is None or data is None:
310
 
        raise ActionError("Required field missing")
311
 
    path = actionpath_to_local(req, path)
312
 
 
313
 
    if data is not None:
314
 
        data = cStringIO.StringIO(data)
315
 
 
316
 
    # Copy the contents of file object 'data' to the path 'path'
317
 
    try:
318
 
        dest = open(path, 'wb')
319
 
        if data is not None:
320
 
            shutil.copyfileobj(data, dest)
321
 
    except OSError:
322
 
        raise ActionError("Could not write to target file")
323
 
 
324
 
def action_putfiles(req, fields):
325
 
    """Writes data to one or more files in a directory, overwriting them if
326
 
    it they exist.
327
 
 
328
 
    Reads fields: 'path', 'data' (file upload, multiple), 'unpack'
329
 
    """
330
 
 
331
 
    # Important: Data is "None" if the file submitted is empty.
332
 
    path = fields.getfirst('path')
333
 
    data = fields['data']
334
 
    if type(data) != type([]):
335
 
        data = [data]
336
 
    unpack = fields.getfirst('unpack')
337
 
    if unpack is None:
338
 
        unpack = False
339
 
    else:
340
 
        unpack = True
341
 
    if path is None:
342
 
        raise ActionError("Required field missing")
343
 
    path = actionpath_to_urlpath(req, path)
344
 
    goterror = False
345
 
 
346
 
 
347
 
    for datum in data:
348
 
        # Each of the uploaded files
349
 
        filepath = os.path.join(path, datum.filename)
350
 
        filedata = datum.value
351
 
 
352
 
        if unpack and datum.filename.lower().endswith(".zip"):
353
 
            # A zip file - unpack it instead of just copying
354
 
            # TODO: Use the magic number instead of file extension
355
 
            # Note: Just unzip into the current directory (ignore the
356
 
            # filename)
357
 
            try:
358
 
                zip.unzip(path, filedata)
359
 
            except (OSError, IOError):
360
 
                goterror = True
361
 
        else:
362
 
            # Not a zip file
363
 
            (_, _, filepath_local) = studpath.url_to_jailpaths(filepath)
364
 
            if filepath_local is None:
365
 
                raise ActionError("Invalid path")
366
 
 
367
 
            # Copy the contents of file object 'data' to the path 'path'
368
 
            try:
369
 
                dest = open(filepath_local, 'wb')
370
 
                if data is not None:
371
 
                    shutil.copyfileobj(cStringIO.StringIO(filedata), dest)
372
 
            except OSError:
373
 
                goterror = True
374
 
 
375
 
    if goterror:
376
 
        if len(data) == 1:
377
 
            raise ActionError("Could not write to target file")
378
 
        else:
379
 
            raise ActionError(
380
 
                "Could not write to one or more of the target files")
381
 
 
382
 
def action_copy_or_cut(req, fields, mode):
383
 
    """Marks specified files on the clipboard, stored in the
384
 
    browser session. Sets clipboard for either a cut or copy operation
385
 
    as specified.
386
 
 
387
 
    Reads fields: 'path'
388
 
    """
389
 
    # The clipboard object created conforms to the JSON clipboard
390
 
    # specification given at the top of listing.py.
391
 
    # Note that we do not check for the existence of files here. That is done
392
 
    # in the paste operation.
393
 
    files = fields.getlist('path')
394
 
    clipboard = { "mode" : mode, "base" : req.path, "files" : files }
395
 
    session = req.get_session()
396
 
    session['clipboard'] = clipboard
397
 
    session.save()
398
 
 
399
 
def action_copy(req, fields):
400
 
    """Marks specified files on the clipboard, stored in the
401
 
    browser session. Sets clipboard for a "copy" action.
402
 
 
403
 
    Reads fields: 'path'
404
 
    """
405
 
    action_copy_or_cut(req, fields, "copy")
406
 
 
407
 
def action_cut(req, fields):
408
 
    """Marks specified files on the clipboard, stored in the
409
 
    browser session. Sets clipboard for a "cut" action.
410
 
 
411
 
    Reads fields: 'path'
412
 
    """
413
 
    action_copy_or_cut(req, fields, "cut")
414
 
 
415
 
def action_paste(req, fields):
416
 
    """Performs the copy or move action with the files stored on
417
 
    the clipboard in the browser session. Copies/moves the files
418
 
    to the specified directory. Clears the clipboard.
419
 
 
420
 
    Reads fields: 'path'
421
 
    """
422
 
    errormsg = None
423
 
 
424
 
    todir = fields.getfirst('path')
425
 
    if todir is None:
426
 
        raise ActionError("Required field missing")
427
 
    todir_local = actionpath_to_local(req, todir)
428
 
    if not os.path.isdir(todir_local):
429
 
        raise ActionError("Target is not a directory")
430
 
 
431
 
    session = req.get_session()
432
 
    try:
433
 
        clipboard = session['clipboard']
434
 
        files = clipboard['files']
435
 
        base = clipboard['base']
436
 
        if clipboard['mode'] == "copy":
437
 
            copy = True
438
 
        else:
439
 
            copy = False
440
 
    except KeyError:
441
 
        raise ActionError("Clipboard was empty")
442
 
 
443
 
    errorfiles = []
444
 
    for file in files:
445
 
        # The source must not be interpreted as relative to req.path
446
 
        # Add a slash (relative to top-level)
447
 
        frompath = os.sep + os.path.join(base, file)
448
 
        # The destination is found by taking just the basename of the file
449
 
        topath = os.path.join(todir, os.path.basename(file))
450
 
        try:
451
 
            movefile(req, frompath, topath, copy)
452
 
        except ActionError, message:
453
 
            # Store the error for later; we want to copy as many as possible
454
 
            if errormsg is None:
455
 
                errormsg = message
456
 
            else:
457
 
                # Multiple errors; generic message
458
 
                errormsg = "One or more files could not be pasted"
459
 
            # Add this file to errorfiles; it will be put back on the
460
 
            # clipboard for possible future pasting.
461
 
            errorfiles.append(file)
462
 
    # If errors occured, augment the clipboard and raise ActionError
463
 
    if len(errorfiles) > 0:
464
 
        clipboard['files'] = errorfiles
465
 
        session['clipboard'] = clipboard
466
 
        session.save()
467
 
        raise ActionError(errormsg)
468
 
 
469
 
    # Success: Clear the clipboard
470
 
    del session['clipboard']
471
 
    session.save()
472
 
 
473
 
def action_svnadd(req, fields):
474
 
    """Performs a "svn add" to each file specified.
475
 
 
476
 
    Reads fields: 'path' (multiple)
477
 
    """
478
 
    paths = fields.getlist('path')
479
 
    paths = map(lambda path: actionpath_to_local(req, path), paths)
480
 
 
481
 
    try:
482
 
        svnclient.add(paths, recurse=True, force=True)
483
 
    except pysvn.ClientError:
484
 
        raise ActionError("One or more files could not be added")
485
 
 
486
 
def action_svnupdate(req, fields):
487
 
    """Performs a "svn update" to each file specified.
488
 
 
489
 
    Reads fields: 'path'
490
 
    """
491
 
    path = fields.getfirst('path')
492
 
    if path is None:
493
 
        raise ActionError("Required field missing")
494
 
    path = actionpath_to_local(req, path)
495
 
 
496
 
    try:
497
 
        svnclient.update(path, recurse=True)
498
 
    except pysvn.ClientError:
499
 
        raise ActionError("One or more files could not be updated")
500
 
 
501
 
def action_svnrevert(req, fields):
502
 
    """Performs a "svn revert" to each file specified.
503
 
 
504
 
    Reads fields: 'path' (multiple)
505
 
    """
506
 
    paths = fields.getlist('path')
507
 
    paths = map(lambda path: actionpath_to_local(req, path), paths)
508
 
 
509
 
    try:
510
 
        svnclient.revert(paths, recurse=True)
511
 
    except pysvn.ClientError:
512
 
        raise ActionError("One or more files could not be reverted")
513
 
 
514
 
def action_svnpublish(req, fields):
515
 
    """Sets svn property "ivle:published" on each file specified.
516
 
    Should only be called on directories (only effective on directories
517
 
    anyway).
518
 
 
519
 
    Reads fields: 'path'
520
 
    """
521
 
    paths = fields.getlist('path')
522
 
    paths = map(lambda path: actionpath_to_local(req, path), paths)
523
 
 
524
 
    try:
525
 
        for path in paths:
526
 
            # Note: Property value doesn't matter
527
 
            svnclient.propset("ivle:published", "", path, recurse=False)
528
 
    except pysvn.ClientError, e:
529
 
        raise ActionError("Directory could not be published")
530
 
 
531
 
def action_svnunpublish(req, fields):
532
 
    """Deletes svn property "ivle:published" on each file specified.
533
 
 
534
 
    Reads fields: 'path'
535
 
    """
536
 
    paths = fields.getlist('path')
537
 
    paths = map(lambda path: actionpath_to_local(req, path), paths)
538
 
 
539
 
    try:
540
 
        for path in paths:
541
 
            svnclient.propdel("ivle:published", path, recurse=False)
542
 
    except pysvn.ClientError:
543
 
        raise ActionError("Directory could not be unpublished")
544
 
 
545
 
def action_svncommit(req, fields):
546
 
    """Performs a "svn commit" to each file specified.
547
 
 
548
 
    Reads fields: 'path' (multiple), 'logmsg' (optional)
549
 
    """
550
 
    paths = fields.getlist('path')
551
 
    paths = map(lambda path: actionpath_to_local(req, str(path)), paths)
552
 
    logmsg = str(fields.getfirst('logmsg', DEFAULT_LOGMESSAGE))
553
 
    if logmsg == '': logmsg = DEFAULT_LOGMESSAGE
554
 
 
555
 
    try:
556
 
        svnclient.checkin(paths, logmsg, recurse=True)
557
 
    except pysvn.ClientError:
558
 
        raise ActionError("One or more files could not be committed")
559
 
 
560
 
def action_svncheckout(req, fields):
561
 
    """Performs a "svn checkout" of each path specified.
562
 
 
563
 
    Reads fields: 'path'    (multiple)
564
 
    """
565
 
    paths = fields.getlist('path')
566
 
    if len(paths) != 2:
567
 
        raise ActionError("usage: svncheckout url local-path")
568
 
    url = conf.svn_addr + "/" + login + "/" + paths[0]
569
 
    local_path = actionpath_to_local(req, str(paths[1]))
570
 
    try:
571
 
        svnclient.callback_get_login = get_login
572
 
        svnclient.checkout(url, local_path, recurse=True)
573
 
    except pysvn.ClientError:
574
 
        raise ActionError("One or more files could not be checked out")
575
 
 
576
 
# Table of all action functions #
577
 
# Each function has the interface f(req, fields).
578
 
 
579
 
actions_table = {
580
 
    "remove" : action_remove,
581
 
    "move" : action_move,
582
 
    "putfile" : action_putfile,
583
 
    "putfiles" : action_putfiles,
584
 
 
585
 
    "copy" : action_copy,
586
 
    "cut" : action_cut,
587
 
    "paste" : action_paste,
588
 
 
589
 
    "svnadd" : action_svnadd,
590
 
    "svnupdate" : action_svnupdate,
591
 
    "svnrevert" : action_svnrevert,
592
 
    "svnpublish" : action_svnpublish,
593
 
    "svnunpublish" : action_svnunpublish,
594
 
    "svncommit" : action_svncommit,
595
 
    "svncheckout" : action_svncheckout,
596
 
}