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

« back to all changes in this revision

Viewing changes to ivle/fileservice_lib/action.py

  • Committer: Matt Giuca
  • Date: 2010-02-18 07:25:36 UTC
  • Revision ID: matt.giuca@gmail.com-20100218072536-fr8rr1t7otsenta8
fileservice_lib.action: Removed actions svnpublish and svnunpublish; unused (in favour of publish and unpublish), so it's bad to leave them around.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
#       revision: The revision number to update to. If not provided this
95
95
#               defaults to HEAD.
96
96
#
97
 
# action=svnpublish: Set the "published" flag on a file to True.
98
 
#       path:   The path to the file to be published. Can be specified
99
 
#               multiple times.
100
 
#
101
 
# action=svnunpublish: Set the "published" flag on a file to False.
102
 
#       path:   The path to the file to be unpublished. Can be specified
103
 
#               multiple times.
104
 
#
105
97
# action=svncommit: Commit a file(s) or directory(s) to the repository.
106
98
#       path:   The path to the file or directory to be committed. Can be
107
99
#               specified multiple times. Directories are committed
652
644
    except pysvn.ClientError, e:
653
645
        raise ActionError(str(e))
654
646
 
655
 
def action_svnpublish(req, fields):
656
 
    """Sets svn property "ivle:published" on each file specified.
657
 
    Should only be called on directories (only effective on directories
658
 
    anyway).
659
 
 
660
 
    Reads fields: 'path'
661
 
 
662
 
    XXX Currently unused by the client (calls action_publish instead, which
663
 
    has a completely different publishing model).
664
 
    """
665
 
    paths = fields.getlist('path')
666
 
    if len(paths):
667
 
        paths = map(lambda path: actionpath_to_local(req, path), paths)
668
 
    else:
669
 
        paths = [studpath.to_home_path(req.path)]
670
 
 
671
 
    try:
672
 
        for path in paths:
673
 
            # Note: Property value doesn't matter
674
 
            svnclient.propset("ivle:published", "", path, recurse=False)
675
 
    except pysvn.ClientError, e:
676
 
        raise ActionError("Directory could not be published")
677
 
 
678
 
def action_svnunpublish(req, fields):
679
 
    """Deletes svn property "ivle:published" on each file specified.
680
 
 
681
 
    Reads fields: 'path'
682
 
 
683
 
    XXX Currently unused by the client (calls action_unpublish instead, which
684
 
    has a completely different publishing model).
685
 
    """
686
 
    paths = fields.getlist('path')
687
 
    paths = map(lambda path: actionpath_to_local(req, path), paths)
688
 
 
689
 
    try:
690
 
        for path in paths:
691
 
            svnclient.propdel("ivle:published", path, recurse=False)
692
 
    except pysvn.ClientError, e:
693
 
        raise ActionError("Directory could not be unpublished")
694
 
 
695
647
def action_svncommit(req, fields):
696
648
    """Performs a "svn commit" to each file specified.
697
649
 
795
747
    "svnupdate" : action_svnupdate,
796
748
    "svnresolved" : action_svnresolved,
797
749
    "svnrevert" : action_svnrevert,
798
 
    "svnpublish" : action_svnpublish,
799
 
    "svnunpublish" : action_svnunpublish,
800
750
    "svncommit" : action_svncommit,
801
751
    "svncheckout" : action_svncheckout,
802
752
    "svnrepomkdir" : action_svnrepomkdir,