Initial Commit
[packages] / xemacs-packages / vc / vc-svn.el
1 ;;; vc-svn.el --- non-resident support for Subversion version-control
2
3 ;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
4
5 ;; Author:      FSF (see vc.el for full credits)
6 ;; Maintainer:  Stefan Monnier <monnier@gnu.org>
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
24
25 ;;; Commentary:
26
27 ;; This is preliminary support for Subversion (http://subversion.tigris.org/).
28 ;; It started as `sed s/cvs/svn/ vc.cvs.el' (from version 1.56)
29 ;; and hasn't been completely fixed since.
30
31 ;; Sync'd with Subversion's vc-svn.el as of revision 5801.
32
33 ;;; Bugs:
34
35 ;; - VC-dired is (really) slow.
36
37 ;;; Code:
38
39 (require 'vc-xemacs) ; XEmacs compatiblity stuff
40 (eval-when-compile
41   (require 'vc))
42
43 ;;;
44 ;;; Customization options
45 ;;;
46
47 (defcustom vc-svn-global-switches nil
48   "*Global switches to pass to any SVN command."
49   :type '(choice (const :tag "None" nil)
50                  (string :tag "Argument String")
51                  (repeat :tag "Argument List"
52                          :value ("")
53                          string))
54   :version "22.1"
55   :group 'vc)
56
57 (defcustom vc-svn-register-switches nil
58   "*Extra switches for registering a file into SVN.
59 A string or list of strings passed to the checkin program by
60 \\[vc-register]."
61   :type '(choice (const :tag "None" nil)
62                  (string :tag "Argument String")
63                  (repeat :tag "Argument List"
64                          :value ("")
65                          string))
66   :version "22.1"
67   :group 'vc)
68
69 (defcustom vc-svn-diff-switches
70   t                        ;`svn' doesn't support common args like -c or -b.
71   "String or list of strings specifying extra switches for svn diff under VC.
72 If nil, use the value of `vc-diff-switches'.
73 If you want to force an empty list of arguments, use t."
74   :type '(choice (const :tag "Unspecified" nil)
75                  (const :tag "None" t)
76                  (string :tag "Argument String")
77                  (repeat :tag "Argument List"
78                          :value ("")
79                          string))
80   :version "22.1"
81   :group 'vc)
82
83 (defcustom vc-svn-header (or (cdr (assoc 'SVN vc-header-alist)) '("\$Id\$"))
84   "*Header keywords to be inserted by `vc-insert-headers'."
85   :version "22.1"
86   :type '(repeat string)
87   :group 'vc)
88
89 ;; We want to autoload it for use by the autoloaded version of
90 ;; vc-svn-registered, but we want the value to be compiled at startup, not
91 ;; at dump time.
92 ;; ;;;###autoload
93 (defconst vc-svn-admin-directory
94   (cond ((and (memq system-type '(cygwin windows-nt ms-dos))
95               (getenv "SVN_ASP_DOT_NET_HACK"))
96          "_svn")
97         (t ".svn"))
98   "The name of the \".svn\" subdirectory or its equivalent.")
99
100 ;;;
101 ;;; State-querying functions
102 ;;;
103
104 ;;; vc-svn-admin-directory is generally not defined when the
105 ;;; autoloaded function is called.
106
107 ;; XEmacs change: renamed to registered-lite due to 21.4 byte compiler or
108 ;;                bytecode interpreter issue with redefining vc-svn-registered
109 ;;;###autoload (defun vc-svn-registered-lite (f)
110 ;;;###autoload   (let ((admin-dir (cond ((and (eq system-type 'windows-nt)
111 ;;;###autoload                                (getenv "SVN_ASP_DOT_NET_HACK"))
112 ;;;###autoload                           "_svn")
113 ;;;###autoload                          (t ".svn"))))
114 ;;;###autoload     (when (file-readable-p (expand-file-name
115 ;;;###autoload                             (concat admin-dir "/entries")
116 ;;;###autoload                             (file-name-directory f)))
117 ;;;###autoload       (load "vc-svn")
118 ;;;###autoload       (vc-svn-registered f))))
119
120 ;;;###autoload
121 (add-to-list 'completion-ignored-extensions ".svn/")
122
123 (defun vc-svn-registered (file)
124   "Check if FILE is SVN registered."
125   (when (file-readable-p (expand-file-name (concat vc-svn-admin-directory
126                                                    "/entries")
127                                            (file-name-directory file)))
128     (with-temp-buffer
129       (cd (file-name-directory file))
130       (let ((status
131              (condition-case nil
132                  ;; Ignore all errors.
133                  (vc-svn-command t t file "status" "-v")
134                ;; Some problem happened.  E.g. We can't find an `svn'
135                ;; executable.  We used to only catch `file-error' but when
136                ;; the process is run on a remote host via Tramp, the error
137                ;; is only reported via the exit status which is turned into
138                ;; an `error' by vc-do-command.
139                (error nil))))
140         (when (eq 0 status)
141           (vc-svn-parse-status file))))))
142
143 (defun vc-svn-state (file &optional localp)
144   "SVN-specific version of `vc-state'."
145   (setq localp (or localp (vc-stay-local-p file)))
146   (with-temp-buffer
147     (cd (file-name-directory file))
148     (vc-svn-command t 0 file "status" (if localp "-v" "-u"))
149     (vc-svn-parse-status file)))
150
151 (defun vc-svn-state-heuristic (file)
152   "SVN-specific state heuristic."
153   (vc-svn-state file 'local))
154
155 (defun vc-svn-dir-state (dir &optional localp)
156   "Find the SVN state of all files in DIR."
157   (setq localp (or localp (vc-stay-local-p dir)))
158   (let ((default-directory dir))
159     ;; Don't specify DIR in this command, the default-directory is
160     ;; enough.  Otherwise it might fail with remote repositories.
161     (with-temp-buffer
162       (vc-svn-command t 0 nil "status" (if localp "-v" "-u"))
163       (vc-svn-parse-status))))
164
165 (defun vc-svn-workfile-version (file)
166   "SVN-specific version of `vc-workfile-version'."
167   ;; There is no need to consult RCS headers under SVN, because we
168   ;; get the workfile version for free when we recognize that a file
169   ;; is registered in SVN.
170   (vc-svn-registered file)
171   (vc-file-getprop file 'vc-workfile-version))
172
173 (defun vc-svn-checkout-model (file)
174   "SVN-specific version of `vc-checkout-model'."
175   ;; It looks like Subversion has no equivalent of CVSREAD.
176   'implicit)
177
178 ;; vc-svn-mode-line-string doesn't exist because the default implementation
179 ;; works just fine.
180
181 (defun vc-svn-dired-state-info (file)
182   "SVN-specific version of `vc-dired-state-info'."
183   (let ((svn-state (vc-state file)))
184     (cond ((eq svn-state 'edited)
185            (if (equal (vc-workfile-version file) "0")
186                "(added)" "(modified)"))
187           ((eq svn-state 'needs-patch) "(patch)")
188           ((eq svn-state 'needs-merge) "(merge)"))))
189
190 (defun vc-svn-previous-version (file rev)
191   (let ((newrev (1- (string-to-number rev))))
192     (when (< 0 newrev)
193       (number-to-string newrev))))
194
195 (defun vc-svn-next-version (file rev)
196   (let ((newrev (1+ (string-to-number rev))))
197     ;; The "workfile version" is an uneasy conceptual fit under Subversion;
198     ;; we use it as the upper bound until a better idea comes along.  If the
199     ;; workfile version W coincides with the tree's latest revision R, then
200     ;; this check prevents a "no such revision: R+1" error.  Otherwise, it
201     ;; inhibits showing of W+1 through R, which could be considered anywhere
202     ;; from gracious to impolite.
203     (unless (< (string-to-number (vc-file-getprop file 'vc-workfile-version))
204                newrev)
205       (number-to-string newrev))))
206
207
208 ;;;
209 ;;; State-changing functions
210 ;;;
211
212 (defun vc-svn-register (file &optional rev comment)
213   "Register FILE into the SVN version-control system.
214 COMMENT can be used to provide an initial description of FILE.
215
216 `vc-register-switches' and `vc-svn-register-switches' are passed to
217 the SVN command (in that order)."
218   (apply 'vc-svn-command nil 0 file "add" (vc-switches 'SVN 'register)))
219
220 (defun vc-svn-responsible-p (file)
221   "Return non-nil if SVN thinks it is responsible for FILE."
222   (file-directory-p (expand-file-name vc-svn-admin-directory
223                                       (if (file-directory-p file)
224                                           file
225                                         (file-name-directory file)))))
226
227 (defalias 'vc-svn-could-register 'vc-svn-responsible-p
228   ;; XEmacs: we have only 2 args to defalias
229 ;  "Return non-nil if FILE could be registered in SVN.
230 ;This is only possible if SVN is responsible for FILE's directory."
231 )
232
233 (defun vc-svn-checkin (file rev comment)
234   "SVN-specific version of `vc-backend-checkin'."
235   (let ((status (apply
236                  'vc-svn-command nil 1 file "ci"
237                  (nconc (list "-m" comment) (vc-switches 'SVN 'checkin)))))
238     (set-buffer "*vc*")
239     (goto-char (point-min))
240     (unless (equal status 0)
241       ;; Check checkin problem.
242       (cond
243        ((search-forward "Transaction is out of date" nil t)
244         (vc-file-setprop file 'vc-state 'needs-merge)
245         (error (substitute-command-keys
246                 (concat "Up-to-date check failed: "
247                         "type \\[vc-next-action] to merge in changes"))))
248        (t
249         (pop-to-buffer (current-buffer))
250         (goto-char (point-min))
251         (shrink-window-if-larger-than-buffer)
252         (error "Check-in failed"))))
253     ;; Update file properties
254     ;; (vc-file-setprop
255     ;;  file 'vc-workfile-version
256     ;;  (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2))
257     ))
258
259 (defun vc-svn-find-version (file rev buffer)
260   (apply 'vc-svn-command
261          buffer 0 file
262          "cat"
263          (and rev (not (string= rev ""))
264               (concat "-r" rev))
265          (vc-switches 'SVN 'checkout)))
266
267 (defun vc-svn-checkout (file &optional editable rev)
268   (message "Checking out %s..." file)
269   (with-current-buffer (or (get-file-buffer file) (current-buffer))
270     (vc-call update file editable rev (vc-switches 'SVN 'checkout)))
271   (vc-mode-line file)
272   (message "Checking out %s...done" file))
273
274 (defun vc-svn-update (file editable rev switches)
275   (if (and (file-exists-p file) (not rev))
276       ;; If no revision was specified, there's nothing to do.
277       nil
278     ;; Check out a particular version (or recreate the file).
279     (vc-file-setprop file 'vc-workfile-version nil)
280     (apply 'vc-svn-command nil 0 file
281            "update"
282            ;; default for verbose checkout: clear the sticky tag so
283            ;; that the actual update will get the head of the trunk
284            (cond
285             ((null rev) "-rBASE")
286             ((or (eq rev t) (equal rev "")) nil)
287             (t (concat "-r" rev)))
288            switches)))
289
290 (defun vc-svn-delete-file (file)
291   (vc-svn-command nil 0 file "remove"))
292
293 (defun vc-svn-rename-file (old new)
294   (vc-svn-command nil 0 new "move" (file-relative-name old)))
295
296 (defun vc-svn-revert (file &optional contents-done)
297   "Revert FILE to the version it was based on."
298   (unless contents-done
299     (vc-svn-command nil 0 file "revert")))
300
301 (defun vc-svn-merge (file first-version &optional second-version)
302   "Merge changes into current working copy of FILE.
303 The changes are between FIRST-VERSION and SECOND-VERSION."
304   (vc-svn-command nil 0 file
305                  "merge"
306                  "-r" (if second-version
307                         (concat first-version ":" second-version)
308                       first-version))
309   (vc-file-setprop file 'vc-state 'edited)
310   (with-current-buffer (get-buffer "*vc*")
311     (goto-char (point-min))
312     (if (looking-at "C  ")
313         1                               ; signal conflict
314       0)))                              ; signal success
315
316 (defun vc-svn-merge-news (file)
317   "Merge in any new changes made to FILE."
318   (message "Merging changes into %s..." file)
319   ;; (vc-file-setprop file 'vc-workfile-version nil)
320   (vc-file-setprop file 'vc-checkout-time 0)
321   (vc-svn-command nil 0 file "update")
322   ;; Analyze the merge result reported by SVN, and set
323   ;; file properties accordingly.
324   (with-current-buffer (get-buffer "*vc*")
325     (goto-char (point-min))
326     ;; get new workfile version
327     (if (re-search-forward
328          "^\\(Updated to\\|At\\) revision \\([0-9]+\\)" nil t)
329         (vc-file-setprop file 'vc-workfile-version (match-string 2))
330       (vc-file-setprop file 'vc-workfile-version nil))
331     ;; get file status
332     (goto-char (point-min))
333     (prog1
334         (if (looking-at "At revision")
335             0 ;; there were no news; indicate success
336           (if (re-search-forward
337                ;; Newer SVN clients have 3 columns of chars (one for the
338                ;; file's contents, then second for its properties, and the
339                ;; third for lock-grabbing info), before the 2 spaces.
340                ;; We also used to match the filename in column 0 without any
341                ;; meta-info before it, but I believe this can never happen.
342                (concat "^\\(\\([ACGDU]\\)\\(.[B ]\\)?  \\)"
343                        (regexp-quote (file-name-nondirectory file)))
344                nil t)
345               (cond
346                ;; Merge successful, we are in sync with repository now
347                ((string= (match-string 2) "U")
348                 (vc-file-setprop file 'vc-state 'up-to-date)
349                 (vc-file-setprop file 'vc-checkout-time
350                                  (nth 5 (file-attributes file)))
351                 0);; indicate success to the caller
352                ;; Merge successful, but our own changes are still in the file
353                ((string= (match-string 2) "G")
354                 (vc-file-setprop file 'vc-state 'edited)
355                 0);; indicate success to the caller
356                ;; Conflicts detected!
357                (t
358                 (vc-file-setprop file 'vc-state 'edited)
359                 1);; signal the error to the caller
360                )
361             (pop-to-buffer "*vc*")
362             (error "Couldn't analyze svn update result")))
363       (message "Merging changes into %s...done" file))))
364
365
366 ;;;
367 ;;; History functions
368 ;;;
369
370 (defun vc-svn-print-log (file &optional buffer)
371   "Get change log associated with FILE."
372   (save-current-buffer
373     (vc-setup-buffer buffer)
374     (let ((inhibit-read-only t))
375       (goto-char (point-min))
376       ;; Add a line to tell log-view-mode what file this is.
377       (insert "Working file: " (file-relative-name file) "\n"))
378     (vc-svn-command
379      buffer
380      (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
381      file "log"
382      ;; By default Subversion only shows the log upto the working version,
383      ;; whereas we also want the log of the subsequent commits.  At least
384      ;; that's what the vc-cvs.el code does.
385      "-rHEAD:0")))
386
387 (defun vc-svn-diff (file &optional oldvers newvers buffer)
388   "Get a difference report using SVN between two versions of FILE."
389   (unless buffer (setq buffer "*vc-diff*"))
390   (if (and oldvers (equal oldvers (vc-workfile-version file)))
391       ;; Use nil rather than the current revision because svn handles it
392       ;; better (i.e. locally).
393       (setq oldvers nil))
394   (if (string= (vc-workfile-version file) "0")
395       ;; This file is added but not yet committed; there is no master file.
396       (if (or oldvers newvers)
397           (error "No revisions of %s exist" file)
398         ;; We regard this as "changed".
399         ;; Diff it against /dev/null.
400         ;; Note: this is NOT a "svn diff".
401         (apply 'vc-do-command buffer
402                1 "diff" file
403                (append (vc-switches nil 'diff) '("/dev/null")))
404         ;; Even if it's empty, it's locally modified.
405         1)
406     (let* ((switches
407             (if vc-svn-diff-switches
408                 (vc-switches 'SVN 'diff)
409               (list "-x" (mapconcat 'identity (vc-switches nil 'diff) " "))))
410            (async (and (not vc-disable-async-diff)
411                        (vc-stay-local-p file)
412                        (or oldvers newvers) ; Svn diffs those locally.
413                        (fboundp 'start-process))))
414       (apply 'vc-svn-command buffer
415              (if async 'async 0)
416              file "diff"
417              (append
418               switches
419               (when oldvers
420                 (list "-r" (if newvers (concat oldvers ":" newvers)
421                              oldvers)))))
422       (if async 1                     ; async diff => pessimistic assumption
423         ;; For some reason `svn diff' does not return a useful
424         ;; status w.r.t whether the diff was empty or not.
425         (buffer-size (get-buffer buffer))))))
426
427 (defun vc-svn-diff-tree (dir &optional rev1 rev2)
428   "Diff all files at and below DIR."
429   (vc-svn-diff (file-name-as-directory dir) rev1 rev2))
430
431 ;;;
432 ;;; Snapshot system
433 ;;;
434
435 (defun vc-svn-create-snapshot (dir name branchp)
436   "Assign to DIR's current version a given NAME.
437 If BRANCHP is non-nil, the name is created as a branch (and the current
438 workspace is immediately moved to that new branch).
439 NAME is assumed to be a URL."
440   (vc-svn-command nil 0 dir "copy" name)
441   (when branchp (vc-svn-retrieve-snapshot dir name nil)))
442
443 (defun vc-svn-retrieve-snapshot (dir name update)
444   "Retrieve a snapshot at and below DIR.
445 NAME is the name of the snapshot; if it is empty, do a `svn update'.
446 If UPDATE is non-nil, then update (resynch) any affected buffers.
447 NAME is assumed to be a URL."
448   (vc-svn-command nil 0 dir "switch" name)
449   ;; FIXME: parse the output and obey `update'.
450   )
451
452 ;;;
453 ;;; Miscellaneous
454 ;;;
455
456 ;; Subversion makes backups for us, so don't bother.
457 ;; (defalias 'vc-svn-make-version-backups-p 'vc-stay-local-p
458 ;;   "Return non-nil if version backups should be made for FILE.")
459
460 (defun vc-svn-check-headers ()
461   "Check if the current file has any headers in it."
462   (save-excursion
463     (goto-char (point-min))
464     (re-search-forward "\\$[A-Za-z\300-\326\330-\366\370-\377]+\
465 \\(: [\t -#%-\176\240-\377]*\\)?\\$" nil t)))
466
467
468 ;;;
469 ;;; Internal functions
470 ;;;
471
472 (defcustom vc-svn-program "svn"
473   "Name of the svn executable."
474   :type 'string
475   :group 'vc)
476
477 (defun vc-svn-command (buffer okstatus file &rest flags)
478   "A wrapper around `vc-do-command' for use in vc-svn.el.
479 The difference to vc-do-command is that this function always invokes `svn',
480 and that it passes `vc-svn-global-switches' to it before FLAGS."
481   (apply 'vc-do-command buffer okstatus vc-svn-program file
482          (if (stringp vc-svn-global-switches)
483              (cons vc-svn-global-switches flags)
484            (append vc-svn-global-switches
485                    flags))))
486
487 (defun vc-svn-repository-hostname (dirname)
488   (with-temp-buffer
489     ;; XEmacs change: use vc-xemacs-file-name-coding-system
490     (let ((coding-system-for-read (vc-xemacs-file-name-coding-system)))
491       (vc-insert-file (expand-file-name (concat vc-svn-admin-directory
492                                                 "/entries")
493                                         dirname)))
494     (goto-char (point-min))
495     (when (re-search-forward
496            ;; Old `svn' used name="svn:this_dir", newer use just name="".
497            (concat "name=\"\\(?:svn:this_dir\\)?\"[\n\t ]*"
498                    ;; XEmacs: this regexp hunk simplified; the non-greedy
499                    ;; match at the end doesn't seem to work -> XEmacs bug ???
500                    ;;"\\(?:[-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?"
501                    "[^>]*[\n\t ]"
502                    ;; XEmacs change: (?<number>:...) syntax not supported.
503                    "url=\"\\([^\"]+\\)\""
504                    ;; Yet newer ones don't use XML any more.
505                    "\\|^\ndir\n[0-9]+\n\\(.*\\)") nil t)
506       ;; This is not a hostname but a URL.  This may actually be considered
507       ;; as a feature since it allows vc-svn-stay-local to specify different
508       ;; behavior for different modules on the same server.
509       ;; XEmacs change: match-string 1 or 2 for the (?<number>:) change above.
510       (or (match-string 1) (match-string 2)))))
511
512 (defun vc-svn-parse-status (&optional filename)
513   "Parse output of \"svn status\" command in the current buffer.
514 Set file properties accordingly.  Unless FILENAME is non-nil, parse only
515 information about FILENAME and return its status."
516   (let (file status)
517     (goto-char (point-min))
518     (while (re-search-forward
519             ;; Ignore the files with status in [IX?].
520             "^[ ACDGMR!~][ MC][ L][ +][ S]..\\([ *]\\) +\\([-0-9]+\\) +\\([0-9?]+\\) +\\([^ ]+\\) +" nil t)
521       ;; If the username contains spaces, the output format is ambiguous,
522       ;; so don't trust the output's filename unless we have to.
523       (setq file (or filename
524                      (expand-file-name
525                       (buffer-substring (point) (line-end-position)))))
526       (setq status (char-after (line-beginning-position)))
527       (unless (eq status ??)
528         ;; `vc-BACKEND-registered' must not set vc-backend,
529         ;; which is instead set in vc-registered.
530         (unless filename (vc-file-setprop file 'vc-backend 'SVN))
531         ;; Use the last-modified revision, so that searching in vc-print-log
532         ;; output works.
533         (vc-file-setprop file 'vc-workfile-version (match-string 3))
534         (vc-file-setprop
535          file 'vc-state
536          (cond
537           ((eq status ?\ )
538            (if (eq (char-after (match-beginning 1)) ?*)
539                'needs-patch
540              (vc-file-setprop file 'vc-checkout-time
541                               (nth 5 (file-attributes file)))
542              'up-to-date))
543           ((eq status ?A)
544            ;; If the file was actually copied, (match-string 2) is "-".
545            (vc-file-setprop file 'vc-workfile-version "0")
546            (vc-file-setprop file 'vc-checkout-time 0)
547            'edited)
548           ((memq status '(?M ?C))
549            (if (eq (char-after (match-beginning 1)) ?*)
550                'needs-merge
551              'edited))
552           (t 'edited)))))
553     (if filename (vc-file-getprop filename 'vc-state))))
554
555 (defun vc-svn-dir-state-heuristic (dir)
556   "Find the SVN state of all files in DIR, using only local information."
557   (vc-svn-dir-state dir 'local))
558
559 (defun vc-svn-valid-symbolic-tag-name-p (tag)
560   "Return non-nil if TAG is a valid symbolic tag name."
561   ;; According to the SVN manual, a valid symbolic tag must start with
562   ;; an uppercase or lowercase letter and can contain uppercase and
563   ;; lowercase letters, digits, `-', and `_'.
564   (and (string-match "^[a-zA-Z]" tag)
565        (not (string-match "[^a-z0-9A-Z-_]" tag))))
566
567 (defun vc-svn-valid-version-number-p (tag)
568   "Return non-nil if TAG is a valid version number."
569   (and (string-match "^[0-9]" tag)
570        (not (string-match "[^0-9]" tag))))
571
572 ;; Support for `svn annotate'
573
574 (defun vc-svn-annotate-command (file buf &optional rev)
575   (vc-svn-command buf 0 file "annotate" (if rev (concat "-r" rev))))
576
577 (defun vc-svn-annotate-time-of-rev (rev)
578   ;; Arbitrarily assume 10 commmits per day.
579   (/ (string-to-number rev) 10.0))
580
581 (defun vc-svn-annotate-current-time ()
582   (vc-svn-annotate-time-of-rev vc-annotate-parent-rev))
583
584 (defconst vc-svn-annotate-re "[ \t]*\\([0-9]+\\)[ \t]+[^\t ]+ ")
585
586 (defun vc-svn-annotate-time ()
587   (when (looking-at vc-svn-annotate-re)
588     (goto-char (match-end 0))
589     (vc-svn-annotate-time-of-rev (match-string 1))))
590
591 (defun vc-svn-annotate-extract-revision-at-line ()
592   (save-excursion
593     (beginning-of-line)
594     (if (looking-at vc-svn-annotate-re) (match-string 1))))
595
596 (provide 'vc-svn)
597
598 ;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d
599 ;;; vc-svn.el ends here