diff options
| author | Stefan Monnier | 2004-03-18 02:48:06 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-03-18 02:48:06 +0000 |
| commit | 27fde5995a415757272be14bc1f745a2bc9989fc (patch) | |
| tree | 24af1fd377d873ef4bf49c1c1633003ac83ab1b1 | |
| parent | 7ab91c5f4532a82db9dbfcfc8a991f3429f43610 (diff) | |
| download | emacs-27fde5995a415757272be14bc1f745a2bc9989fc.tar.gz emacs-27fde5995a415757272be14bc1f745a2bc9989fc.zip | |
(vc-arch-workfile-version, vc-arch-mode-line-rewrite):
Take sealed revisions into account.
(vc-arch-checkin): Extract a summary line from the message.
| -rw-r--r-- | lisp/vc-arch.el | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el index 2ce5ef67656..52dc623e9c4 100644 --- a/lisp/vc-arch.el +++ b/lisp/vc-arch.el | |||
| @@ -40,10 +40,17 @@ | |||
| 40 | 40 | ||
| 41 | ;; Bugs: | 41 | ;; Bugs: |
| 42 | 42 | ||
| 43 | ;; - Opening a new file prompts "blabla was lost; check out? (yes or no)". | ||
| 44 | ;; - *VC-log*'s initial content lacks the `Summary:' lines. | ||
| 43 | ;; - All files under the tree are considered as "under Arch's control" | 45 | ;; - All files under the tree are considered as "under Arch's control" |
| 44 | ;; without regards to =tagging-method and such. | 46 | ;; without regards to =tagging-method and such. |
| 45 | ;; - Files are always considered as `edited'. | 47 | ;; - Files are always considered as `edited'. |
| 48 | ;; - C-x v l does not work. | ||
| 46 | ;; - C-x v i does not work. | 49 | ;; - C-x v i does not work. |
| 50 | ;; - C-x v ~ does not work. | ||
| 51 | ;; - C-x v u does not work. | ||
| 52 | ;; - C-x v s does not work. | ||
| 53 | ;; - C-x v r does not work. | ||
| 47 | ;; - VC-dired does not work. | 54 | ;; - VC-dired does not work. |
| 48 | ;; - And more... | 55 | ;; - And more... |
| 49 | 56 | ||
| @@ -141,7 +148,7 @@ Return non-nil if FILE is unchanged." | |||
| 141 | (category (match-string 4 defbranch)) | 148 | (category (match-string 4 defbranch)) |
| 142 | (branch (match-string 3 defbranch)) | 149 | (branch (match-string 3 defbranch)) |
| 143 | (version (match-string 2 defbranch)) | 150 | (version (match-string 2 defbranch)) |
| 144 | (rev-nb 0) | 151 | (sealed nil) (rev-nb 0) |
| 145 | (rev nil) | 152 | (rev nil) |
| 146 | logdir tmp) | 153 | logdir tmp) |
| 147 | (setq logdir (expand-file-name category root)) | 154 | (setq logdir (expand-file-name category root)) |
| @@ -149,16 +156,20 @@ Return non-nil if FILE is unchanged." | |||
| 149 | (setq logdir (expand-file-name version logdir)) | 156 | (setq logdir (expand-file-name version logdir)) |
| 150 | (setq logdir (expand-file-name archive logdir)) | 157 | (setq logdir (expand-file-name archive logdir)) |
| 151 | (setq logdir (expand-file-name "patch-log" logdir)) | 158 | (setq logdir (expand-file-name "patch-log" logdir)) |
| 159 | ;; Revision names go: base-0, patch-N, version-0, versionfix-N. | ||
| 152 | (dolist (file (directory-files logdir)) | 160 | (dolist (file (directory-files logdir)) |
| 161 | (when (and (eq (aref file 0) ?v) (not sealed)) | ||
| 162 | (setq sealed t rev-nb 0)) | ||
| 153 | (if (and (string-match "-\\([0-9]+\\)\\'" file) | 163 | (if (and (string-match "-\\([0-9]+\\)\\'" file) |
| 154 | (setq tmp (string-to-number (match-string 1 file))) | 164 | (setq tmp (string-to-number (match-string 1 file))) |
| 165 | (or (not sealed) (eq (aref file 0) ?v)) | ||
| 155 | (>= tmp rev-nb)) | 166 | (>= tmp rev-nb)) |
| 156 | (setq rev-nb tmp rev file))) | 167 | (setq rev-nb tmp rev file))) |
| 157 | (concat defbranch "--" rev))))) | 168 | (concat defbranch "--" rev))))) |
| 158 | 169 | ||
| 159 | 170 | ||
| 160 | (defcustom vc-arch-mode-line-rewrite | 171 | (defcustom vc-arch-mode-line-rewrite |
| 161 | '(("\\`.*--\\(.*--.*\\)--.*-\\([0-9]+\\)\\'" . "\\2[\\1]")) | 172 | '(("\\`.*--\\(.*--.*\\)--\\(v?\\).*-\\([0-9]+\\)\\'" . "\\2\\3[\\1]")) |
| 162 | "Rewrite rules to shorten Arch's revision names on the mode-line." | 173 | "Rewrite rules to shorten Arch's revision names on the mode-line." |
| 163 | :type '(repeat (cons regexp string))) | 174 | :type '(repeat (cons regexp string))) |
| 164 | 175 | ||
| @@ -209,8 +220,14 @@ Return non-nil if FILE is unchanged." | |||
| 209 | 220 | ||
| 210 | (defun vc-arch-checkin (file rev comment) | 221 | (defun vc-arch-checkin (file rev comment) |
| 211 | (if rev (error "Committing to a specific revision is unsupported.")) | 222 | (if rev (error "Committing to a specific revision is unsupported.")) |
| 212 | (vc-arch-command nil 0 file "commit" "-L" comment "--" | 223 | (let ((summary (file-relative-name file (vc-arch-root file)))) |
| 213 | (vc-switches 'Arch 'checkin))) | 224 | ;; Extract a summary from the comment. |
| 225 | (when (or (string-match "\\`Summary:[ \t]*\\(.*[^ \t\n]\\)\\([ \t]*\n\\)*" comment) | ||
| 226 | (string-match "\\`[ \t]*\\(.*[^ \t\n]\\)[ \t]*\\(\n?\\'\\|\n\\([ \t]*\n\\)+\\)" comment)) | ||
| 227 | (setq summary (match-string 1 comment)) | ||
| 228 | (setq comment (substring comment (match-end 0)))) | ||
| 229 | (vc-arch-command nil 0 file "commit" "-s" summary "-L" comment "--" | ||
| 230 | (vc-switches 'Arch 'checkin)))) | ||
| 214 | 231 | ||
| 215 | (defun vc-arch-diff (file &optional oldvers newvers) | 232 | (defun vc-arch-diff (file &optional oldvers newvers) |
| 216 | "Get a difference report using Arch between two versions of FILE." | 233 | "Get a difference report using Arch between two versions of FILE." |