修訂 | 312 (tree) |
---|---|
時間 | 2014-02-09 11:39:59 |
作者 | mhayashi1120 |
fix
@@ -224,7 +224,7 @@ | ||
224 | 224 | (setq alist |
225 | 225 | (fsvn-mapitem |
226 | 226 | (lambda (value) |
227 | - (when (string-match "^\\([^=]+\\)=\\(.*\\)" value) | |
227 | + (when (string-match "\\`\\([^=]+\\)=\\(.*\\)" value) | |
228 | 228 | (cons (match-string 1 value) (match-string 2 value)))) |
229 | 229 | values)) |
230 | 230 | (cons (fsvn-svn-autoprop-wildcard->regexp key) alist))))) |
@@ -218,7 +218,7 @@ | ||
218 | 218 | (setq current copyfrom) |
219 | 219 | (setq ret (cons (cons rev copyfrom) ret)) |
220 | 220 | (throw 'done t)) |
221 | - ((string-match (concat "^" (regexp-quote logpath) "/") target) | |
221 | + ((string-match (concat "\\`" (regexp-quote logpath) "/") target) | |
222 | 222 | ;; match to ancestor of the target |
223 | 223 | ;; may exact match to target |
224 | 224 | (setq next (fsvn-expand-url (substring target (match-end 0)) copyfrom))))))) |
@@ -299,7 +299,7 @@ | ||
299 | 299 | (let ((root (fsvn-xml-info->entry=>repository=>root$ info)) |
300 | 300 | (url (fsvn-xml-info->entry=>url$ info)) |
301 | 301 | ret) |
302 | - (when (string-match (concat "^\\(" (regexp-quote root) "\\)") url) | |
302 | + (when (string-match (concat "\\`\\(" (regexp-quote root) "\\)") url) | |
303 | 303 | (setq ret (replace-match "" nil nil url 1)) |
304 | 304 | (when (string= ret "") |
305 | 305 | (setq ret "/"))) |
@@ -377,7 +377,7 @@ | ||
377 | 377 | |
378 | 378 | (defun fsvn-repository-path (root urlrev) |
379 | 379 | (let ((url (fsvn-urlrev-url urlrev))) |
380 | - (when (string-match (concat "^" (regexp-quote root)) url) | |
380 | + (when (string-match (concat "\\`" (regexp-quote root)) url) | |
381 | 381 | (replace-match "" nil nil url 0)))) |
382 | 382 | |
383 | 383 | (defun fsvn-find-parent-working-copy (directory) |
@@ -181,7 +181,7 @@ | ||
181 | 181 | (error "%s not exists." src)) |
182 | 182 | (copy-file src dest t) |
183 | 183 | (set-file-modes dest ?\644)))) |
184 | - (directory-files "./images" nil "\\.xpm$"))) | |
184 | + (directory-files "./images" nil "\\.xpm\\'"))) | |
185 | 185 | |
186 | 186 | (defun fsvn-make-test () |
187 | 187 | (mapc |
@@ -247,7 +247,7 @@ | ||
247 | 247 | (defun mw32cmp-registry-pseudo-parse-key (key) |
248 | 248 | "return cons cell (rootkey . subkey)" |
249 | 249 | (when (stringp key) |
250 | - (when (string-match "^\\([^\\\\]+\\)\\(?:\\\\\\(.*\\)\\)?" key) | |
250 | + (when (string-match "\\`\\([^\\\\]+\\)\\(?:\\\\\\(.*\\)\\)?" key) | |
251 | 251 | (cons (match-string 1 key) (match-string 2 key))))) |
252 | 252 | |
253 | 253 | (defun mw32cmp-registry-pseudo-parse-data (data) |
@@ -301,7 +301,7 @@ | ||
301 | 301 | (concat (nreverse list)))) |
302 | 302 | |
303 | 303 | (defun mw32cmp-registry-parse-dword (value) |
304 | - (unless (string-match "^0x\\([0-9a-z]+\\)$" value) | |
304 | + (unless (string-match "\\`0x\\([0-9a-z]+\\)\\'" value) | |
305 | 305 | (signal 'error (list "Not a hex value" value))) |
306 | 306 | (let ((hex (match-string 1 value)) |
307 | 307 | num val) |
@@ -149,7 +149,7 @@ | ||
149 | 149 | |
150 | 150 | (defun fsvn-test-unbound-functions () |
151 | 151 | (let ((targetp (lambda (s) |
152 | - (and (string-match "^fsvn-test-" (symbol-name s)) | |
152 | + (and (string-match "\\`fsvn-test-" (symbol-name s)) | |
153 | 153 | (functionp s) |
154 | 154 | (listp (symbol-function s)))))) |
155 | 155 | (mapatoms |
@@ -306,7 +306,7 @@ | ||
306 | 306 | ;;FIXME dirty |
307 | 307 | (when (and scheme segments) |
308 | 308 | (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))))) | |
310 | 310 | (mapconcat 'identity segments "/")) |
311 | 311 | |
312 | 312 | (defun fsvn-magic-parse-file-as-writable (file) |
@@ -341,7 +341,7 @@ | ||
341 | 341 | ;;FIXME dirty |
342 | 342 | (when (and scheme segments) |
343 | 343 | (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))))) | |
345 | 345 | (mapconcat 'identity segments "/")) |
346 | 346 | |
347 | 347 | (defun fsvn-magic-expand-file-name (file &optional directory) |
@@ -485,7 +485,7 @@ | ||
485 | 485 | ((member (fsvn-urlrev-url urlrev) roots) |
486 | 486 | ;; when guessed root directory.. |
487 | 487 | directory) |
488 | - ((string-match "/$" directory) | |
488 | + ((string-match "/\\'" directory) | |
489 | 489 | (substring directory 0 -1)) |
490 | 490 | (t |
491 | 491 | directory)))) |
@@ -497,7 +497,7 @@ | ||
497 | 497 | ((member (concat (fsvn-urlrev-url urlrev) "/") roots) |
498 | 498 | ;; when guessed root directory.. |
499 | 499 | filename) |
500 | - ((string-match "/$" filename) | |
500 | + ((string-match "/\\'" filename) | |
501 | 501 | filename) |
502 | 502 | (t |
503 | 503 | (fsvn-magic-create-name (fsvn-urlrev-dirname urlrev)))))) |
@@ -689,7 +689,7 @@ | ||
689 | 689 | (eq (string-match fsvn-magic-file-name-regexp file) 0)) |
690 | 690 | |
691 | 691 | (defun fsvn-magic-file-name-all-completions (file directory) |
692 | - (let ((regexp (concat "^" (regexp-quote file)))) | |
692 | + (let ((regexp (concat "\\`" (regexp-quote file)))) | |
693 | 693 | (fsvn-magic-each-directory-entry directory entry |
694 | 694 | (let ((name (fsvn-xml-lists->list->entry=>name$ entry))) |
695 | 695 | (cond |
@@ -700,7 +700,7 @@ | ||
700 | 700 | name)))))) |
701 | 701 | |
702 | 702 | (defun fsvn-magic-file-name-completion (file directory &optional predicate) |
703 | - (let ((regexp (concat "^" (regexp-quote file))) | |
703 | + (let ((regexp (concat "\\`" (regexp-quote file))) | |
704 | 704 | completions) |
705 | 705 | (unless predicate |
706 | 706 | (setq predicate (lambda (x) t))) |
@@ -52,7 +52,7 @@ | ||
52 | 52 | (interactive) |
53 | 53 | (mapatoms |
54 | 54 | (lambda (x) |
55 | - (when (string-match "^fsvn" (symbol-name x)) | |
55 | + (when (string-match "\\`fsvn" (symbol-name x)) | |
56 | 56 | (when (fboundp x) |
57 | 57 | (fset x nil)) |
58 | 58 | (when (boundp x) |
@@ -183,13 +183,13 @@ | ||
183 | 183 | ret))) |
184 | 184 | |
185 | 185 | (defun fsvn-string-rm-lspace (string) |
186 | - (replace-regexp-in-string "^[ \t\n]+" "" string)) | |
186 | + (replace-regexp-in-string "\\`[ \t\n]+" "" string)) | |
187 | 187 | |
188 | 188 | (defun fsvn-string-rm-rspace (string) |
189 | - (replace-regexp-in-string "[ \t\n]+$" "" string)) | |
189 | + (replace-regexp-in-string "[ \t\n]+\\'" "" string)) | |
190 | 190 | |
191 | 191 | (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)) | |
193 | 193 | |
194 | 194 | (defun fsvn-string-force-number (string &optional default-value) |
195 | 195 | "Return string as number, return zero if failed convert." |
@@ -337,13 +337,13 @@ | ||
337 | 337 | (setq list (cdr list))))) |
338 | 338 | |
339 | 339 | (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)) | |
341 | 341 | |
342 | 342 | (defun fsvn-any-startswith (list string) |
343 | 343 | "STRING startwith any LIST item." |
344 | 344 | (catch 'match |
345 | 345 | (while list |
346 | - (when (string-match (concat "^" (regexp-quote (car list))) string) | |
346 | + (when (string-match (concat "\\`" (regexp-quote (car list))) string) | |
347 | 347 | (throw 'match list)) |
348 | 348 | (setq list (cdr list))))) |
349 | 349 |
@@ -410,7 +410,7 @@ | ||
410 | 410 | (defvar vc-mode) |
411 | 411 | (and (boundp 'vc-mode) |
412 | 412 | (stringp vc-mode) |
413 | - (string-match "^ SVN" vc-mode))) | |
413 | + (string-match "\\` SVN" vc-mode))) | |
414 | 414 | |
415 | 415 | |
416 | 416 |
@@ -550,7 +550,7 @@ | ||
550 | 550 | (let (ret) |
551 | 551 | (mapc |
552 | 552 | (lambda (p) |
553 | - (when (string-match "^fsvn" (process-name p)) | |
553 | + (when (string-match "\\`fsvn" (process-name p)) | |
554 | 554 | (mapc |
555 | 555 | (lambda (string) |
556 | 556 | (when (and (file-name-absolute-p string) |
@@ -604,7 +604,7 @@ | ||
604 | 604 | ret)) |
605 | 605 | |
606 | 606 | (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)) "/")) | |
608 | 608 | ret) |
609 | 609 | (mapc |
610 | 610 | (lambda (buffer) |
@@ -353,31 +353,36 @@ | ||
353 | 353 | (cond |
354 | 354 | ((member (car-safe flat-args) '("upgrade")) |
355 | 355 | 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))) | |
376 | 376 | (fsvn-svn-fetch-proper-version ver)) |
377 | 377 | (error |
378 | 378 | (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))) | |
381 | 386 | |
382 | 387 | (defun fsvn-svn-fetch-proper-version (&optional format-version) |
383 | 388 | (catch 'found |
@@ -398,7 +403,7 @@ | ||
398 | 403 | (let ((raw-version (car (fsvn-text-buffer-line-as-list))) |
399 | 404 | version) |
400 | 405 | ;; 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) | |
402 | 407 | (error "Unsupported version")) |
403 | 408 | (match-string 1 raw-version)))) |
404 | 409 |
@@ -622,12 +627,12 @@ | ||
622 | 627 | fsvn-svn-url-scheme-list)) |
623 | 628 | |
624 | 629 | (defun fsvn-revision-number-p (string) |
625 | - (if (string-match "^[0-9]+$" string) | |
630 | + (if (string-match "\\`[0-9]+\\'" string) | |
626 | 631 | (string-to-number string) |
627 | 632 | nil)) |
628 | 633 | |
629 | 634 | (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) | |
631 | 636 | t |
632 | 637 | nil)) |
633 | 638 |
@@ -691,7 +696,7 @@ | ||
691 | 696 | (car propname)))) |
692 | 697 | fsvn-property-list)) |
693 | 698 | |
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-.:_]*\\'") | |
695 | 700 | |
696 | 701 | ;; http://svn.collab.net/repos/svn/trunk/subversion/libsvn_subr/properties.c |
697 | 702 | (defun fsvn-svn-valid-propname-p (propname) |
@@ -699,7 +704,7 @@ | ||
699 | 704 | (string-match fsvn-svn-valid-propname-regexp propname)) |
700 | 705 | |
701 | 706 | (defun fsvn-propname-svn-texture-p (propname) |
702 | - (string-match "^svn:" propname)) | |
707 | + (string-match "\\`svn:" propname)) | |
703 | 708 | |
704 | 709 | (defcustom fsvn-svn-home-directory |
705 | 710 | (let (tmp) |
@@ -825,8 +830,10 @@ | ||
825 | 830 | (or (and (require 'esqlite nil t) |
826 | 831 | (esqlite-sqlite-installed-p) |
827 | 832 | (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)))) | |
830 | 837 | ((file-exists-p (fsvn-expand-file "entries" ctl)) |
831 | 838 | (with-temp-buffer |
832 | 839 | (insert-file-contents (fsvn-expand-file "entries" ctl) nil 0 16) |
@@ -837,15 +844,17 @@ | ||
837 | 844 | |
838 | 845 | |
839 | 846 | (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 | + ))) | |
849 | 858 | |
850 | 859 | ;; todo elint bug? |
851 | 860 | ;; (setq elint-unknown-builtin-args (delq (assq 'encode-time elint-unknown-builtin-args) elint-unknown-builtin-args)) |
@@ -875,18 +884,18 @@ | ||
875 | 884 | (setq sym (cadr values)) |
876 | 885 | (cond |
877 | 886 | ((fsvn-url-repository-p real)) |
878 | - ((string-match "^\\.\\./" real) | |
887 | + ((string-match "\\`\\.\\./" real) | |
879 | 888 | ;; relate path from current directory |
880 | 889 | (setq base-url (file-name-directory (fsvn-xml-info->entry=>url$ pinfo))) |
881 | 890 | (setq real (fsvn-expand-url (replace-match "" nil nil real) base-url))) |
882 | - ((string-match "^\\^/" real) | |
891 | + ((string-match "\\`\\^/" real) | |
883 | 892 | ;; relate path from repository root |
884 | 893 | (setq base-url (fsvn-xml-info->entry=>repository=>root$ pinfo)) |
885 | 894 | (setq real (fsvn-expand-url (replace-match "" nil nil real) base-url))) |
886 | - ((string-match "^//" real) | |
895 | + ((string-match "\\`//" real) | |
887 | 896 | ;;FIXME not depend on scheme |
888 | 897 | ) |
889 | - ((string-match "^/" real) | |
898 | + ((string-match "\\`/" real) | |
890 | 899 | ;;FIXME relate path from server root |
891 | 900 | )) |
892 | 901 | (cons real sym))) |
@@ -57,7 +57,7 @@ | ||
57 | 57 | |
58 | 58 | |
59 | 59 | (defun mw32cmp-pseudo-registry-concat-key (parent name) |
60 | - (if (string-match "\\\\$" parent) | |
60 | + (if (string-match "\\\\\\'" parent) | |
61 | 61 | (concat parent name) |
62 | 62 | (concat parent "\\\\" name))) |
63 | 63 |
@@ -212,7 +212,7 @@ | ||
212 | 212 | (cygdir (fsvn-cygwin-installed-dir))) |
213 | 213 | (and command |
214 | 214 | cygdir |
215 | - (string-match (concat "^" (regexp-quote cygdir)) command)))) | |
215 | + (string-match (concat "\\`" (regexp-quote cygdir)) command)))) | |
216 | 216 | |
217 | 217 | (defun fsvn-cygwin-expand-path (name &optional default) |
218 | 218 | (let ((inst-dir fsvn-cygwin-installed-dir) |
@@ -220,7 +220,7 @@ | ||
220 | 220 | (cond |
221 | 221 | ((not fsvn-cygwin-guessed-installed) |
222 | 222 | expanded) |
223 | - ((string-match (concat "^" (regexp-quote inst-dir)) expanded) | |
223 | + ((string-match (concat "\\`" (regexp-quote inst-dir)) expanded) | |
224 | 224 | (concat "/" (substring expanded (match-end 0)))) |
225 | 225 | (t |
226 | 226 | (let* ((file (expand-file-name name default)) |
@@ -232,9 +232,9 @@ | ||
232 | 232 | (let ((prefix fsvn-cygwin-drive-prefix-dir) |
233 | 233 | (installed fsvn-cygwin-installed-folder)) |
234 | 234 | (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) | |
236 | 236 | (format "%s:/%s" (match-string 2 path) (match-string 3 path))) |
237 | - ((string-match "^/" path) | |
237 | + ((string-match "\\`/" path) | |
238 | 238 | (format "%s/%s" (expand-file-name installed) (substring path 1))) |
239 | 239 | (t |
240 | 240 | path)))) |
@@ -282,7 +282,7 @@ | ||
282 | 282 | (let (tree args) |
283 | 283 | (setq tree (if arg "/e" "/n")) |
284 | 284 | (cond |
285 | - ((or (null file) (string-match "^\\.\\.?$" file)) | |
285 | + ((or (null file) (string-match "\\`\\.\\.?\\'" file)) | |
286 | 286 | (setq args (list tree (unix-to-dos-filename dir)))) |
287 | 287 | (t |
288 | 288 | (setq args (list tree "/select" (unix-to-dos-filename (expand-file-name file dir)))))) |
@@ -262,7 +262,7 @@ | ||
262 | 262 | (goto-char prev)))))) |
263 | 263 | |
264 | 264 | (defun fsvn-process-list-default-display-p (process) |
265 | - (string-match "^fsvn" (process-name process))) | |
265 | + (string-match "\\`fsvn" (process-name process))) | |
266 | 266 | |
267 | 267 | (defun fsvn-process-list-move-to-command-line () |
268 | 268 | (let ((eol (line-end-position))) |
@@ -20,7 +20,7 @@ | ||
20 | 20 | |
21 | 21 | |
22 | 22 | (defconst fsvn-url-encoding fsvn-svn-common-coding-system) |
23 | -(defconst fsvn-url-with-revision-regexp "^\\(.*\\)@\\([^/@]*\\)\\(@*\\)$") | |
23 | +(defconst fsvn-url-with-revision-regexp "\\`\\(.*\\)@\\([^/@]*\\)\\(@*\\)\\'") | |
24 | 24 | |
25 | 25 | ;; url utility |
26 | 26 |
@@ -114,23 +114,23 @@ | ||
114 | 114 | |
115 | 115 | (defun fsvn-url-ediff-filename (url) |
116 | 116 | (let ((tmp (directory-file-name url))) |
117 | - (string-match "\\([^/]+\\)/?$" tmp) | |
117 | + (string-match "\\([^/]+\\)/?\\'" tmp) | |
118 | 118 | (match-string 1 tmp))) |
119 | 119 | |
120 | 120 | (defun fsvn-url-directory-file-name (url) |
121 | - (if (string-match "/$" url) | |
121 | + (if (string-match "/\\'" url) | |
122 | 122 | (substring url 0 -1) |
123 | 123 | url)) |
124 | 124 | |
125 | 125 | (defun fsvn-url-dirname (url) |
126 | 126 | (let ((tmp (directory-file-name url))) |
127 | - (if (string-match "^\\(.*/\\)\\([^/]+\\)$" tmp) | |
127 | + (if (string-match "\\`\\(.*/\\)\\([^/]+\\)\\'" tmp) | |
128 | 128 | (match-string 1 tmp) |
129 | 129 | tmp))) |
130 | 130 | |
131 | 131 | (defun fsvn-url-filename (url) |
132 | 132 | (let ((tmp (directory-file-name url))) |
133 | - (when (string-match "\\([^/]+\\)$" tmp) | |
133 | + (when (string-match "\\([^/]+\\)\\'" tmp) | |
134 | 134 | (match-string 1 tmp)))) |
135 | 135 | |
136 | 136 | (defun fsvn-url-relative-name (full-url base-url) |
@@ -165,13 +165,13 @@ | ||
165 | 165 | (fsvn-url-filename (car urlobj)))) |
166 | 166 | |
167 | 167 | (defun fsvn-url-as-directory (url) |
168 | - (if (string-match "/$" url) | |
168 | + (if (string-match "/\\'" url) | |
169 | 169 | url |
170 | 170 | (concat url "/"))) |
171 | 171 | |
172 | 172 | ;; (defun fsvn-urlrev-read-only-p (urlrev) |
173 | 173 | ;; (if (fsvn-url-repository-p urlrev) |
174 | -;; (not (string-match "@\\(HEAD\\)$" urlrev)))) | |
174 | +;; (not (string-match "@\\(HEAD\\)\\'" urlrev)))) | |
175 | 175 | |
176 | 176 | (defun fsvn-url-p (string) |
177 | 177 | (or (fsvn-url-repository-p string) |
@@ -179,7 +179,7 @@ | ||
179 | 179 | (not (fsvn-magic-file-name-absolute-p string)))) |
180 | 180 | |
181 | 181 | (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)) | |
183 | 183 | |
184 | 184 | (defun fsvn-url-local-p (url) |
185 | 185 | (and (not (fsvn-url-repository-p url)) |
@@ -188,17 +188,17 @@ | ||
188 | 188 | |
189 | 189 | (defun fsvn-url-contains-p (parent url) |
190 | 190 | "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) | |
192 | 192 | (fsvn-file= parent url))) |
193 | 193 | |
194 | 194 | (defun fsvn-url-descendant-p (parent url) |
195 | 195 | "URL is descendant of PARENT then return non-nil." |
196 | 196 | (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))) | |
198 | 198 | |
199 | 199 | (defun fsvn-url-child-p (parent url) |
200 | 200 | (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))) | |
202 | 202 | |
203 | 203 | (defun fsvn-url-grand-child-p (parent url) |
204 | 204 | (and (fsvn-url-descendant-p parent url) |
@@ -205,7 +205,7 @@ | ||
205 | 205 | (not (fsvn-url-child-p parent url)))) |
206 | 206 | |
207 | 207 | (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) | |
209 | 209 | (match-string 1 url))) |
210 | 210 | |
211 | 211 | (defun fsvn-url-remove-authority (url) |
@@ -245,9 +245,9 @@ | ||
245 | 245 | |
246 | 246 | (if (memq system-type '(windows-nt)) |
247 | 247 | (defun fsvn-file-name-root-p (file) |
248 | - (string-match "^[a-zA-Z]:/?$" file)) | |
248 | + (string-match "\\`[a-zA-Z]:/?\\'" file)) | |
249 | 249 | (defun fsvn-file-name-root-p (file) |
250 | - (string-match "^/$" file))) | |
250 | + (string-match "\\`/\\'" file))) | |
251 | 251 | |
252 | 252 | (defun fsvn-file-name-directory (file) |
253 | 253 | (directory-file-name (fsvn-expand-file (file-name-directory file)))) |
@@ -257,9 +257,9 @@ | ||
257 | 257 | |
258 | 258 | (defun fsvn-file-name-nondirectory (url) |
259 | 259 | (cond |
260 | - ((string-match "/\\([^/]+\\)/?$" url) | |
260 | + ((string-match "/\\([^/]+\\)/?\\'" url) | |
261 | 261 | (match-string 1 url)) |
262 | - ((string-match "^\\([^/]+\\)$" url) | |
262 | + ((string-match "\\`\\([^/]+\\)\\'" url) | |
263 | 263 | (match-string 1 url)) |
264 | 264 | (t |
265 | 265 | (error "Error while parsing filename")))) |
@@ -292,7 +292,7 @@ | ||
292 | 292 | (when ext (concat "." ext))))) |
293 | 293 | |
294 | 294 | (defun fsvn-directory-name-as-repository (directory) |
295 | - (if (string-match "^/" directory) | |
295 | + (if (string-match "\\`/" directory) | |
296 | 296 | (concat "file://" directory) |
297 | 297 | (concat "file:///" directory))) |
298 | 298 |
@@ -342,7 +342,7 @@ | ||
342 | 342 | (setq src-diff (nreverse src-list)) |
343 | 343 | (setq dest-diff (nreverse dest-list)) |
344 | 344 | ;; Match to `.' |
345 | - (if (string-match "^\\([^.]+\\)\\." (concat same)) | |
345 | + (if (string-match "\\`\\([^.]+\\)\\." (concat same)) | |
346 | 346 | (let ((rest (match-string 1 (concat same)))) |
347 | 347 | (cons (concat src-diff rest) (concat dest-diff rest))) |
348 | 348 | (cons (concat src-diff) (concat dest-diff))))) |
@@ -20,7 +20,7 @@ | ||
20 | 20 | (let ((config (catch 'matched |
21 | 21 | (mapc |
22 | 22 | (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)) | |
24 | 24 | (throw 'matched x))) |
25 | 25 | fsvn-repository-alist) |
26 | 26 | nil)) |
@@ -229,9 +229,9 @@ | ||
229 | 229 | (cond |
230 | 230 | ((fsvn-string-assoc word fsvn-word-irregular-plural-alist) |
231 | 231 | (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) | |
233 | 233 | (concat word "es")) |
234 | - ((string-match "\\(y\\)$" word) | |
234 | + ((string-match "\\(y\\)\\'" word) | |
235 | 235 | (replace-match "ies" nil nil word 1)) |
236 | 236 | (t |
237 | 237 | (concat word "s")))) |
@@ -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 | + | |
1 | 9 | 2014-02-07 Masahiro Hayashi (林 雅博) <mhayashi1120@gmail.com> |
2 | 10 | |
3 | 11 | * Add: `fsvn-add-command-location' function to support switching |
@@ -333,7 +333,7 @@ | ||
333 | 333 | (delq nil |
334 | 334 | (mapcar |
335 | 335 | (lambda (name) |
336 | - (and (string-match "^[0-9]+$" name) | |
336 | + (and (string-match "\\`[0-9]+\\'" name) | |
337 | 337 | (string-to-number name))) |
338 | 338 | files)) |
339 | 339 | '>)))) |
@@ -785,7 +785,7 @@ | ||
785 | 785 | (fsvn-url-branches/tags urlrev "tags")) |
786 | 786 | |
787 | 787 | (defun fsvn-url-branches/tags (urlrev name) |
788 | - (when (string-match "^\\(.*\\)/trunk" urlrev) | |
788 | + (when (string-match "\\`\\(.*\\)/trunk" urlrev) | |
789 | 789 | (let ((rev (or (fsvn-urlrev-revision urlrev) "HEAD")) |
790 | 790 | (b/t (concat (match-string 1 urlrev) "/" name "/"))) |
791 | 791 | (delq nil |
@@ -416,7 +416,7 @@ | ||
416 | 416 | (fsvn-move-to-filename)) |
417 | 417 | |
418 | 418 | (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))) | |
420 | 420 | cur) |
421 | 421 | (save-excursion |
422 | 422 | (fsvn-select-file-first-file) |
@@ -67,7 +67,7 @@ | ||
67 | 67 | (t |
68 | 68 | (setq messages (cons msg messages)) |
69 | 69 | (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)) | |
71 | 71 | (while (file-exists-p (setq file (make-temp-name (fsvn-expand-file time d))))) |
72 | 72 | (rename-file f file) |
73 | 73 | (setq renamed (1+ renamed)))))) |
@@ -368,11 +368,11 @@ | ||
368 | 368 | (funcall 'ad-activate (nth 0 x)))) |
369 | 369 | fsvn-advised-alist) |
370 | 370 | (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)) | |
372 | 372 | (setq ignore-buffers |
373 | 373 | (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) "\\'"))) | |
376 | 376 | (cond |
377 | 377 | (feature |
378 | 378 | ;; for ediff |
@@ -445,7 +445,11 @@ | ||
445 | 445 | (list file url args))) |
446 | 446 | |
447 | 447 | (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)) | |
449 | 453 | (args (fsvn-browse-cmd-read-wc-path-with-args "upgrade"))) |
450 | 454 | (list dir args))) |
451 | 455 |
@@ -583,7 +587,7 @@ | ||
583 | 587 | (fsvn-each-browse-buffer |
584 | 588 | (let ((url (fsvn-urlrev-url urlrev)) |
585 | 589 | (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)) | |
587 | 591 | (let ((regexp (format fsvn-browse-re-format-subdir (match-string 1 url)))) |
588 | 592 | (save-excursion |
589 | 593 | (goto-char (point-min)) |
@@ -182,7 +182,7 @@ | ||
182 | 182 | (dired-move-to-filename)) |
183 | 183 | (when (and (setq temp (fsvn-dired-get-filename nil t)) |
184 | 184 | (or get-dot-file |
185 | - (not (string-match "/\\.\\.?$" temp)))) | |
185 | + (not (string-match "/\\.\\.?\\'" temp)))) | |
186 | 186 | (setq ret (cons temp ret))) |
187 | 187 | (forward-line 1))) |
188 | 188 | (nreverse ret))) |
@@ -198,7 +198,7 @@ | ||
198 | 198 | (when (and (looking-at regexp) |
199 | 199 | (setq temp (fsvn-dired-get-filename)) |
200 | 200 | (or get-dot-file |
201 | - (not (string-match "/\\.\\.?$" temp)))) | |
201 | + (not (string-match "/\\.\\.?\\'" temp)))) | |
202 | 202 | (setq ret (cons temp ret))) |
203 | 203 | (forward-line 1))) |
204 | 204 | ret)) |
@@ -128,7 +128,7 @@ | ||
128 | 128 | |
129 | 129 | (defun fsvn-read-branch/tag (url dirname prompt) |
130 | 130 | (let ((default url)) |
131 | - (when (string-match "^\\(.*\\)/trunk" url) | |
131 | + (when (string-match "\\`\\(.*\\)/trunk" url) | |
132 | 132 | (setq default (concat (match-string 1 url) "/" dirname "/"))) |
133 | 133 | (fsvn-completing-read-url prompt default t))) |
134 | 134 |
@@ -345,11 +345,11 @@ | ||
345 | 345 | (setq urlrev (fsvn-electric-select-log fsvn-complete-processing-revision-urlrev)) |
346 | 346 | (when urlrev |
347 | 347 | (insert (fsvn-get-revision-string (fsvn-urlrev-revision urlrev))))))) |
348 | - ((string-match "^[0-9]+$" value) | |
348 | + ((string-match "\\`[0-9]+\\'" value) | |
349 | 349 | ;; do nothing |
350 | 350 | (fsvn-complete-completion-window-delete) |
351 | 351 | (fsvn-display-momentary-message " [Number context]")) |
352 | - ((string-match "^{" value) | |
352 | + ((string-match "\\`{" value) | |
353 | 353 | ;; do nothing |
354 | 354 | (fsvn-complete-completion-window-delete) |
355 | 355 | (fsvn-display-momentary-message " [Date context]")) |
@@ -536,14 +536,14 @@ | ||
536 | 536 | (defun fsvn-complete-url-local-file-previous-segment (string) |
537 | 537 | (cond |
538 | 538 | ;; for windows |
539 | - ((string-match "^file:///\\([a-zA-Z]:.*\\)/[^/]*$" string) | |
539 | + ((string-match "\\`file:///\\([a-zA-Z]:.*\\)/[^/]*\\'" string) | |
540 | 540 | (match-string 1 string)) |
541 | 541 | ;; for windows |
542 | - ((string-match "^file:///\\([a-zA-Z]:\\)" string) | |
542 | + ((string-match "\\`file:///\\([a-zA-Z]:\\)" string) | |
543 | 543 | (match-string 1 string)) |
544 | - ((string-match "^file://\\(/.*?\\)[^/]*$" string) | |
544 | + ((string-match "\\`file://\\(/.*?\\)[^/]*\\'" string) | |
545 | 545 | (match-string 1 string)) |
546 | - ((string-match "^file://\\(/.*?\\)/$" string) | |
546 | + ((string-match "\\`file://\\(/.*?\\)/\\'" string) | |
547 | 547 | (match-string 1 string)) |
548 | 548 | (t |
549 | 549 | (fsvn-complete-url-previous-segment string)))) |
@@ -552,13 +552,13 @@ | ||
552 | 552 | (cond |
553 | 553 | ((fsvn-file-name-root-p string) |
554 | 554 | string) |
555 | - ((string-match "^\\(.*\\)/$" string) | |
555 | + ((string-match "\\`\\(.*\\)/\\'" string) | |
556 | 556 | (match-string 1 string)) |
557 | - ((string-match "^\\(.*\\)/[^/]+$" string) | |
557 | + ((string-match "\\`\\(.*\\)/[^/]+\\'" string) | |
558 | 558 | (match-string 1 string)))) |
559 | 559 | |
560 | 560 | (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) ":/+\\([^/]+\\)?\\'"))) | |
562 | 562 | (string-match regexp contents))) |
563 | 563 | |
564 | 564 | (defun fsvn-complete-url-local-repository-p (contents) |
@@ -567,11 +567,11 @@ | ||
567 | 567 | (not (fsvn-any-startswith (fsvn-gather-root) contents))))) |
568 | 568 | |
569 | 569 | (defun fsvn-complete-url-last-segment (url) |
570 | - (when (string-match "/\\([^/]+/?\\)$" url) | |
570 | + (when (string-match "/\\([^/]+/?\\)\\'" url) | |
571 | 571 | (match-string 1 url))) |
572 | 572 | |
573 | 573 | (defun fsvn-complete-url-filename (string) |
574 | - (if (string-match "/\\([^/]+\\)$" string) | |
574 | + (if (string-match "/\\([^/]+\\)\\'" string) | |
575 | 575 | (match-string 1 string) |
576 | 576 | "")) |
577 | 577 |
@@ -601,7 +601,7 @@ | ||
601 | 601 | (cdr (fsvn-string-assoc dir fsvn-complete-completion-repository-cache)))) |
602 | 602 | |
603 | 603 | (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)) | |
605 | 605 | |
606 | 606 | (defun fsvn-complete-subcommand-args-action () |
607 | 607 | (interactive) |
@@ -660,7 +660,7 @@ | ||
660 | 660 | (mapcar |
661 | 661 | (lambda (x) |
662 | 662 | (cond |
663 | - ((and (string-match "^-[^-]$" x) | |
663 | + ((and (string-match "\\`-[^-]\\'" x) | |
664 | 664 | (setq tmp (fsvn-subcommand-assoc-argument x (cdr fsvn-complete-reading-subcommand)))) |
665 | 665 | ;; get long option |
666 | 666 | (caar tmp)) |
@@ -752,7 +752,7 @@ | ||
752 | 752 | (cond |
753 | 753 | ((and (eq next-applicant all-applicant) |
754 | 754 | (or (null current) |
755 | - (not (string-match "^-" current)))) | |
755 | + (not (string-match "\\`-" current)))) | |
756 | 756 | (setq collection 'fsvn-complete-url-action)) |
757 | 757 | ((and (null current) (null next-applicant)) |
758 | 758 | (setq collection toplevel))) |
@@ -22,13 +22,13 @@ | ||
22 | 22 | (expand-file-name "Wiki" fsvn-publish-doc-directory)) |
23 | 23 | |
24 | 24 | (defun fsvn-publish-content-lang (html) |
25 | - (let ((regexp "\\.html\\.\\(..\\)$")) | |
25 | + (let ((regexp "\\.html\\.\\(..\\)\\'")) | |
26 | 26 | (string-match regexp html) |
27 | 27 | (match-string 1 html))) |
28 | 28 | |
29 | 29 | (defun fsvn-publish-html-file (piki) |
30 | 30 | (let ((path (file-relative-name piki fsvn-publish-wiki-directory))) |
31 | - (unless (string-match "/\\([^/]+\\)-\\(..\\)\\.piki$" piki) | |
31 | + (unless (string-match "/\\([^/]+\\)-\\(..\\)\\.piki\\'" piki) | |
32 | 32 | (error "Invalid filename %s" piki)) |
33 | 33 | (let ((name (match-string 1 piki)) |
34 | 34 | (lang (match-string 2 piki)) |
@@ -48,7 +48,7 @@ | ||
48 | 48 | ret)) |
49 | 49 | |
50 | 50 | (defun fsvn-publish-files () |
51 | - (fsvn-publish-directory-files fsvn-publish-wiki-directory "\\.piki$")) | |
51 | + (fsvn-publish-directory-files fsvn-publish-wiki-directory "\\.piki\\'")) | |
52 | 52 | |
53 | 53 | (defun fsvn-publish () |
54 | 54 | (interactive) |
@@ -725,7 +725,7 @@ | ||
725 | 725 | (when (fsvn-deps-file-registered-p file) |
726 | 726 | file)) |
727 | 727 | (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)) "\\(.*\\)\\'")) | |
729 | 729 | (mapcar |
730 | 730 | (lambda (src-file) |
731 | 731 | (let ((src-name (fsvn-file-name-nondirectory src-file)) |
@@ -659,7 +659,7 @@ | ||
659 | 659 | (catch 'found |
660 | 660 | (mapc |
661 | 661 | (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)) | |
663 | 663 | (throw 'found ls-entry))) |
664 | 664 | (fsvn-get-ls dir)))) |
665 | 665 | new-name) |
@@ -733,7 +733,7 @@ | ||
733 | 733 | (mapc |
734 | 734 | (lambda (p) |
735 | 735 | (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) | |
737 | 737 | (string= dirname prop))) |
738 | 738 | (throw 'yes p))) |
739 | 739 | (process-list)) |
@@ -37,11 +37,11 @@ | ||
37 | 37 | nil)) |
38 | 38 | |
39 | 39 | (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 | |
45 | 45 | (apply 'start-file-process "fsvn" buffer command real-args)))) |
46 | 46 | |
47 | 47 | (defun fsvn-start-command (subcommand buffer &rest args) |
@@ -59,17 +59,17 @@ | ||
59 | 59 | This is synchronous call, so cannot handle password prompt. Append --non-interactive arg |
60 | 60 | explicitly in calling function. |
61 | 61 | " |
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)))) | |
73 | 73 | |
74 | 74 | (defun fsvn-call-command (subcommand buffer &rest args) |
75 | 75 | (apply 'fsvn-call-process buffer subcommand (fsvn-command-append-argument subcommand args))) |
@@ -340,7 +340,7 @@ | ||
340 | 340 | (unless (file-directory-p url) |
341 | 341 | (when (setq cs (fsvn-file-guessed-coding-system url)) |
342 | 342 | (throw 'guessed cs))))))) |
343 | - ((string-match "^--[a-zA-Z]" arg) | |
343 | + ((string-match "\\`--[a-zA-Z]" arg) | |
344 | 344 | (setq ignore (assoc arg '("--targets" "--file")))) |
345 | 345 | ((not (fsvn-url-local-p arg))) |
346 | 346 | (t |
@@ -106,7 +106,7 @@ | ||
106 | 106 | (fsvn-directory-name-as-repository dir)))) |
107 | 107 | |
108 | 108 | (defun fsvn-svk-depotpath-url (depotpath) |
109 | - (when (string-match "^//\\(.*\\)" depotpath) | |
109 | + (when (string-match "\\`//\\(.*\\)" depotpath) | |
110 | 110 | (fsvn-expand-url (match-string 1 depotpath) (fsvn-svk-depotmap-url)))) |
111 | 111 | |
112 | 112 | (defun fsvn-svk-mirrored-repository-url (file) |
@@ -295,7 +295,7 @@ | ||
295 | 295 | proc)) |
296 | 296 | |
297 | 297 | (defun fsvn-svk-depotpath-name (depotpath) |
298 | - (if (string-match "/$" depotpath) | |
298 | + (if (string-match "/\\'" depotpath) | |
299 | 299 | (substring depotpath 0 -1) |
300 | 300 | depotpath)) |
301 | 301 |