Changeset 33970 in project


Ignore:
Timestamp:
04/16/17 13:02:09 (10 days ago)
Author:
sjamaan
Message:

qwiki: Fix long-standing bug when adding new page with invalid credentials

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/qwiki/trunk/qwiki-svn.scm

    r32677 r33970  
    22;; qwiki-svn - Subversion implementation of revisioning system for qwiki
    33;;
    4 ;; Copyright (c) 2009-2015 Peter Bex
     4;; Copyright (c) 2009-2017 Peter Bex
    55;;
    66;;  Redistribution and use in source and binary forms, with or without
     
    119119
    120120(define (undo-changes! source-path)
    121   ;; File exists and under version control?
    122   (if (let ((info (get-info source-path)))
    123         (and info (not (zero? (svn-info-rev info)))))
     121  (let ((info (get-info source-path)))
     122    (when info
    124123      (svn-client-revert (list source-path) #t
    125124                         (qwiki-repos-username)
    126                          (qwiki-repos-password))
    127       (begin
    128         (delete-file* source-path)
    129         (let loop ((path (pathname-directory source-path)))
    130           (unless (get-info path)
    131             (begin
    132               (delete-directory path)
    133               (loop (pathname-directory path))))))))
     125                         (qwiki-repos-password)))
     126   ;; If file exists and is not under version control, or only has
     127   ;; been marked as added, we remove it
     128    (when (or (not info)
     129              (= (svn-info-rev info)
     130                 (svn-opt-revision-number svn-opt-revision-unspecified)))
     131      (if (directory? source-path)
     132          (delete-directory source-path)
     133          (delete-file* source-path))
     134      (let* ((parent-path (pathname-directory source-path))
     135             (parent-info (get-info parent-path)))
     136        (unless (and parent-info
     137                     (not (= (svn-info-rev parent-info)
     138                             (svn-opt-revision-number
     139                              svn-opt-revision-unspecified))))
     140          (undo-changes! parent-path))))))
    134141
    135142(define (get-extended-property path property)
Note: See TracChangeset for help on using the changeset viewer.