• R/O
  • SSH
  • HTTPS

fsvn: Commit


Commit MetaInfo

Revision325 (tree)
Time2015-11-15 15:50:15
Authormhayashi1120

Log Message

fix fsvn-save-file'

Change Summary

Incremental Difference

--- trunk/ChangeLog (revision 324)
+++ trunk/ChangeLog (revision 325)
@@ -1,3 +1,7 @@
1+2015-11-15 Masahiro Hayashi (林 雅博) <mhayashi1120@gmail.com>
2+
3+ * Fix: svn export is changed again. fix `fsvn-save-file'
4+
15 2015-11-10 Masahiro Hayashi (林 雅博) <mhayashi1120@gmail.com>
26
37 * Improve: detect more information when register new svn command.
--- trunk/fsvn-pub.el (revision 324)
+++ trunk/fsvn-pub.el (revision 325)
@@ -161,42 +161,30 @@
161161 "Save URLREV as FILE.
162162 Optional argument NO-MSG suppress message.
163163 Optional argument REVISION means point of URLREV log chain."
164- (with-temp-buffer
165- (if (= (fsvn-call-command "export" (current-buffer)
166- urlrev "--force"
167- (when revision (list "--revision" revision))
168- file) 0)
169- (progn
170- ;; specification is changed between 1.6.12 and 1.6.18.
171- ;; If exported FILE argument contains revision string, remove revision segment
172- ;; by svn command.
173- ;; (ex hoge.el@1020 -> hoge.el)
174- ;; TODO what should i do when EXPORTED FILE already exists???
175- ;; => about current implementation
176- ;; part of ediff implementation has revision segment.
177- ;; after svn 1.7.x specification changed again..
178- ;; exported message truncate directory segment from output.
179- (goto-char (point-min))
180- (unless (looking-at "^A[ \t]+\\(.+\\)")
181- (error "Parse error exported information"))
182- (let* ((exported (match-string 1))
183- (exported-name
184- (if (file-name-absolute-p exported)
185- (file-name-nondirectory exported)
186- exported)))
187- (unless (string= exported-name
188- (file-name-nondirectory file))
189- (rename-file exported file t)))
190- (unless no-msg
191- (message "Save done."))
192- ;; return
193- t)
194- (when (file-exists-p file)
195- (delete-file file))
196- (unless no-msg
197- (message "Save failed."))
198- ;; return
199- nil)))
164+ (let ((out-file
165+ ;; checking revisioned filename
166+ ;; this filename make some problems when export.
167+ (if (string-match "@[^@]+\\'" file)
168+ (fsvn-make-temp-file)
169+ file)))
170+ (with-temp-buffer
171+ (if (= (fsvn-call-command "export" (current-buffer)
172+ urlrev "--force"
173+ (when revision (list "--revision" revision))
174+ out-file) 0)
175+ (progn
176+ (unless (fsvn-file= out-file file)
177+ (rename-file out-file file t))
178+ (unless no-msg
179+ (message "Save done."))
180+ ;; return
181+ t)
182+ (when (file-exists-p file)
183+ (delete-file file))
184+ (unless no-msg
185+ (message "Save failed."))
186+ ;; return
187+ nil))))
200188
201189 (defun fsvn-save-file-background (urlrev file &optional revision)
202190 "Save URLREV as FILE in background.
Show on old repository browser