• R/O
  • SSH
  • HTTPS

fsvn: Commit


Commit MetaInfo

Revision312 (tree)
Time2014-02-09 11:39:59
Authormhayashi1120

Log Message

fix

Change Summary

Incremental Difference

--- trunk/fsvn-tortoise.el (revision 311)
+++ trunk/fsvn-tortoise.el (revision 312)
@@ -224,7 +224,7 @@
224224 (setq alist
225225 (fsvn-mapitem
226226 (lambda (value)
227- (when (string-match "^\\([^=]+\\)=\\(.*\\)" value)
227+ (when (string-match "\\`\\([^=]+\\)=\\(.*\\)" value)
228228 (cons (match-string 1 value) (match-string 2 value))))
229229 values))
230230 (cons (fsvn-svn-autoprop-wildcard->regexp key) alist)))))
--- trunk/fsvn-data.el (revision 311)
+++ trunk/fsvn-data.el (revision 312)
@@ -218,7 +218,7 @@
218218 (setq current copyfrom)
219219 (setq ret (cons (cons rev copyfrom) ret))
220220 (throw 'done t))
221- ((string-match (concat "^" (regexp-quote logpath) "/") target)
221+ ((string-match (concat "\\`" (regexp-quote logpath) "/") target)
222222 ;; match to ancestor of the target
223223 ;; may exact match to target
224224 (setq next (fsvn-expand-url (substring target (match-end 0)) copyfrom)))))))
@@ -299,7 +299,7 @@
299299 (let ((root (fsvn-xml-info->entry=>repository=>root$ info))
300300 (url (fsvn-xml-info->entry=>url$ info))
301301 ret)
302- (when (string-match (concat "^\\(" (regexp-quote root) "\\)") url)
302+ (when (string-match (concat "\\`\\(" (regexp-quote root) "\\)") url)
303303 (setq ret (replace-match "" nil nil url 1))
304304 (when (string= ret "")
305305 (setq ret "/")))
@@ -377,7 +377,7 @@
377377
378378 (defun fsvn-repository-path (root urlrev)
379379 (let ((url (fsvn-urlrev-url urlrev)))
380- (when (string-match (concat "^" (regexp-quote root)) url)
380+ (when (string-match (concat "\\`" (regexp-quote root)) url)
381381 (replace-match "" nil nil url 0))))
382382
383383 (defun fsvn-find-parent-working-copy (directory)
--- trunk/fsvn-make.el (revision 311)
+++ trunk/fsvn-make.el (revision 312)
@@ -181,7 +181,7 @@
181181 (error "%s not exists." src))
182182 (copy-file src dest t)
183183 (set-file-modes dest ?\644))))
184- (directory-files "./images" nil "\\.xpm$")))
184+ (directory-files "./images" nil "\\.xpm\\'")))
185185
186186 (defun fsvn-make-test ()
187187 (mapc
--- trunk/mw32cmp.el (revision 311)
+++ trunk/mw32cmp.el (revision 312)
@@ -247,7 +247,7 @@
247247 (defun mw32cmp-registry-pseudo-parse-key (key)
248248 "return cons cell (rootkey . subkey)"
249249 (when (stringp key)
250- (when (string-match "^\\([^\\\\]+\\)\\(?:\\\\\\(.*\\)\\)?" key)
250+ (when (string-match "\\`\\([^\\\\]+\\)\\(?:\\\\\\(.*\\)\\)?" key)
251251 (cons (match-string 1 key) (match-string 2 key)))))
252252
253253 (defun mw32cmp-registry-pseudo-parse-data (data)
@@ -301,7 +301,7 @@
301301 (concat (nreverse list))))
302302
303303 (defun mw32cmp-registry-parse-dword (value)
304- (unless (string-match "^0x\\([0-9a-z]+\\)$" value)
304+ (unless (string-match "\\`0x\\([0-9a-z]+\\)\\'" value)
305305 (signal 'error (list "Not a hex value" value)))
306306 (let ((hex (match-string 1 value))
307307 num val)
--- trunk/fsvn-test.el (revision 311)
+++ trunk/fsvn-test.el (revision 312)
@@ -149,7 +149,7 @@
149149
150150 (defun fsvn-test-unbound-functions ()
151151 (let ((targetp (lambda (s)
152- (and (string-match "^fsvn-test-" (symbol-name s))
152+ (and (string-match "\\`fsvn-test-" (symbol-name s))
153153 (functionp s)
154154 (listp (symbol-function s))))))
155155 (mapatoms
--- trunk/fsvn-magic.el (revision 311)
+++ trunk/fsvn-magic.el (revision 312)
@@ -306,7 +306,7 @@
306306 ;;FIXME dirty
307307 (when (and scheme segments)
308308 (when (and (string= scheme "file") (memq system-type '(windows-nt)))
309- (setcar segments (replace-regexp-in-string "^\\([a-zA-Z]\\):$" "\\1|" (car segments)))))
309+ (setcar segments (replace-regexp-in-string "\\`\\([a-zA-Z]\\):\\'" "\\1|" (car segments)))))
310310 (mapconcat 'identity segments "/"))
311311
312312 (defun fsvn-magic-parse-file-as-writable (file)
@@ -341,7 +341,7 @@
341341 ;;FIXME dirty
342342 (when (and scheme segments)
343343 (when (and (string= scheme "file") (memq system-type '(windows-nt)))
344- (setcar segments (replace-regexp-in-string "^\\([a-zA-Z]\\)|$" "\\1:" (car segments)))))
344+ (setcar segments (replace-regexp-in-string "\\`\\([a-zA-Z]\\)|\\'" "\\1:" (car segments)))))
345345 (mapconcat 'identity segments "/"))
346346
347347 (defun fsvn-magic-expand-file-name (file &optional directory)
@@ -485,7 +485,7 @@
485485 ((member (fsvn-urlrev-url urlrev) roots)
486486 ;; when guessed root directory..
487487 directory)
488- ((string-match "/$" directory)
488+ ((string-match "/\\'" directory)
489489 (substring directory 0 -1))
490490 (t
491491 directory))))
@@ -497,7 +497,7 @@
497497 ((member (concat (fsvn-urlrev-url urlrev) "/") roots)
498498 ;; when guessed root directory..
499499 filename)
500- ((string-match "/$" filename)
500+ ((string-match "/\\'" filename)
501501 filename)
502502 (t
503503 (fsvn-magic-create-name (fsvn-urlrev-dirname urlrev))))))
@@ -689,7 +689,7 @@
689689 (eq (string-match fsvn-magic-file-name-regexp file) 0))
690690
691691 (defun fsvn-magic-file-name-all-completions (file directory)
692- (let ((regexp (concat "^" (regexp-quote file))))
692+ (let ((regexp (concat "\\`" (regexp-quote file))))
693693 (fsvn-magic-each-directory-entry directory entry
694694 (let ((name (fsvn-xml-lists->list->entry=>name$ entry)))
695695 (cond
@@ -700,7 +700,7 @@
700700 name))))))
701701
702702 (defun fsvn-magic-file-name-completion (file directory &optional predicate)
703- (let ((regexp (concat "^" (regexp-quote file)))
703+ (let ((regexp (concat "\\`" (regexp-quote file)))
704704 completions)
705705 (unless predicate
706706 (setq predicate (lambda (x) t)))
--- trunk/fsvn-debug.el (revision 311)
+++ trunk/fsvn-debug.el (revision 312)
@@ -52,7 +52,7 @@
5252 (interactive)
5353 (mapatoms
5454 (lambda (x)
55- (when (string-match "^fsvn" (symbol-name x))
55+ (when (string-match "\\`fsvn" (symbol-name x))
5656 (when (fboundp x)
5757 (fset x nil))
5858 (when (boundp x)
--- trunk/fsvn-env.el (revision 311)
+++ trunk/fsvn-env.el (revision 312)
@@ -183,13 +183,13 @@
183183 ret)))
184184
185185 (defun fsvn-string-rm-lspace (string)
186- (replace-regexp-in-string "^[ \t\n]+" "" string))
186+ (replace-regexp-in-string "\\`[ \t\n]+" "" string))
187187
188188 (defun fsvn-string-rm-rspace (string)
189- (replace-regexp-in-string "[ \t\n]+$" "" string))
189+ (replace-regexp-in-string "[ \t\n]+\\'" "" string))
190190
191191 (defun fsvn-string-rm-space (string)
192- (replace-regexp-in-string "\\(?:^[ \t\n]+\\|[ \t\n]+$\\)" "" string))
192+ (replace-regexp-in-string "\\(?:\\`[ \t\n]+\\|[ \t\n]+\\'\\)" "" string))
193193
194194 (defun fsvn-string-force-number (string &optional default-value)
195195 "Return string as number, return zero if failed convert."
@@ -337,13 +337,13 @@
337337 (setq list (cdr list)))))
338338
339339 (defun fsvn-member-startswith (start-string list)
340- (fsvn-member-regexp (concat "^" (regexp-quote start-string)) list))
340+ (fsvn-member-regexp (concat "\\`" (regexp-quote start-string)) list))
341341
342342 (defun fsvn-any-startswith (list string)
343343 "STRING startwith any LIST item."
344344 (catch 'match
345345 (while list
346- (when (string-match (concat "^" (regexp-quote (car list))) string)
346+ (when (string-match (concat "\\`" (regexp-quote (car list))) string)
347347 (throw 'match list))
348348 (setq list (cdr list)))))
349349
@@ -410,7 +410,7 @@
410410 (defvar vc-mode)
411411 (and (boundp 'vc-mode)
412412 (stringp vc-mode)
413- (string-match "^ SVN" vc-mode)))
413+ (string-match "\\` SVN" vc-mode)))
414414
415415
416416
@@ -550,7 +550,7 @@
550550 (let (ret)
551551 (mapc
552552 (lambda (p)
553- (when (string-match "^fsvn" (process-name p))
553+ (when (string-match "\\`fsvn" (process-name p))
554554 (mapc
555555 (lambda (string)
556556 (when (and (file-name-absolute-p string)
@@ -604,7 +604,7 @@
604604 ret))
605605
606606 (defun fsvn-directory-unsaved-buffers (directory)
607- (let ((regex (concat "^" (regexp-quote (directory-file-name directory)) "/"))
607+ (let ((regex (concat "\\`" (regexp-quote (directory-file-name directory)) "/"))
608608 ret)
609609 (mapc
610610 (lambda (buffer)
--- trunk/fsvn-deps.el (revision 311)
+++ trunk/fsvn-deps.el (revision 312)
@@ -353,31 +353,36 @@
353353 (cond
354354 ((member (car-safe flat-args) '("upgrade"))
355355 fsvn-svn-command-internal)
356- (t
357- (condition-case err
358- (let* ((args flat-args)
359- (file (catch 'done
360- (while args
361- (cond
362- ((fsvn-url-local-p (car args))
363- (throw 'done (car args)))
364- ((string= (car args) "--targets")
365- ;; ignore next arg
366- (setq args (cdr args))
367- (let* ((targets (get-text-property 0 'fsvn-target-files (car args)))
368- (file (fsvn-find-if 'fsvn-url-local-p targets)))
369- (when file
370- (throw 'done file))))
371- ((string= (car args) "--file")
372- ;; just ignore next arg
373- (setq args (cdr args))))
374- (setq args (cdr args)))))
375- (ver (fsvn-file-wc-svn-version (or file default-directory))))
356+ ((condition-case err
357+ (fsvn-let*
358+ ((args flat-args)
359+ (file (catch 'done
360+ (while args
361+ (cond
362+ ((fsvn-url-local-p (car args))
363+ (throw 'done (car args)))
364+ ((string= (car args) "--targets")
365+ ;; ignore next arg
366+ (setq args (cdr args))
367+ (let* ((targets (get-text-property 0 'fsvn-target-files (car args)))
368+ (file (fsvn-find-if 'fsvn-url-local-p targets)))
369+ (when file
370+ (throw 'done file))))
371+ ((string= (car args) "--file")
372+ ;; just ignore next arg
373+ (setq args (cdr args))))
374+ (setq args (cdr args)))))
375+ (ver (fsvn-file-wc-svn-version file)))
376376 (fsvn-svn-fetch-proper-version ver))
377377 (error
378378 (message "%s" err)
379- ;; default command
380- fsvn-svn-command-internal)))))
379+ nil)))
380+ ((fsvn-url-local-p default-directory)
381+ (let ((ver (fsvn-file-wc-svn-version default-directory)))
382+ (fsvn-svn-fetch-proper-version ver)))
383+ (t
384+ ;; default command
385+ fsvn-svn-command-internal)))
381386
382387 (defun fsvn-svn-fetch-proper-version (&optional format-version)
383388 (catch 'found
@@ -398,7 +403,7 @@
398403 (let ((raw-version (car (fsvn-text-buffer-line-as-list)))
399404 version)
400405 ;; trim "1.8.6-dev" like version
401- (unless (string-match "^\\([0-9]+\\.[0-9]+\\.[0-9]+\\)" raw-version)
406+ (unless (string-match "\\`\\([0-9]+\\.[0-9]+\\.[0-9]+\\)" raw-version)
402407 (error "Unsupported version"))
403408 (match-string 1 raw-version))))
404409
@@ -622,12 +627,12 @@
622627 fsvn-svn-url-scheme-list))
623628
624629 (defun fsvn-revision-number-p (string)
625- (if (string-match "^[0-9]+$" string)
630+ (if (string-match "\\`[0-9]+\\'" string)
626631 (string-to-number string)
627632 nil))
628633
629634 (defun fsvn-revision-date-p (string)
630- (if (string-match (concat "^" fsvn-revision-date-regexp "$") string)
635+ (if (string-match (concat "\\`" fsvn-revision-date-regexp "\\'") string)
631636 t
632637 nil))
633638
@@ -691,7 +696,7 @@
691696 (car propname))))
692697 fsvn-property-list))
693698
694-(defconst fsvn-svn-valid-propname-regexp "^[a-zA-Z:_][a-zA-Z-.:_]*$")
699+(defconst fsvn-svn-valid-propname-regexp "\\`[a-zA-Z:_][a-zA-Z-.:_]*\\'")
695700
696701 ;; http://svn.collab.net/repos/svn/trunk/subversion/libsvn_subr/properties.c
697702 (defun fsvn-svn-valid-propname-p (propname)
@@ -699,7 +704,7 @@
699704 (string-match fsvn-svn-valid-propname-regexp propname))
700705
701706 (defun fsvn-propname-svn-texture-p (propname)
702- (string-match "^svn:" propname))
707+ (string-match "\\`svn:" propname))
703708
704709 (defcustom fsvn-svn-home-directory
705710 (let (tmp)
@@ -825,8 +830,10 @@
825830 (or (and (require 'esqlite nil t)
826831 (esqlite-sqlite-installed-p)
827832 (fsvn-meta--get-database-format ctl))
828- ;; regard as maximum released format
829- 30))
833+ ;; regard as maximum format of binary
834+ (cond
835+ ((version< fsvn-svn-version "1.8") 29)
836+ (t 30))))
830837 ((file-exists-p (fsvn-expand-file "entries" ctl))
831838 (with-temp-buffer
832839 (insert-file-contents (fsvn-expand-file "entries" ctl) nil 0 16)
@@ -837,15 +844,17 @@
837844
838845
839846 (defconst fsvn-svn-date-regexp
840- "^\
841-\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)\
842-T\
843-\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\
844-\\.\
845-\\([0-9]\\{6\\}\\)\
846-Z\
847-$"
848- )
847+ (eval-when-compile
848+ (concat
849+ "\\`"
850+ "\\([0-9]\\{4\\}\\)-\\([0-9]\\{2\\}\\)-\\([0-9]\\{2\\}\\)"
851+ "T"
852+ "\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
853+ "\\."
854+ "\\([0-9]\\{6\\}\\)"
855+ "Z"
856+ "\\'"
857+ )))
849858
850859 ;; todo elint bug?
851860 ;; (setq elint-unknown-builtin-args (delq (assq 'encode-time elint-unknown-builtin-args) elint-unknown-builtin-args))
@@ -875,18 +884,18 @@
875884 (setq sym (cadr values))
876885 (cond
877886 ((fsvn-url-repository-p real))
878- ((string-match "^\\.\\./" real)
887+ ((string-match "\\`\\.\\./" real)
879888 ;; relate path from current directory
880889 (setq base-url (file-name-directory (fsvn-xml-info->entry=>url$ pinfo)))
881890 (setq real (fsvn-expand-url (replace-match "" nil nil real) base-url)))
882- ((string-match "^\\^/" real)
891+ ((string-match "\\`\\^/" real)
883892 ;; relate path from repository root
884893 (setq base-url (fsvn-xml-info->entry=>repository=>root$ pinfo))
885894 (setq real (fsvn-expand-url (replace-match "" nil nil real) base-url)))
886- ((string-match "^//" real)
895+ ((string-match "\\`//" real)
887896 ;;FIXME not depend on scheme
888897 )
889- ((string-match "^/" real)
898+ ((string-match "\\`/" real)
890899 ;;FIXME relate path from server root
891900 ))
892901 (cons real sym)))
--- trunk/mw32cmp-test.el (revision 311)
+++ trunk/mw32cmp-test.el (revision 312)
@@ -57,7 +57,7 @@
5757
5858
5959 (defun mw32cmp-pseudo-registry-concat-key (parent name)
60- (if (string-match "\\\\$" parent)
60+ (if (string-match "\\\\\\'" parent)
6161 (concat parent name)
6262 (concat parent "\\\\" name)))
6363
--- trunk/fsvn-win.el (revision 311)
+++ trunk/fsvn-win.el (revision 312)
@@ -212,7 +212,7 @@
212212 (cygdir (fsvn-cygwin-installed-dir)))
213213 (and command
214214 cygdir
215- (string-match (concat "^" (regexp-quote cygdir)) command))))
215+ (string-match (concat "\\`" (regexp-quote cygdir)) command))))
216216
217217 (defun fsvn-cygwin-expand-path (name &optional default)
218218 (let ((inst-dir fsvn-cygwin-installed-dir)
@@ -220,7 +220,7 @@
220220 (cond
221221 ((not fsvn-cygwin-guessed-installed)
222222 expanded)
223- ((string-match (concat "^" (regexp-quote inst-dir)) expanded)
223+ ((string-match (concat "\\`" (regexp-quote inst-dir)) expanded)
224224 (concat "/" (substring expanded (match-end 0))))
225225 (t
226226 (let* ((file (expand-file-name name default))
@@ -232,9 +232,9 @@
232232 (let ((prefix fsvn-cygwin-drive-prefix-dir)
233233 (installed fsvn-cygwin-installed-folder))
234234 (cond
235- ((string-match (format "^\\(%s\\)/\\([a-zA-Z]\\)/\\(.*\\)" (regexp-quote prefix)) path)
235+ ((string-match (format "\\`\\(%s\\)/\\([a-zA-Z]\\)/\\(.*\\)" (regexp-quote prefix)) path)
236236 (format "%s:/%s" (match-string 2 path) (match-string 3 path)))
237- ((string-match "^/" path)
237+ ((string-match "\\`/" path)
238238 (format "%s/%s" (expand-file-name installed) (substring path 1)))
239239 (t
240240 path))))
@@ -282,7 +282,7 @@
282282 (let (tree args)
283283 (setq tree (if arg "/e" "/n"))
284284 (cond
285- ((or (null file) (string-match "^\\.\\.?$" file))
285+ ((or (null file) (string-match "\\`\\.\\.?\\'" file))
286286 (setq args (list tree (unix-to-dos-filename dir))))
287287 (t
288288 (setq args (list tree "/select" (unix-to-dos-filename (expand-file-name file dir))))))
--- trunk/fsvn-proclist.el (revision 311)
+++ trunk/fsvn-proclist.el (revision 312)
@@ -262,7 +262,7 @@
262262 (goto-char prev))))))
263263
264264 (defun fsvn-process-list-default-display-p (process)
265- (string-match "^fsvn" (process-name process)))
265+ (string-match "\\`fsvn" (process-name process)))
266266
267267 (defun fsvn-process-list-move-to-command-line ()
268268 (let ((eol (line-end-position)))
--- trunk/fsvn-url.el (revision 311)
+++ trunk/fsvn-url.el (revision 312)
@@ -20,7 +20,7 @@
2020
2121
2222 (defconst fsvn-url-encoding fsvn-svn-common-coding-system)
23-(defconst fsvn-url-with-revision-regexp "^\\(.*\\)@\\([^/@]*\\)\\(@*\\)$")
23+(defconst fsvn-url-with-revision-regexp "\\`\\(.*\\)@\\([^/@]*\\)\\(@*\\)\\'")
2424
2525 ;; url utility
2626
@@ -114,23 +114,23 @@
114114
115115 (defun fsvn-url-ediff-filename (url)
116116 (let ((tmp (directory-file-name url)))
117- (string-match "\\([^/]+\\)/?$" tmp)
117+ (string-match "\\([^/]+\\)/?\\'" tmp)
118118 (match-string 1 tmp)))
119119
120120 (defun fsvn-url-directory-file-name (url)
121- (if (string-match "/$" url)
121+ (if (string-match "/\\'" url)
122122 (substring url 0 -1)
123123 url))
124124
125125 (defun fsvn-url-dirname (url)
126126 (let ((tmp (directory-file-name url)))
127- (if (string-match "^\\(.*/\\)\\([^/]+\\)$" tmp)
127+ (if (string-match "\\`\\(.*/\\)\\([^/]+\\)\\'" tmp)
128128 (match-string 1 tmp)
129129 tmp)))
130130
131131 (defun fsvn-url-filename (url)
132132 (let ((tmp (directory-file-name url)))
133- (when (string-match "\\([^/]+\\)$" tmp)
133+ (when (string-match "\\([^/]+\\)\\'" tmp)
134134 (match-string 1 tmp))))
135135
136136 (defun fsvn-url-relative-name (full-url base-url)
@@ -165,13 +165,13 @@
165165 (fsvn-url-filename (car urlobj))))
166166
167167 (defun fsvn-url-as-directory (url)
168- (if (string-match "/$" url)
168+ (if (string-match "/\\'" url)
169169 url
170170 (concat url "/")))
171171
172172 ;; (defun fsvn-urlrev-read-only-p (urlrev)
173173 ;; (if (fsvn-url-repository-p urlrev)
174-;; (not (string-match "@\\(HEAD\\)$" urlrev))))
174+;; (not (string-match "@\\(HEAD\\)\\'" urlrev))))
175175
176176 (defun fsvn-url-p (string)
177177 (or (fsvn-url-repository-p string)
@@ -179,7 +179,7 @@
179179 (not (fsvn-magic-file-name-absolute-p string))))
180180
181181 (defun fsvn-url-repository-p (url)
182- (string-match (concat "^" (regexp-opt fsvn-svn-url-scheme-segment-list)) url))
182+ (string-match (concat "\\`" (regexp-opt fsvn-svn-url-scheme-segment-list)) url))
183183
184184 (defun fsvn-url-local-p (url)
185185 (and (not (fsvn-url-repository-p url))
@@ -188,17 +188,17 @@
188188
189189 (defun fsvn-url-contains-p (parent url)
190190 "URL is child of PARENT or same as PARENT then return non-nil."
191- (or (string-match (concat "^" (regexp-quote (fsvn-url-as-directory parent))) url)
191+ (or (string-match (concat "\\`" (regexp-quote (fsvn-url-as-directory parent))) url)
192192 (fsvn-file= parent url)))
193193
194194 (defun fsvn-url-descendant-p (parent url)
195195 "URL is descendant of PARENT then return non-nil."
196196 (and (not (string= (directory-file-name parent) (directory-file-name url)))
197- (string-match (concat "^" (regexp-quote (fsvn-url-as-directory parent))) url)))
197+ (string-match (concat "\\`" (regexp-quote (fsvn-url-as-directory parent))) url)))
198198
199199 (defun fsvn-url-child-p (parent url)
200200 (and (not (string= (directory-file-name parent) (directory-file-name url)))
201- (string-match (concat "^" (regexp-quote (fsvn-url-as-directory parent)) "[^/]+/?$") url)))
201+ (string-match (concat "\\`" (regexp-quote (fsvn-url-as-directory parent)) "[^/]+/?\\'") url)))
202202
203203 (defun fsvn-url-grand-child-p (parent url)
204204 (and (fsvn-url-descendant-p parent url)
@@ -205,7 +205,7 @@
205205 (not (fsvn-url-child-p parent url))))
206206
207207 (defun fsvn-url-only-child (base-url url)
208- (when (string-match (concat "^\\(" (regexp-quote (fsvn-url-as-directory base-url)) "[^/]+\\)/?") url)
208+ (when (string-match (concat "\\`\\(" (regexp-quote (fsvn-url-as-directory base-url)) "[^/]+\\)/?") url)
209209 (match-string 1 url)))
210210
211211 (defun fsvn-url-remove-authority (url)
@@ -245,9 +245,9 @@
245245
246246 (if (memq system-type '(windows-nt))
247247 (defun fsvn-file-name-root-p (file)
248- (string-match "^[a-zA-Z]:/?$" file))
248+ (string-match "\\`[a-zA-Z]:/?\\'" file))
249249 (defun fsvn-file-name-root-p (file)
250- (string-match "^/$" file)))
250+ (string-match "\\`/\\'" file)))
251251
252252 (defun fsvn-file-name-directory (file)
253253 (directory-file-name (fsvn-expand-file (file-name-directory file))))
@@ -257,9 +257,9 @@
257257
258258 (defun fsvn-file-name-nondirectory (url)
259259 (cond
260- ((string-match "/\\([^/]+\\)/?$" url)
260+ ((string-match "/\\([^/]+\\)/?\\'" url)
261261 (match-string 1 url))
262- ((string-match "^\\([^/]+\\)$" url)
262+ ((string-match "\\`\\([^/]+\\)\\'" url)
263263 (match-string 1 url))
264264 (t
265265 (error "Error while parsing filename"))))
@@ -292,7 +292,7 @@
292292 (when ext (concat "." ext)))))
293293
294294 (defun fsvn-directory-name-as-repository (directory)
295- (if (string-match "^/" directory)
295+ (if (string-match "\\`/" directory)
296296 (concat "file://" directory)
297297 (concat "file:///" directory)))
298298
@@ -342,7 +342,7 @@
342342 (setq src-diff (nreverse src-list))
343343 (setq dest-diff (nreverse dest-list))
344344 ;; Match to `.'
345- (if (string-match "^\\([^.]+\\)\\." (concat same))
345+ (if (string-match "\\`\\([^.]+\\)\\." (concat same))
346346 (let ((rest (match-string 1 (concat same))))
347347 (cons (concat src-diff rest) (concat dest-diff rest)))
348348 (cons (concat src-diff) (concat dest-diff)))))
--- trunk/fsvn-config.el (revision 311)
+++ trunk/fsvn-config.el (revision 312)
@@ -20,7 +20,7 @@
2020 (let ((config (catch 'matched
2121 (mapc
2222 (lambda (x)
23- (when (and x (string-match (concat "^" (regexp-quote (car x))) url))
23+ (when (and x (string-match (concat "\\`" (regexp-quote (car x))) url))
2424 (throw 'matched x)))
2525 fsvn-repository-alist)
2626 nil))
--- trunk/fsvn-ui.el (revision 311)
+++ trunk/fsvn-ui.el (revision 312)
@@ -229,9 +229,9 @@
229229 (cond
230230 ((fsvn-string-assoc word fsvn-word-irregular-plural-alist)
231231 (cdr (fsvn-string-assoc word fsvn-word-irregular-plural-alist)))
232- ((string-match "\\(sh\\|ch\\|o\\|s\\|x\\)$" word)
232+ ((string-match "\\(sh\\|ch\\|o\\|s\\|x\\)\\'" word)
233233 (concat word "es"))
234- ((string-match "\\(y\\)$" word)
234+ ((string-match "\\(y\\)\\'" word)
235235 (replace-match "ies" nil nil word 1))
236236 (t
237237 (concat word "s"))))
--- trunk/ChangeLog (revision 311)
+++ trunk/ChangeLog (revision 312)
@@ -1,3 +1,11 @@
1+2014-02-09 Masahiro Hayashi (林 雅博) <mhayashi1120@gmail.com>
2+
3+ * Fix: string-match to beginning/end of string
4+
5+2014-02-08 Masahiro Hayashi (林 雅博) <mhayashi1120@gmail.com>
6+
7+ * Improve: Display version of working copy when `upgrade'.
8+
19 2014-02-07 Masahiro Hayashi (林 雅博) <mhayashi1120@gmail.com>
210
311 * Add: `fsvn-add-command-location' function to support switching
--- trunk/fsvn-dev.el (revision 311)
+++ trunk/fsvn-dev.el (revision 312)
@@ -333,7 +333,7 @@
333333 (delq nil
334334 (mapcar
335335 (lambda (name)
336- (and (string-match "^[0-9]+$" name)
336+ (and (string-match "\\`[0-9]+\\'" name)
337337 (string-to-number name)))
338338 files))
339339 '>))))
@@ -785,7 +785,7 @@
785785 (fsvn-url-branches/tags urlrev "tags"))
786786
787787 (defun fsvn-url-branches/tags (urlrev name)
788- (when (string-match "^\\(.*\\)/trunk" urlrev)
788+ (when (string-match "\\`\\(.*\\)/trunk" urlrev)
789789 (let ((rev (or (fsvn-urlrev-revision urlrev) "HEAD"))
790790 (b/t (concat (match-string 1 urlrev) "/" name "/")))
791791 (delq nil
--- trunk/fsvn-select.el (revision 311)
+++ trunk/fsvn-select.el (revision 312)
@@ -416,7 +416,7 @@
416416 (fsvn-move-to-filename))
417417
418418 (defun fsvn-select-file-remove-file-hierarchy (file)
419- (let ((regexp (format "^%s\\(/\\|$\\)" (directory-file-name file)))
419+ (let ((regexp (format "\\`%s\\(/\\|\\'\\)" (directory-file-name file)))
420420 cur)
421421 (save-excursion
422422 (fsvn-select-file-first-file)
--- trunk/fsvn-pub.el (revision 311)
+++ trunk/fsvn-pub.el (revision 312)
@@ -67,7 +67,7 @@
6767 (t
6868 (setq messages (cons msg messages))
6969 (setq time (format-time-string "%s" (nth 5 (file-attributes f))))
70- (unless (string-match (concat "^" time) (fsvn-file-name-nondirectory f))
70+ (unless (string-match (concat "\\`" time) (fsvn-file-name-nondirectory f))
7171 (while (file-exists-p (setq file (make-temp-name (fsvn-expand-file time d)))))
7272 (rename-file f file)
7373 (setq renamed (1+ renamed))))))
@@ -368,11 +368,11 @@
368368 (funcall 'ad-activate (nth 0 x))))
369369 fsvn-advised-alist)
370370 (setq file-handler (assoc fsvn-magic-file-name-regexp file-name-handler-alist))
371- (setq auto-mode (list (concat "@\\(?:" fsvn-revision-regexp "\\)$") 'ignore t))
371+ (setq auto-mode (list (concat "@\\(?:" fsvn-revision-regexp "\\)\\'") 'ignore t))
372372 (setq ignore-buffers
373373 (list
374- (concat "^" (regexp-quote fsvn-log-sibling-buffer-name) "$")
375- (concat "^" (regexp-quote fsvn-log-message-buffer-name) "$")))
374+ (concat "\\`" (regexp-quote fsvn-log-sibling-buffer-name) "\\'")
375+ (concat "\\`" (regexp-quote fsvn-log-message-buffer-name) "\\'")))
376376 (cond
377377 (feature
378378 ;; for ediff
@@ -445,7 +445,11 @@
445445 (list file url args)))
446446
447447 (defun fsvn-cmd-read-upgrade-args ()
448- (let* ((dir (fsvn-read-directory-name "Upgrade directory: " nil nil t))
448+ (let* ((current (fsvn-file-wc-svn-version default-directory))
449+ (svn-ver fsvn-svn-version)
450+ (prompt (format "Upgrade directory (%s -> %s): "
451+ current svn-ver))
452+ (dir (fsvn-read-directory-name prompt nil nil t))
449453 (args (fsvn-browse-cmd-read-wc-path-with-args "upgrade")))
450454 (list dir args)))
451455
@@ -583,7 +587,7 @@
583587 (fsvn-each-browse-buffer
584588 (let ((url (fsvn-urlrev-url urlrev))
585589 (root (fsvn-buffer-repos-root)))
586- (when (and root (string-match (concat "^" (regexp-quote root) "\\(.*\\)") url))
590+ (when (and root (string-match (concat "\\`" (regexp-quote root) "\\(.*\\)") url))
587591 (let ((regexp (format fsvn-browse-re-format-subdir (match-string 1 url))))
588592 (save-excursion
589593 (goto-char (point-min))
--- trunk/fsvn-dired.el (revision 311)
+++ trunk/fsvn-dired.el (revision 312)
@@ -182,7 +182,7 @@
182182 (dired-move-to-filename))
183183 (when (and (setq temp (fsvn-dired-get-filename nil t))
184184 (or get-dot-file
185- (not (string-match "/\\.\\.?$" temp))))
185+ (not (string-match "/\\.\\.?\\'" temp))))
186186 (setq ret (cons temp ret)))
187187 (forward-line 1)))
188188 (nreverse ret)))
@@ -198,7 +198,7 @@
198198 (when (and (looking-at regexp)
199199 (setq temp (fsvn-dired-get-filename))
200200 (or get-dot-file
201- (not (string-match "/\\.\\.?$" temp))))
201+ (not (string-match "/\\.\\.?\\'" temp))))
202202 (setq ret (cons temp ret)))
203203 (forward-line 1)))
204204 ret))
--- trunk/fsvn-minibuf.el (revision 311)
+++ trunk/fsvn-minibuf.el (revision 312)
@@ -128,7 +128,7 @@
128128
129129 (defun fsvn-read-branch/tag (url dirname prompt)
130130 (let ((default url))
131- (when (string-match "^\\(.*\\)/trunk" url)
131+ (when (string-match "\\`\\(.*\\)/trunk" url)
132132 (setq default (concat (match-string 1 url) "/" dirname "/")))
133133 (fsvn-completing-read-url prompt default t)))
134134
@@ -345,11 +345,11 @@
345345 (setq urlrev (fsvn-electric-select-log fsvn-complete-processing-revision-urlrev))
346346 (when urlrev
347347 (insert (fsvn-get-revision-string (fsvn-urlrev-revision urlrev)))))))
348- ((string-match "^[0-9]+$" value)
348+ ((string-match "\\`[0-9]+\\'" value)
349349 ;; do nothing
350350 (fsvn-complete-completion-window-delete)
351351 (fsvn-display-momentary-message " [Number context]"))
352- ((string-match "^{" value)
352+ ((string-match "\\`{" value)
353353 ;; do nothing
354354 (fsvn-complete-completion-window-delete)
355355 (fsvn-display-momentary-message " [Date context]"))
@@ -536,14 +536,14 @@
536536 (defun fsvn-complete-url-local-file-previous-segment (string)
537537 (cond
538538 ;; for windows
539- ((string-match "^file:///\\([a-zA-Z]:.*\\)/[^/]*$" string)
539+ ((string-match "\\`file:///\\([a-zA-Z]:.*\\)/[^/]*\\'" string)
540540 (match-string 1 string))
541541 ;; for windows
542- ((string-match "^file:///\\([a-zA-Z]:\\)" string)
542+ ((string-match "\\`file:///\\([a-zA-Z]:\\)" string)
543543 (match-string 1 string))
544- ((string-match "^file://\\(/.*?\\)[^/]*$" string)
544+ ((string-match "\\`file://\\(/.*?\\)[^/]*\\'" string)
545545 (match-string 1 string))
546- ((string-match "^file://\\(/.*?\\)/$" string)
546+ ((string-match "\\`file://\\(/.*?\\)/\\'" string)
547547 (match-string 1 string))
548548 (t
549549 (fsvn-complete-url-previous-segment string))))
@@ -552,13 +552,13 @@
552552 (cond
553553 ((fsvn-file-name-root-p string)
554554 string)
555- ((string-match "^\\(.*\\)/$" string)
555+ ((string-match "\\`\\(.*\\)/\\'" string)
556556 (match-string 1 string))
557- ((string-match "^\\(.*\\)/[^/]+$" string)
557+ ((string-match "\\`\\(.*\\)/[^/]+\\'" string)
558558 (match-string 1 string))))
559559
560560 (defun fsvn-complete-url-host-segment-p (contents)
561- (let ((regexp (concat "^" (regexp-opt (fsvn-delete "file" fsvn-svn-url-scheme-list) t) ":/+\\([^/]+\\)?$")))
561+ (let ((regexp (concat "\\`" (regexp-opt (fsvn-delete "file" fsvn-svn-url-scheme-list) t) ":/+\\([^/]+\\)?\\'")))
562562 (string-match regexp contents)))
563563
564564 (defun fsvn-complete-url-local-repository-p (contents)
@@ -567,11 +567,11 @@
567567 (not (fsvn-any-startswith (fsvn-gather-root) contents)))))
568568
569569 (defun fsvn-complete-url-last-segment (url)
570- (when (string-match "/\\([^/]+/?\\)$" url)
570+ (when (string-match "/\\([^/]+/?\\)\\'" url)
571571 (match-string 1 url)))
572572
573573 (defun fsvn-complete-url-filename (string)
574- (if (string-match "/\\([^/]+\\)$" string)
574+ (if (string-match "/\\([^/]+\\)\\'" string)
575575 (match-string 1 string)
576576 ""))
577577
@@ -601,7 +601,7 @@
601601 (cdr (fsvn-string-assoc dir fsvn-complete-completion-repository-cache))))
602602
603603 (defun fsvn-complete-url-repository-p (url)
604- (string-match (concat "^" (regexp-opt fsvn-svn-url-scheme-list) ":") url))
604+ (string-match (concat "\\`" (regexp-opt fsvn-svn-url-scheme-list) ":") url))
605605
606606 (defun fsvn-complete-subcommand-args-action ()
607607 (interactive)
@@ -660,7 +660,7 @@
660660 (mapcar
661661 (lambda (x)
662662 (cond
663- ((and (string-match "^-[^-]$" x)
663+ ((and (string-match "\\`-[^-]\\'" x)
664664 (setq tmp (fsvn-subcommand-assoc-argument x (cdr fsvn-complete-reading-subcommand))))
665665 ;; get long option
666666 (caar tmp))
@@ -752,7 +752,7 @@
752752 (cond
753753 ((and (eq next-applicant all-applicant)
754754 (or (null current)
755- (not (string-match "^-" current))))
755+ (not (string-match "\\`-" current))))
756756 (setq collection 'fsvn-complete-url-action))
757757 ((and (null current) (null next-applicant))
758758 (setq collection toplevel)))
--- trunk/DOC/fsvn-publish.el (revision 311)
+++ trunk/DOC/fsvn-publish.el (revision 312)
@@ -22,13 +22,13 @@
2222 (expand-file-name "Wiki" fsvn-publish-doc-directory))
2323
2424 (defun fsvn-publish-content-lang (html)
25- (let ((regexp "\\.html\\.\\(..\\)$"))
25+ (let ((regexp "\\.html\\.\\(..\\)\\'"))
2626 (string-match regexp html)
2727 (match-string 1 html)))
2828
2929 (defun fsvn-publish-html-file (piki)
3030 (let ((path (file-relative-name piki fsvn-publish-wiki-directory)))
31- (unless (string-match "/\\([^/]+\\)-\\(..\\)\\.piki$" piki)
31+ (unless (string-match "/\\([^/]+\\)-\\(..\\)\\.piki\\'" piki)
3232 (error "Invalid filename %s" piki))
3333 (let ((name (match-string 1 piki))
3434 (lang (match-string 2 piki))
@@ -48,7 +48,7 @@
4848 ret))
4949
5050 (defun fsvn-publish-files ()
51- (fsvn-publish-directory-files fsvn-publish-wiki-directory "\\.piki$"))
51+ (fsvn-publish-directory-files fsvn-publish-wiki-directory "\\.piki\\'"))
5252
5353 (defun fsvn-publish ()
5454 (interactive)
--- trunk/fsvn-browse.el (revision 311)
+++ trunk/fsvn-browse.el (revision 312)
@@ -725,7 +725,7 @@
725725 (when (fsvn-deps-file-registered-p file)
726726 file))
727727 (directory-files src-dir t (concat "^" (regexp-quote (car prefix))))))
728- (setq regexp (concat "^" (regexp-quote (car prefix)) "\\(.*\\)$"))
728+ (setq regexp (concat "\\`" (regexp-quote (car prefix)) "\\(.*\\)\\'"))
729729 (mapcar
730730 (lambda (src-file)
731731 (let ((src-name (fsvn-file-name-nondirectory src-file))
--- trunk/fsvn-cmd.el (revision 311)
+++ trunk/fsvn-cmd.el (revision 312)
@@ -659,7 +659,7 @@
659659 (catch 'found
660660 (mapc
661661 (lambda (ls-entry)
662- (when (string-match (format "^%s$" orig-name) (fsvn-xml-lists->list->entry=>name$ ls-entry))
662+ (when (string-match (format "\\`%s\\'" orig-name) (fsvn-xml-lists->list->entry=>name$ ls-entry))
663663 (throw 'found ls-entry)))
664664 (fsvn-get-ls dir))))
665665 new-name)
@@ -733,7 +733,7 @@
733733 (mapc
734734 (lambda (p)
735735 (setq prop (process-get p 'fsvn-recursive-status-top-directory))
736- (when (and prop (or (string-match (concat "^" (regexp-quote prop) "/") dirname)
736+ (when (and prop (or (string-match (concat "\\`" (regexp-quote prop) "/") dirname)
737737 (string= dirname prop)))
738738 (throw 'yes p)))
739739 (process-list))
--- trunk/fsvn-proc.el (revision 311)
+++ trunk/fsvn-proc.el (revision 312)
@@ -37,11 +37,11 @@
3737 nil))
3838
3939 (defun fsvn-start-process (buffer &rest args)
40- (fsvn-process-environment
41- (let* ((real-args (fsvn-command-args-canonicalize args))
42- (coding-system-for-read (fsvn-process-coding-system real-args))
43- (command (fsvn-svn-proper-command real-args)))
44- (fsvn-debug real-args)
40+ (let* ((real-args (fsvn-command-args-canonicalize args))
41+ (coding-system-for-read (fsvn-process-coding-system real-args))
42+ (command (fsvn-svn-proper-command real-args)))
43+ (fsvn-debug real-args)
44+ (fsvn-process-environment
4545 (apply 'start-file-process "fsvn" buffer command real-args))))
4646
4747 (defun fsvn-start-command (subcommand buffer &rest args)
@@ -59,17 +59,17 @@
5959 This is synchronous call, so cannot handle password prompt. Append --non-interactive arg
6060 explicitly in calling function.
6161 "
62- (fsvn-process-environment
63- (let* ((real-args (fsvn-command-args-canonicalize args))
64- (coding-system-for-read (fsvn-process-coding-system real-args))
65- (command (fsvn-svn-proper-command real-args)))
66- (when (and (bufferp buffer) (> (buffer-size buffer) 0))
67- (with-current-buffer buffer
68- (goto-char (point-max))))
69- (fsvn-debug real-args)
70- (prog1
71- (apply 'process-file command nil buffer nil real-args)
72- (fsvn-debug buffer)))))
62+ (let* ((real-args (fsvn-command-args-canonicalize args))
63+ (coding-system-for-read (fsvn-process-coding-system real-args))
64+ (command (fsvn-svn-proper-command real-args)))
65+ (when (and (bufferp buffer) (> (buffer-size buffer) 0))
66+ (with-current-buffer buffer
67+ (goto-char (point-max))))
68+ (fsvn-debug real-args)
69+ (prog1
70+ (fsvn-process-environment
71+ (apply 'process-file command nil buffer nil real-args))
72+ (fsvn-debug buffer))))
7373
7474 (defun fsvn-call-command (subcommand buffer &rest args)
7575 (apply 'fsvn-call-process buffer subcommand (fsvn-command-append-argument subcommand args)))
@@ -340,7 +340,7 @@
340340 (unless (file-directory-p url)
341341 (when (setq cs (fsvn-file-guessed-coding-system url))
342342 (throw 'guessed cs)))))))
343- ((string-match "^--[a-zA-Z]" arg)
343+ ((string-match "\\`--[a-zA-Z]" arg)
344344 (setq ignore (assoc arg '("--targets" "--file"))))
345345 ((not (fsvn-url-local-p arg)))
346346 (t
--- trunk/fsvn-svk.el (revision 311)
+++ trunk/fsvn-svk.el (revision 312)
@@ -106,7 +106,7 @@
106106 (fsvn-directory-name-as-repository dir))))
107107
108108 (defun fsvn-svk-depotpath-url (depotpath)
109- (when (string-match "^//\\(.*\\)" depotpath)
109+ (when (string-match "\\`//\\(.*\\)" depotpath)
110110 (fsvn-expand-url (match-string 1 depotpath) (fsvn-svk-depotmap-url))))
111111
112112 (defun fsvn-svk-mirrored-repository-url (file)
@@ -295,7 +295,7 @@
295295 proc))
296296
297297 (defun fsvn-svk-depotpath-name (depotpath)
298- (if (string-match "/$" depotpath)
298+ (if (string-match "/\\'" depotpath)
299299 (substring depotpath 0 -1)
300300 depotpath))
301301
Show on old repository browser