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

« back to all changes in this revision

Viewing changes to lib/fileservice_lib/action.py

  • Committer: mattgiuca
  • Date: 2008-06-23 09:59:52 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:786
fileservice_lib/action.py: Fixed SVN error messages. No longer just give a
    simple "x failed" - now echo the full error message generated by SVN.
    (Not a security risk since we're in the jail).

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
# Make a Subversion client object
148
148
svnclient = pysvn.Client()
149
149
svnclient.callback_get_login = get_login
150
 
svnclient.exception_style = 1               # Detailed exceptions
 
150
svnclient.exception_style = 0               # Simple (string) exceptions
151
151
 
152
152
DEFAULT_LOGMESSAGE = "No log message supplied."
153
153
 
523
523
 
524
524
    try:
525
525
        svnclient.add(paths, recurse=True, force=True)
526
 
    except pysvn.ClientError:
527
 
        raise ActionError("One or more files could not be added")
 
526
    except pysvn.ClientError, e:
 
527
        raise ActionError(str(e))
528
528
 
529
529
def action_svnupdate(req, fields):
530
530
    """Performs a "svn update" to each file specified.
538
538
 
539
539
    try:
540
540
        svnclient.update(path, recurse=True)
541
 
    except pysvn.ClientError:
542
 
        raise ActionError("One or more files could not be updated")
 
541
    except pysvn.ClientError, e:
 
542
        raise ActionError(str(e))
543
543
 
544
544
def action_svnrevert(req, fields):
545
545
    """Performs a "svn revert" to each file specified.
551
551
 
552
552
    try:
553
553
        svnclient.revert(paths, recurse=True)
554
 
    except pysvn.ClientError:
555
 
        raise ActionError("One or more files could not be reverted")
 
554
    except pysvn.ClientError, e:
 
555
        raise ActionError(str(e))
556
556
 
557
557
def action_svnpublish(req, fields):
558
558
    """Sets svn property "ivle:published" on each file specified.
591
591
    try:
592
592
        for path in paths:
593
593
            svnclient.propdel("ivle:published", path, recurse=False)
594
 
    except pysvn.ClientError:
 
594
    except pysvn.ClientError, e:
595
595
        raise ActionError("Directory could not be unpublished")
596
596
 
597
597
def action_svncommit(req, fields):
606
606
 
607
607
    try:
608
608
        svnclient.checkin(paths, logmsg, recurse=True)
609
 
    except pysvn.ClientError:
610
 
        raise ActionError("One or more files could not be committed")
 
609
    except pysvn.ClientError, e:
 
610
        raise ActionError(str(e))
611
611
 
612
612
def action_svncheckout(req, fields):
613
613
    """Performs a "svn checkout" of each path specified.
622
622
    try:
623
623
        svnclient.callback_get_login = get_login
624
624
        svnclient.checkout(url, local_path, recurse=True)
625
 
    except pysvn.ClientError:
626
 
        raise ActionError("One or more files could not be checked out")
 
625
    except pysvn.ClientError, e:
 
626
        raise ActionError(str(e))
627
627
 
628
628
# Table of all action functions #
629
629
# Each function has the interface f(req, fields).