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

« back to all changes in this revision

Viewing changes to ivle/fileservice_lib/action.py

  • Committer: William Grant
  • Date: 2009-12-08 03:50:24 UTC
  • mfrom: (1294.2.143 ui-the-third)
  • Revision ID: grantw@unimelb.edu.au-20091208035024-wjx8zp54gth15ph8
Merge ui-the-third. This is another UI revamp.

The header is now thin! Thin! The yellow bar is gone. The tabs are gone.
Breadcrumbs are here. Routes is replaced (with an object publishing
mechanism). Views are less repetitive. etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
# action=svnupdate: Bring a file up to date with the head revision.
92
92
#       path:   The path to the file to be updated. Only one file may be
93
93
#               specified.
 
94
#       revision: The revision number to update to. If not provided this
 
95
#               defaults to HEAD.
94
96
#
95
97
# action=svnpublish: Set the "published" flag on a file to True.
96
98
#       path:   The path to the file to be published. Can be specified
615
617
def action_svnupdate(req, fields):
616
618
    """Performs a "svn update" to each file specified.
617
619
 
618
 
    Reads fields: 'path'
 
620
    Reads fields: 'path' and 'revision'
619
621
    """
620
622
    path = fields.getfirst('path')
 
623
    revision = fields.getfirst('revision')
621
624
    if path is None:
622
625
        raise ActionError("Required field missing")
 
626
    if revision is None:
 
627
        revision = pysvn.Revision( pysvn.opt_revision_kind.head )
 
628
    else:
 
629
        try:
 
630
            revision = pysvn.Revision(pysvn.opt_revision_kind.number,
 
631
                    int(revision))
 
632
        except ValueError, e:
 
633
            raise ActionError("Bad revision number: '%s'"%revision,)
623
634
    path = actionpath_to_local(req, path)
624
635
 
625
636
    try:
626
 
        svnclient.update(path, recurse=True)
 
637
        svnclient.update(path, recurse=True, revision=revision)
627
638
    except pysvn.ClientError, e:
628
639
        raise ActionError(str(e))
629
640