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

« back to all changes in this revision

Viewing changes to bin/ivle-fetchsubmissions

  • Committer: Matt Giuca
  • Date: 2009-05-12 14:37:35 UTC
  • mto: This revision was merged to the branch mainline in revision 1247.
  • Revision ID: matt.giuca@gmail.com-20090512143735-llsdpihhgk5eydo5
ivle-fetchsubmissions: Rather than creating the target dir, now DELETES it
    before doing an svn export. This has several reasons:
    1. Python2.5 doesn't work if a directory already exists (shutil.move
        changed in Python 2.6 to support this).
    2. Better not to allow arbitrary cruft (whatever was there before), since
        it is not part of the submission.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    # target_final is the directory to place the files in
64
64
    target_final = os.path.join(target,
65
65
                                submission.assessed.principal.short_name)
66
 
    if not os.path.exists(target_final):
67
 
        os.makedirs(target_final)
 
66
    if os.path.exists(target_final):
 
67
        # Remove the existing directory before re-checking out
 
68
        ivle.util.safe_rmtree(target_final)
68
69
    url = get_repo_url(submission, config)
69
70
    revision = pysvn.Revision(pysvn.opt_revision_kind.number,
70
71
                              submission.revision)