diff options
| author | Stefan Monnier | 2000-06-11 22:30:49 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2000-06-11 22:30:49 +0000 |
| commit | e6a4ba731161f0386ea4a1e5dca7e2af3939fe4e (patch) | |
| tree | a9a126b9190d8fae9ce287b0675cf23166689e49 | |
| parent | f1c7754a42cb5f65311060fa614f0f4962ed5ebf (diff) | |
| download | emacs-e6a4ba731161f0386ea4a1e5dca7e2af3939fe4e.tar.gz emacs-e6a4ba731161f0386ea4a1e5dca7e2af3939fe4e.zip | |
(cvs-parse-table): Look for conflict markers in the
file to resolve the ambiguity between C-conflict and C-need-merge.
| -rw-r--r-- | lisp/pcvs-parse.el | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el index 818506b6916..4cce7830f14 100644 --- a/lisp/pcvs-parse.el +++ b/lisp/pcvs-parse.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 5 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> |
| 6 | ;; Keywords: pcl-cvs | 6 | ;; Keywords: pcl-cvs |
| 7 | ;; Version: $Name: $ | 7 | ;; Version: $Name: $ |
| 8 | ;; Revision: $Id: pcvs-parse.el,v 1.1 2000/03/11 03:42:29 monnier Exp $ | 8 | ;; Revision: $Id: pcvs-parse.el,v 1.2 2000/03/22 02:56:53 monnier Exp $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -185,7 +185,6 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." | |||
| 185 | (apply 'cvs-create-fileinfo type | 185 | (apply 'cvs-create-fileinfo type |
| 186 | (concat cvs-current-subdir (or dir cvs-current-dir)) | 186 | (concat cvs-current-subdir (or dir cvs-current-dir)) |
| 187 | file (cvs-parse-msg) :subtype subtype keys)))) | 187 | file (cvs-parse-msg) :subtype subtype keys)))) |
| 188 | |||
| 189 | 188 | ||
| 190 | ;;;; CVS Process Parser Tables: | 189 | ;;;; CVS Process Parser Tables: |
| 191 | ;;;; | 190 | ;;;; |
| @@ -217,19 +216,28 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." | |||
| 217 | ;; P: The file was patched from the repository. | 216 | ;; P: The file was patched from the repository. |
| 218 | ;; ?: Unknown file. | 217 | ;; ?: Unknown file. |
| 219 | (let ((code (aref c 0))) | 218 | (let ((code (aref c 0))) |
| 220 | (cvs-parsed-fileinfo (case code | 219 | (cvs-parsed-fileinfo |
| 221 | (?M 'MODIFIED) | 220 | (case code |
| 222 | (?A 'ADDED) | 221 | (?M 'MODIFIED) |
| 223 | (?R 'REMOVED) | 222 | (?A 'ADDED) |
| 224 | (?? 'UNKNOWN) | 223 | (?R 'REMOVED) |
| 225 | (?C 'CONFLICT) ;(if dont-change-disc 'NEED-MERGE | 224 | (?? 'UNKNOWN) |
| 226 | (?J 'NEED-MERGE) ;not supported by standard CVS | 225 | (?C |
| 227 | ((?U ?P) | 226 | (if (not dont-change-disc) 'CONFLICT |
| 228 | (if dont-change-disc | 227 | ;; This is ambiguous. We should look for conflict markers in the |
| 229 | 'NEED-UPDATE | 228 | ;; file to decide between CONFLICT and NEED-MERGE. With CVS-1.10 |
| 230 | (cons 'UP-TO-DATE | 229 | ;; servers, this should not be necessary, because they return |
| 231 | (if (eq code ?U) 'UPDATED 'PATCHED))))) | 230 | ;; a complete merge output. |
| 232 | path 'trust))) | 231 | (with-temp-buffer |
| 232 | (insert-file-contents path) | ||
| 233 | (goto-char (point-min)) | ||
| 234 | (if (re-search-forward "^<<<<<<< " nil t) | ||
| 235 | 'CONFLICT 'NEED-MERGE)))) | ||
| 236 | (?J 'NEED-MERGE) ;not supported by standard CVS | ||
| 237 | ((?U ?P) | ||
| 238 | (if dont-change-disc 'NEED-UPDATE | ||
| 239 | (cons 'UP-TO-DATE (if (eq code ?U) 'UPDATED 'PATCHED))))) | ||
| 240 | path 'trust))) | ||
| 233 | 241 | ||
| 234 | (and | 242 | (and |
| 235 | (cvs-match "pcl-cvs: descending directory \\(.*\\)$" (dir 1)) | 243 | (cvs-match "pcl-cvs: descending directory \\(.*\\)$" (dir 1)) |