aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond2007-12-29 13:20:49 +0000
committerEric S. Raymond2007-12-29 13:20:49 +0000
commit484c1b1f1437aedf152d55be8c6654c30aad181c (patch)
tree1f3bbcd636b03adede6437ef805eb7808540685c
parentcfef87adf1b4f4300b9f8f1548a6f2505921fd81 (diff)
downloademacs-484c1b1f1437aedf152d55be8c6654c30aad181c.tar.gz
emacs-484c1b1f1437aedf152d55be8c6654c30aad181c.zip
* vc-svn.el (vc-svn-parse-status): Recognize 'added, 'removed,
and 'unregistered states. * vc-hooks.el (vc-state): Added 'removed state to documentation. * vc-hg (vc-hg-parse-status): Recognize 'added, 'removed, and 'up-to-date state. Deal with the possibility that C for clean might change to "=" in the next point release. * vc-git.el (vc-git-parse-status): Recognize 'removed. * vc.el (header comment): Better description of new dir-state. (vc-compatible-state): Defines which states are mutually compatible; usable with 'edited as a test for which can be committed on. (vc-dired-hook): Turn off undo in the VC-Dired buffer, a speed tweak. (vc-default-dired-state-info): Display 'removed state. * vc-bzr.el (vc-bzr-dir-state): Recognize 'added.
-rw-r--r--lisp/ChangeLog20
-rw-r--r--lisp/vc-bzr.el2
-rw-r--r--lisp/vc-git.el5
-rw-r--r--lisp/vc-hg.el12
-rw-r--r--lisp/vc-hooks.el6
-rw-r--r--lisp/vc-svn.el13
-rw-r--r--lisp/vc.el28
7 files changed, 63 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dec21f2d630..585d64cd2ea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,23 @@
12007-12-29 Eric S. Raymond <esr@snark.thyrsus.com>
2
3 * vc-svn.el (vc-svn-parse-status): Recognize 'unregistered,
4 'added, 'removed.
5
6 * vc.el (header coment): Better description of dir-state.
7 (vc-compatible-state): New function. Checks whether two states
8 can be in the same changeset; used with 'edited it can test whether
9 the next action for a state should be commit.
10 (vc-default-dired-format0info): Display 'added state.
11 (vc-dired-hook): Turn off undo, this is a speed tweak.
12
13 * vc-bzr.el (vc-bzr-dir-state): Recognize 'added.
14
15 * vc-hg.el (vc-bzr-hg-state): Recognize 'added and 'removed.
16 Cope with the possibility that the 'C' status flag might change
17 in 0.9,6.
18
19 * vc-git.el (vc-bzr-dir-state): Recognize 'removed.
20
12007-12-29 Thien-Thi Nguyen <ttn@gnuvola.org> 212007-12-29 Thien-Thi Nguyen <ttn@gnuvola.org>
2 22
3 * files.el (cd-absolute): Fix omission bug: 23 * files.el (cd-absolute): Fix omission bug:
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index 01599c91dff..8a1c56490ac 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -522,7 +522,7 @@ Optional argument LOCALP is always ignored."
522 (setq at-start nil) 522 (setq at-start nil)
523 (cond 523 (cond
524 ((looking-at "^added") 524 ((looking-at "^added")
525 (setq current-vc-state 'edited) 525 (setq current-vc-state 'added)
526 (setq current-bzr-state 'added)) 526 (setq current-bzr-state 'added))
527 ((looking-at "^kind changed") 527 ((looking-at "^kind changed")
528 (setq current-vc-state 'edited) 528 (setq current-vc-state 'edited)
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index 7895251be0e..1626d5347ee 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -168,19 +168,20 @@
168 (line-end-position)))) 168 (line-end-position))))
169 (cond 169 (cond
170 ;; The rest of the possible states in "git ls-files -t" output: 170 ;; The rest of the possible states in "git ls-files -t" output:
171 ;; R removed/deleted
172 ;; K to be killed 171 ;; K to be killed
173 ;; should not show up in vc-dired, so don't deal with them 172 ;; should not show up in vc-dired, so don't deal with them
174 ;; here. 173 ;; here.
175 ((eq status-char ?H) 174 ((eq status-char ?H)
176 (vc-file-setprop file 'vc-state 'up-to-date)) 175 (vc-file-setprop file 'vc-state 'up-to-date))
176 ((eq status-char ?R)
177 (vc-file-setprop file 'vc-state 'removed))
177 ((eq status-char ?M) 178 ((eq status-char ?M)
178 (vc-file-setprop file 'vc-state 'edited)) 179 (vc-file-setprop file 'vc-state 'edited))
179 ((eq status-char ?C) 180 ((eq status-char ?C)
180 (vc-file-setprop file 'vc-state 'edited)) 181 (vc-file-setprop file 'vc-state 'edited))
181 ((eq status-char ??) 182 ((eq status-char ??)
182 (vc-file-setprop file 'vc-backend 'none) 183 (vc-file-setprop file 'vc-backend 'none)
183 (vc-file-setprop file 'vc-state 'nil))) 184 (vc-file-setprop file 'vc-state nil)))
184 (forward-line))))) 185 (forward-line)))))
185 186
186(defun vc-git-working-revision (file) 187(defun vc-git-working-revision (file)
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el
index b3482ddffae..6970ed72ccf 100644
--- a/lisp/vc-hg.el
+++ b/lisp/vc-hg.el
@@ -194,8 +194,8 @@
194 (buffer-substring-no-properties (+ (point) 2) 194 (buffer-substring-no-properties (+ (point) 2)
195 (line-end-position)))) 195 (line-end-position))))
196 (cond 196 (cond
197 ;; State flag for a clean file is now C, might change to =.
197 ;; The rest of the possible states in "hg status" output: 198 ;; The rest of the possible states in "hg status" output:
198 ;; R = removed
199 ;; ! = deleted, but still tracked 199 ;; ! = deleted, but still tracked
200 ;; should not show up in vc-dired, so don't deal with them 200 ;; should not show up in vc-dired, so don't deal with them
201 ;; here. 201 ;; here.
@@ -203,14 +203,20 @@
203 (vc-file-setprop file 'vc-state 'up-to-date)) 203 (vc-file-setprop file 'vc-state 'up-to-date))
204 ((eq status-char ?A) 204 ((eq status-char ?A)
205 (vc-file-setprop file 'vc-working-revision "0") 205 (vc-file-setprop file 'vc-working-revision "0")
206 (vc-file-setprop file 'vc-state 'edited)) 206 (vc-file-setprop file 'vc-state 'added))
207 ((eq status-char ?R)
208 (vc-file-setprop file 'vc-state 'removed))
207 ((eq status-char ?M) 209 ((eq status-char ?M)
208 (vc-file-setprop file 'vc-state 'edited)) 210 (vc-file-setprop file 'vc-state 'edited))
209 ((eq status-char ?I) 211 ((eq status-char ?I)
210 (vc-file-setprop file 'vc-state 'ignored)) 212 (vc-file-setprop file 'vc-state 'ignored))
211 ((eq status-char ??) 213 ((eq status-char ??)
212 (vc-file-setprop file 'vc-backend 'none) 214 (vc-file-setprop file 'vc-backend 'none)
213 (vc-file-setprop file 'vc-state 'unregistered))) 215 (vc-file-setprop file 'vc-state 'unregistered))
216 ((eq status-char ?!)
217 nil)
218 (t ;; Presently C, might change to = in 0.9.6
219 (vc-file-setprop file 'vc-state 'up-to-date)))
214 (forward-line))))) 220 (forward-line)))))
215 221
216(defun vc-hg-working-revision (file) 222(defun vc-hg-working-revision (file)
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index 3d589e117c8..39550da8018 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -503,14 +503,16 @@ For registered files, the value returned is one of:
503 Often represented by vc-working-revision = \"0\" in VCSes 503 Often represented by vc-working-revision = \"0\" in VCSes
504 with monotonic IDs like Subversion and Mercurial. 504 with monotonic IDs like Subversion and Mercurial.
505 505
506 'ignored The file showed up in a dir-state listing with a flag 506 'removed Scheduled to be deleted from the repository on next commit.
507
508 'ignored The file showed up in a dir-state listing with a flag
507 indicating the version-control system is ignoring it, 509 indicating the version-control system is ignoring it,
508 Note: This property is not set reliably (some VCSes 510 Note: This property is not set reliably (some VCSes
509 don't have useful directory-status commands) so assume 511 don't have useful directory-status commands) so assume
510 that any file with vc-state nil might be ignorable 512 that any file with vc-state nil might be ignorable
511 without VC knowing it. 513 without VC knowing it.
512 514
513 'unregistered The file showed up in a dir-state listing with a flag 515 'unregistered The file showed up in a dir-state listing with a flag
514 indicating that it is not under version control. 516 indicating that it is not under version control.
515 Note: This property is not set reliably (some VCSes 517 Note: This property is not set reliably (some VCSes
516 don't have useful directory-status commands) so assume 518 don't have useful directory-status commands) so assume
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index ced4c941b55..c1261c5d0a4 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -543,15 +543,16 @@ information about FILENAME and return its status."
543 (let (file status) 543 (let (file status)
544 (goto-char (point-min)) 544 (goto-char (point-min))
545 (while (re-search-forward 545 (while (re-search-forward
546 ;; Ignore the files with status in [IX?]. 546 ;; Ignore the files with status X.
547 "^[ ACDGMR!~][ MC][ L][ +][ S]..\\([ *]\\) +\\([-0-9]+\\) +\\([0-9?]+\\) +\\([^ ]+\\) +" nil t) 547 "^[ ACDGIMR!?~][ MC][ L][ +][ S]..\\([ *]\\) +\\([-0-9]+\\) +\\([0-9?]+\\) +\\([^ ]+\\) +" nil t)
548 ;; If the username contains spaces, the output format is ambiguous, 548 ;; If the username contains spaces, the output format is ambiguous,
549 ;; so don't trust the output's filename unless we have to. 549 ;; so don't trust the output's filename unless we have to.
550 (setq file (or filename 550 (setq file (or filename
551 (expand-file-name 551 (expand-file-name
552 (buffer-substring (point) (line-end-position))))) 552 (buffer-substring (point) (line-end-position)))))
553 (setq status (char-after (line-beginning-position))) 553 (setq status (char-after (line-beginning-position)))
554 (unless (eq status ??) 554 (if (eq status ??)
555 (vc-file-setprop file 'vc-state 'unregistered)
555 ;; `vc-BACKEND-registered' must not set vc-backend, 556 ;; `vc-BACKEND-registered' must not set vc-backend,
556 ;; which is instead set in vc-registered. 557 ;; which is instead set in vc-registered.
557 (unless filename (vc-file-setprop file 'vc-backend 'SVN)) 558 (unless filename (vc-file-setprop file 'vc-backend 'SVN))
@@ -573,15 +574,15 @@ information about FILENAME and return its status."
573 ;; If the file was actually copied, (match-string 2) is "-". 574 ;; If the file was actually copied, (match-string 2) is "-".
574 (vc-file-setprop file 'vc-working-revision "0") 575 (vc-file-setprop file 'vc-working-revision "0")
575 (vc-file-setprop file 'vc-checkout-time 0) 576 (vc-file-setprop file 'vc-checkout-time 0)
576 'edited) 577 'added)
577 ((memq status '(?M ?C)) 578 ((memq status '(?M ?C))
578 (if (eq (char-after (match-beginning 1)) ?*) 579 (if (eq (char-after (match-beginning 1)) ?*)
579 'needs-merge 580 'needs-merge
580 'edited)) 581 'edited))
581 ((eq status ?I) 582 ((eq status ?I)
582 (vc-file-setprop file 'vc-state 'ignored)) 583 (vc-file-setprop file 'vc-state 'ignored))
583 ((eq status ??) 584 ((eq status ?R)
584 (vc-file-setprop file 'vc-state 'unregistered)) 585 (vc-file-setprop file 'vc-state 'removed))
585 (t 'edited))))) 586 (t 'edited)))))
586 (if filename (vc-file-getprop filename 'vc-state)))) 587 (if filename (vc-file-getprop filename 'vc-state))))
587 588
diff --git a/lisp/vc.el b/lisp/vc.el
index 5ec872523b5..f25045bc469 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -159,12 +159,13 @@
159;; 159;;
160;; - dir-state (dir) 160;; - dir-state (dir)
161;; 161;;
162;; If provided, this function is used to find the version control state 162;; If provided, this function is used to find the version control
163;; of all files in DIR, and all subdirecties of DIR, in a fast way. 163;; state of as many files as possible in DIR, and all subdirecties
164;; The function should not return anything, but rather store the files' 164;; of DIR, in a fast way; it is used to avoid expensive indivitual
165;; states into the corresponding `vc-state' properties. (Note: in 165;; vc-state calls. The function should not return anything, but
166;; older versions this method was not required to recurse into 166;; rather store the files' states into the corresponding `vc-state'
167;; subdirectories.) 167;; properties. (Note: in older versions this method was not
168;; required to recurse into subdirectories.)
168;; 169;;
169;; * working-revision (file) 170;; * working-revision (file)
170;; 171;;
@@ -1346,6 +1347,12 @@ NOT-URGENT means it is ok to continue if the user says not to save."
1346 1347
1347(defvar vc-dired-window-configuration) 1348(defvar vc-dired-window-configuration)
1348 1349
1350(defun vc-compatible-state (p q)
1351 "Controls which states can be in the same commit."
1352 (or
1353 (eq p q)
1354 (and (member p '(edited added removed)) (member q '(edited added removed)))))
1355
1349;; Here's the major entry point. 1356;; Here's the major entry point.
1350 1357
1351;;;###autoload 1358;;;###autoload
@@ -1386,7 +1393,7 @@ merge in the changes into your working copy."
1386 revision) 1393 revision)
1387 ;; Verify that the fileset is homogenous 1394 ;; Verify that the fileset is homogenous
1388 (dolist (file (cdr files)) 1395 (dolist (file (cdr files))
1389 (if (not (eq (vc-state file) state)) 1396 (if (not (vc-compatible-state (vc-state file) state))
1390 (error "Fileset is in a mixed-up state")) 1397 (error "Fileset is in a mixed-up state"))
1391 (if (not (eq (vc-checkout-model file) model)) 1398 (if (not (eq (vc-checkout-model file) model))
1392 (error "Fileset has mixed checkout models"))) 1399 (error "Fileset has mixed checkout models")))
@@ -1436,7 +1443,7 @@ merge in the changes into your working copy."
1436 ;; do nothing 1443 ;; do nothing
1437 (message "Fileset is up-to-date")))) 1444 (message "Fileset is up-to-date"))))
1438 ;; Files have local changes 1445 ;; Files have local changes
1439 ((eq state 'edited) 1446 ((vc-compatible-state state 'edited)
1440 (let ((ready-for-commit files)) 1447 (let ((ready-for-commit files))
1441 ;; If files are edited but read-only, give user a chance to correct 1448 ;; If files are edited but read-only, give user a chance to correct
1442 (dolist (file files) 1449 (dolist (file files)
@@ -2349,7 +2356,9 @@ Called by dired after any portion of a vc-dired buffer has been read in."
2349 (if (and (vc-call-backend backend 'responsible-p default-directory) 2356 (if (and (vc-call-backend backend 'responsible-p default-directory)
2350 (vc-find-backend-function backend 'dir-state)) 2357 (vc-find-backend-function backend 'dir-state))
2351 (vc-call-backend backend 'dir-state default-directory))) 2358 (vc-call-backend backend 'dir-state default-directory)))
2352 (let (filename (inhibit-read-only t)) 2359 (let (filename
2360 (inhibit-read-only t)
2361 (buffer-undo-list t))
2353 (goto-char (point-min)) 2362 (goto-char (point-min))
2354 (while (not (eobp)) 2363 (while (not (eobp))
2355 (cond 2364 (cond
@@ -3076,6 +3085,7 @@ to provide the `find-revision' operation instead."
3076 ((eq state 'needs-merge) "(merge)") 3085 ((eq state 'needs-merge) "(merge)")
3077 ((eq state 'needs-patch) "(patch)") 3086 ((eq state 'needs-patch) "(patch)")
3078 ((eq state 'added) "(added)") 3087 ((eq state 'added) "(added)")
3088 ((eq state 'removed) "(removed)")
3079 ((eq state 'ignored) "(ignored)") ;; dired-hook filters this out 3089 ((eq state 'ignored) "(ignored)") ;; dired-hook filters this out
3080 ((eq state 'unregistered) "?") 3090 ((eq state 'unregistered) "?")
3081 ((eq state 'unlocked-changes) "(stale)") 3091 ((eq state 'unlocked-changes) "(stale)")