aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThien-Thi Nguyen2008-01-24 13:09:13 +0000
committerThien-Thi Nguyen2008-01-24 13:09:13 +0000
commitd36122a23ef6b5d37215c7f892cc9e4f938818db (patch)
tree76cea6bf5d5659040562c98db9d97e44f4012b89
parent8c8e195273c8aa03aa2b9d953e1ab28a73d33c53 (diff)
downloademacs-d36122a23ef6b5d37215c7f892cc9e4f938818db.tar.gz
emacs-d36122a23ef6b5d37215c7f892cc9e4f938818db.zip
(vc-next-action): Fix two instances of "free-var file" bug:
In both cases, convert single call to one wrapped in dolist.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/vc.el25
2 files changed, 22 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a80f7ef4f41..18baed67097 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -18,6 +18,9 @@
18 Don't do window resize if no window displays buffer. 18 Don't do window resize if no window displays buffer.
19 (vc-diff-internal): Use vc-diff-finish. 19 (vc-diff-internal): Use vc-diff-finish.
20 20
21 * vc.el (vc-next-action): Fix two instances of "free-var file" bug:
22 In both cases, convert single call to one wrapped in dolist.
23
212008-01-24 Dan Nicolaescu <dann@ics.uci.edu> 242008-01-24 Dan Nicolaescu <dann@ics.uci.edu>
22 25
23 * vc.el: Add a TODO item about missing files. 26 * vc.el: Add a TODO item about missing files.
diff --git a/lisp/vc.el b/lisp/vc.el
index 1bb5c28d530..9d1c6682c4d 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -1564,15 +1564,28 @@ merge in the changes into your working copy."
1564 (setq revision (read-string "New revision or backend: ")) 1564 (setq revision (read-string "New revision or backend: "))
1565 (let ((vsym (intern (upcase revision)))) 1565 (let ((vsym (intern (upcase revision))))
1566 (if (member vsym vc-handled-backends) 1566 (if (member vsym vc-handled-backends)
1567 (vc-transfer-file file vsym) 1567 (dolist (file files) (vc-transfer-file file vsym))
1568 (vc-checkin ready-for-commit revision)))))))) 1568 (vc-checkin ready-for-commit revision))))))))
1569 ;; locked by somebody else (locking VCSes only) 1569 ;; locked by somebody else (locking VCSes only)
1570 ((stringp state) 1570 ((stringp state)
1571 (let ((revision 1571 ;; In the old days, we computed the revision once and used it on
1572 (if verbose 1572 ;; the single file. Then, for the 2007-2008 fileset rewrite, we
1573 (read-string "Revision to steal: ") 1573 ;; computed the revision once (incorrectly, using a free var) and
1574 (vc-working-revision file)))) 1574 ;; used it on all files. To fix the free var bug, we can either
1575 (dolist (file files) (vc-steal-lock file revision state)))) 1575 ;; use `(car files)' or do what we do here: distribute the
1576 ;; revision computation among `files'. Although this may be
1577 ;; tedious for those backends where a "revision" is a trans-file
1578 ;; concept, it is nonetheless correct for both those and (more
1579 ;; importantly) for those where "revision" is a per-file concept.
1580 ;; If the intersection of the former group and "locking VCSes" is
1581 ;; non-empty [I vaguely doubt it --ttn], we can reinstate the
1582 ;; pre-computation approach of yore.
1583 (dolist (file files)
1584 (vc-steal-lock
1585 file (if verbose
1586 (read-string (format "%s revision to steal: " file))
1587 (vc-working-revision file))
1588 state)))
1576 ;; needs-patch 1589 ;; needs-patch
1577 ((eq state 'needs-patch) 1590 ((eq state 'needs-patch)
1578 (dolist (file files) 1591 (dolist (file files)