diff options
| author | André Spiegel | 1997-03-04 18:00:30 +0000 |
|---|---|---|
| committer | André Spiegel | 1997-03-04 18:00:30 +0000 |
| commit | eb302e54e9032d8cad6e9457b878bb8dd36342a2 (patch) | |
| tree | 0c1c0e248872fd196929f8793a09ea3538c5a7f6 | |
| parent | 040df2c773d81cfaa0c3e1314e5f0e19a23563cf (diff) | |
| download | emacs-eb302e54e9032d8cad6e9457b878bb8dd36342a2.tar.gz emacs-eb302e54e9032d8cad6e9457b878bb8dd36342a2.zip | |
(vc-backend-diff): Handle RCS and SCCS separately.
| -rw-r--r-- | lisp/vc.el | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index 9bf87070165..70abb77b545 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -2233,44 +2233,43 @@ default directory." | |||
| 2233 | (defun vc-backend-diff (file &optional oldvers newvers cmp) | 2233 | (defun vc-backend-diff (file &optional oldvers newvers cmp) |
| 2234 | ;; Get a difference report between two versions of FILE. | 2234 | ;; Get a difference report between two versions of FILE. |
| 2235 | ;; Get only a brief comparison report if CMP, a difference report otherwise. | 2235 | ;; Get only a brief comparison report if CMP, a difference report otherwise. |
| 2236 | (let ((backend (vc-backend file))) | 2236 | (let ((backend (vc-backend file)) options status |
| 2237 | (diff-switches-list (if (listp diff-switches) | ||
| 2238 | diff-switches | ||
| 2239 | (list diff-switches)))) | ||
| 2237 | (cond | 2240 | (cond |
| 2238 | ((eq backend 'SCCS) | 2241 | ((eq backend 'SCCS) |
| 2239 | (setq oldvers (vc-lookup-triple file oldvers)) | 2242 | (setq oldvers (vc-lookup-triple file oldvers)) |
| 2240 | (setq newvers (vc-lookup-triple file newvers))) | 2243 | (setq newvers (vc-lookup-triple file newvers)) |
| 2244 | (setq options (append (list (and cmp "--brief") "-q" | ||
| 2245 | (and oldvers (concat "-r" oldvers)) | ||
| 2246 | (and newvers (concat "-r" newvers))) | ||
| 2247 | (and (not cmp) diff-switches-list))) | ||
| 2248 | (apply 'vc-do-command "*vc-diff*" 1 "vcdiff" file 'MASTER options)) | ||
| 2241 | ((eq backend 'RCS) | 2249 | ((eq backend 'RCS) |
| 2242 | (if (not oldvers) (setq oldvers (vc-workfile-version file))) | 2250 | (if (not oldvers) (setq oldvers (vc-workfile-version file))) |
| 2243 | ;; If we know that --brief is not supported, don't try it. | 2251 | ;; If we know that --brief is not supported, don't try it. |
| 2244 | (setq cmp (and cmp (not (eq vc-rcsdiff-knows-brief 'no)))))) | 2252 | (setq cmp (and cmp (not (eq vc-rcsdiff-knows-brief 'no)))) |
| 2245 | ;; SCCS and RCS shares a lot of code. | 2253 | (setq options (append (list (and cmp "--brief") "-q" |
| 2246 | (cond | 2254 | (concat "-r" oldvers) |
| 2247 | ((or (eq backend 'SCCS) (eq backend 'RCS)) | 2255 | (and newvers (concat "-r" newvers))) |
| 2248 | (let* ((command (if (eq backend 'SCCS) "vcdiff" "rcsdiff")) | 2256 | (and (not cmp) diff-switches-list))) |
| 2249 | (mode (if (eq backend 'RCS) 'WORKFILE 'MASTER)) | 2257 | (setq status (apply 'vc-do-command "*vc-diff*" 2 |
| 2250 | (options (append (list (and cmp "--brief") | 2258 | "rcsdiff" file 'WORKFILE options)) |
| 2251 | "-q" | 2259 | ;; If --brief didn't work, do a double-take and remember it |
| 2252 | (and oldvers (concat "-r" oldvers)) | 2260 | ;; for the future. |
| 2253 | (and newvers (concat "-r" newvers))) | 2261 | (if (eq status 2) |
| 2254 | (and (not cmp) | 2262 | (prog1 |
| 2255 | (if (listp diff-switches) | 2263 | (apply 'vc-do-command "*vc-diff*" 1 "rcsdiff" file 'WORKFILE |
| 2256 | diff-switches | 2264 | (if cmp (cdr options) options)) |
| 2257 | (list diff-switches))))) | 2265 | (if cmp (setq vc-rcsdiff-knows-brief 'no))) |
| 2258 | (status (apply 'vc-do-command "*vc-diff*" 2 | 2266 | ;; If --brief DID work, remember that, too. |
| 2259 | command file mode options))) | 2267 | (and cmp (not vc-rcsdiff-knows-brief) |
| 2260 | ;; If --brief didn't work, do a double-take and remember it | 2268 | (setq vc-rcsdiff-knows-brief 'yes)) |
| 2261 | ;; for the future. | 2269 | status)) |
| 2262 | (if (eq status 2) | ||
| 2263 | (prog1 | ||
| 2264 | (apply 'vc-do-command "*vc-diff*" 1 command file 'WORKFILE | ||
| 2265 | (if cmp (cdr options) options)) | ||
| 2266 | (if cmp (setq vc-rcsdiff-knows-brief 'no))) | ||
| 2267 | ;; If --brief DID work, remember that, too. | ||
| 2268 | (and cmp (not vc-rcsdiff-knows-brief) | ||
| 2269 | (setq vc-rcsdiff-knows-brief 'yes)) | ||
| 2270 | status))) | ||
| 2271 | ;; CVS is different. | 2270 | ;; CVS is different. |
| 2272 | ((eq backend 'CVS) | 2271 | ((eq backend 'CVS) |
| 2273 | (if (string= (vc-workfile-version file) "0") ;CVS | 2272 | (if (string= (vc-workfile-version file) "0") |
| 2274 | ;; This file is added but not yet committed; there is no master file. | 2273 | ;; This file is added but not yet committed; there is no master file. |
| 2275 | (if (or oldvers newvers) | 2274 | (if (or oldvers newvers) |
| 2276 | (error "No revisions of %s exist" file) | 2275 | (error "No revisions of %s exist" file) |