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

« back to all changes in this revision

Viewing changes to lib/fileservice_lib/action.py

  • Committer: wagrant
  • Date: 2008-07-08 04:38:03 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:829
Add an svndiff action, and give it an option in the action listbox.
Enable it and the other SVN actions only when appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
#       path:   The path to the file to be added. Can be specified multiple
84
84
#               times.
85
85
#
 
86
# action=svndiff: Show differences between a file in the working copy and its
 
87
#                   state as of the current revision
 
88
#       path:   The path to the file to be diffed. Only one file may be
 
89
#               specified.
 
90
#
86
91
# action=svnrevert: Revert a file(s) to its state as of the current revision
87
92
#               / undo local edits.
88
93
#       path:   The path to the file to be reverted. Can be specified multiple
556
561
    except pysvn.ClientError, e:
557
562
        raise ActionError(str(e))
558
563
 
 
564
def action_svndiff(req, fields):
 
565
    """Redirects to a diff of the file specified.
 
566
 
 
567
    Reads fields: 'path'
 
568
    """
 
569
    paths = fields.getlist('path')
 
570
 
 
571
    raise ActionError(paths[0])
 
572
 
559
573
def action_svnrevert(req, fields):
560
574
    """Performs a "svn revert" to each file specified.
561
575
 
655
669
 
656
670
    "svnadd" : action_svnadd,
657
671
    "svnupdate" : action_svnupdate,
 
672
    "svndiff" : action_svndiff,
658
673
    "svnrevert" : action_svnrevert,
659
674
    "svnpublish" : action_svnpublish,
660
675
    "svnunpublish" : action_svnunpublish,