summaryrefslogtreecommitdiff
path: root/lisp/vc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc')
-rw-r--r--lisp/vc/ediff-init.el2
-rw-r--r--lisp/vc/ediff-ptch.el2
-rw-r--r--lisp/vc/emerge.el2
-rw-r--r--lisp/vc/pcvs.el2
-rw-r--r--lisp/vc/vc-bzr.el5
-rw-r--r--lisp/vc/vc-dir.el100
-rw-r--r--lisp/vc/vc-hg.el2
-rw-r--r--lisp/vc/vc-hooks.el6
-rw-r--r--lisp/vc/vc.el61
9 files changed, 96 insertions, 86 deletions
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index 787a8b7c0f1..d3db66a9e2a 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -370,7 +370,7 @@ It needs to be killed when we quit the session.")
this-command)))
(defgroup ediff-highlighting nil
- "Hilighting of difference regions in Ediff."
+ "Highlighting of difference regions in Ediff."
:prefix "ediff-"
:group 'ediff)
diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el
index ef273c610fe..6563dca5ec6 100644
--- a/lisp/vc/ediff-ptch.el
+++ b/lisp/vc/ediff-ptch.el
@@ -373,7 +373,7 @@ other files, enter /dev/null
(concat actual-dir (cdr proposed-file-names)))))
))
ediff-patch-map)
- ;; Check for the existing files in each pair and discard the nonexisting
+ ;; Check for the existing files in each pair and discard the nonexistent
;; ones. If both exist, ask the user.
(mapcar (lambda (session-info)
(let* ((file1 (car (ediff-get-session-objA-name session-info)))
diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el
index 3ba5bcdb90a..bc4b0725c4e 100644
--- a/lisp/vc/emerge.el
+++ b/lisp/vc/emerge.el
@@ -1754,7 +1754,7 @@ to the left margin, if they are in windows."
;; If there are min-lines lines above and below the region, then don't do
;; anything.
;; If not, recenter the region to make it so.
-;; If that isn't possible, remove context lines balancedly from top and bottom
+;; If that isn't possible, remove context lines evenly from top and bottom
;; so the entire region shows.
;; If that isn't possible, show the top of the region.
;; BEG must be at the beginning of a line.
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el
index 256719d4c84..9a8be04fc38 100644
--- a/lisp/vc/pcvs.el
+++ b/lisp/vc/pcvs.el
@@ -322,7 +322,7 @@ The argument is added (or not) to the list of FLAGS and is constructed
by appending the branch to ARG which defaults to \"-r\".
Since the `cvs-secondary-branch-prefix' is only active if the primary
prefix is active, it is important to read the secondary prefix before
-the primay since reading the primary can deactivate it."
+the primary since reading the primary can deactivate it."
(let ((branch (and (cvs-prefix-get 'cvs-branch-prefix 'read-only)
(cvs-prefix-get 'cvs-secondary-branch-prefix))))
(if branch (cons (concat (or arg "-r") branch) flags) flags)))
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index c5c0ce73b3a..508420f026a 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -764,7 +764,10 @@ REV non-nil gets an error."
(defun vc-bzr-rename-file (old new)
"Rename file from OLD to NEW using `bzr mv'."
- (vc-bzr-command "mv" nil 0 new old))
+ (setq old (expand-file-name old))
+ (setq new (expand-file-name new))
+ (vc-bzr-command "mv" nil 0 new old)
+ (message "Renamed %s => %s" old new))
(defvar vc-bzr-annotation-table nil
"Internal use.")
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index d4b631a1d1b..f14b8830d43 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -534,57 +534,71 @@ If a prefix argument is given, move by that many lines."
(save-excursion
(goto-char (region-beginning))
(while (<= (line-number-at-pos) lastl)
- (funcall mark-unmark-function))))
+ (condition-case nil
+ (funcall mark-unmark-function)
+ ;; `vc-dir-mark-file' signals an error if we try marking
+ ;; a directory containing marked files in its tree, or a
+ ;; file in a marked directory tree. Just continue.
+ (error (vc-dir-next-line 1))))))
(funcall mark-unmark-function)))
(defun vc-dir-parent-marked-p (arg)
- ;; Return nil if none of the parent directories of arg is marked.
+ ;; Non-nil iff a parent directory of arg is marked.
+ ;; Return value, if non-nil is the `ewoc-data' for the marked parent.
(let* ((argdir (vc-dir-node-directory arg))
(arglen (length argdir))
(crt arg)
- data dir)
+ (found nil))
;; Go through the predecessors, checking if any directory that is
;; a parent is marked.
- (while (setq crt (ewoc-prev vc-ewoc crt))
- (setq data (ewoc-data crt))
- (setq dir (vc-dir-node-directory crt))
- (when (and (vc-dir-fileinfo->directory data)
- (vc-string-prefix-p dir argdir))
- (when (vc-dir-fileinfo->marked data)
- (error "Cannot mark `%s', parent directory `%s' marked"
- (vc-dir-fileinfo->name (ewoc-data arg))
- (vc-dir-fileinfo->name data)))))
- nil))
+ (while (and (null found)
+ (setq crt (ewoc-prev vc-ewoc crt)))
+ (let ((data (ewoc-data crt))
+ (dir (vc-dir-node-directory crt)))
+ (and (vc-dir-fileinfo->directory data)
+ (vc-string-prefix-p dir argdir)
+ (vc-dir-fileinfo->marked data)
+ (setq found data))))
+ found))
(defun vc-dir-children-marked-p (arg)
- ;; Return nil if none of the children of arg is marked.
+ ;; Non-nil iff a child of ARG is marked.
+ ;; Return value, if non-nil, is the `ewoc-data' for the marked child.
(let* ((argdir-re (concat "\\`" (regexp-quote (vc-dir-node-directory arg))))
(is-child t)
(crt arg)
- data dir)
- (while (and is-child (setq crt (ewoc-next vc-ewoc crt)))
- (setq data (ewoc-data crt))
- (setq dir (vc-dir-node-directory crt))
- (if (string-match argdir-re dir)
- (when (vc-dir-fileinfo->marked data)
- (error "Cannot mark `%s', child `%s' marked"
- (vc-dir-fileinfo->name (ewoc-data arg))
- (vc-dir-fileinfo->name data)))
- ;; We are done, we got to an entry that is not a child of `arg'.
- (setq is-child nil)))
- nil))
+ (found nil))
+ (while (and is-child
+ (null found)
+ (setq crt (ewoc-next vc-ewoc crt)))
+ (let ((data (ewoc-data crt))
+ (dir (vc-dir-node-directory crt)))
+ (if (string-match argdir-re dir)
+ (if (vc-dir-fileinfo->marked data)
+ (setq found data))
+ ;; We are done, we got to an entry that is not a child of `arg'.
+ (setq is-child nil))))
+ found))
(defun vc-dir-mark-file (&optional arg)
;; Mark ARG or the current file and move to the next line.
(let* ((crt (or arg (ewoc-locate vc-ewoc)))
(file (ewoc-data crt))
- (isdir (vc-dir-fileinfo->directory file)))
- (when (or (and isdir (not (vc-dir-children-marked-p crt)))
- (and (not isdir) (not (vc-dir-parent-marked-p crt))))
- (setf (vc-dir-fileinfo->marked file) t)
- (ewoc-invalidate vc-ewoc crt)
- (unless (or arg (mouse-event-p last-command-event))
- (vc-dir-next-line 1)))))
+ (isdir (vc-dir-fileinfo->directory file))
+ ;; Forbid marking a directory containing marked files in its
+ ;; tree, or a file in a marked directory tree.
+ (conflict (if isdir
+ (vc-dir-children-marked-p crt)
+ (vc-dir-parent-marked-p crt))))
+ (when conflict
+ (error (if isdir
+ "File `%s' in this directory is already marked"
+ "Parent directory `%s' is already marked")
+ (vc-dir-fileinfo->name conflict)))
+ (setf (vc-dir-fileinfo->marked file) t)
+ (ewoc-invalidate vc-ewoc crt)
+ (unless (or arg (mouse-event-p last-command-event))
+ (vc-dir-next-line 1))))
(defun vc-dir-mark ()
"Mark the current file or all files in the region.
@@ -621,19 +635,19 @@ share the same state."
(setf (vc-dir-fileinfo->marked filearg) t)
t))
vc-ewoc))
- (let ((data (ewoc-data (ewoc-locate vc-ewoc))))
+ (let* ((crt (ewoc-locate vc-ewoc))
+ (data (ewoc-data crt)))
(if (vc-dir-fileinfo->directory data)
;; It's a directory, mark child files.
- (let ((crt (ewoc-locate vc-ewoc)))
- (unless (vc-dir-children-marked-p crt)
- (while (setq crt (ewoc-next vc-ewoc crt))
- (let ((crt-data (ewoc-data crt)))
- (unless (vc-dir-fileinfo->directory crt-data)
- (setf (vc-dir-fileinfo->marked crt-data) t)
- (ewoc-invalidate vc-ewoc crt))))))
+ (let (crt-data)
+ (while (and (setq crt (ewoc-next vc-ewoc crt))
+ (setq crt-data (ewoc-data crt))
+ (not (vc-dir-fileinfo->directory crt-data)))
+ (setf (vc-dir-fileinfo->marked crt-data) t)
+ (ewoc-invalidate vc-ewoc crt)))
;; It's a file
- (let ((state (vc-dir-fileinfo->state data))
- (crt (ewoc-nth vc-ewoc 0)))
+ (let ((state (vc-dir-fileinfo->state data)))
+ (setq crt (ewoc-nth vc-ewoc 0))
(while crt
(let ((crt-data (ewoc-data crt)))
(when (and (not (vc-dir-fileinfo->marked crt-data))
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 0516abbf024..7b90536a31b 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -216,7 +216,7 @@ highlighting the Log View buffer."
((eq state ?R) 'removed)
((eq state ?!) 'missing)
((eq state ??) 'unregistered)
- ((eq state ?C) 'up-to-date) ;; Older mercurials use this
+ ((eq state ?C) 'up-to-date) ;; Older mercurial versions use this.
(t 'up-to-date)))))))
(defun vc-hg-working-revision (file)
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 148f6cde930..c9e30772318 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -114,9 +114,9 @@ Otherwise, not displayed."
:group 'vc)
(defcustom vc-keep-workfiles t
- "If non-nil, don't delete working files after registering changes.
-If the back-end is CVS, workfiles are always kept, regardless of the
-value of this flag."
+ "Whether to keep work files on disk after commits, on a locking VCS.
+This variable has no effect on modern merging-based version
+control systems."
:type 'boolean
:group 'vc)
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index eea1a992094..87e8901e33a 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -951,13 +951,13 @@ Within directories, only files already under version control are noticed."
(defun vc-deduce-fileset (&optional observer allow-unregistered
state-model-only-files)
"Deduce a set of files and a backend to which to apply an operation.
-
Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL).
-If we're in VC-dir mode, the fileset is the list of marked files.
-Otherwise, if we're looking at a buffer visiting a version-controlled file,
-the fileset is a singleton containing this file.
-If none of these conditions is met, but ALLOW_UNREGISTERED is on and the
-visited file is not registered, return a singleton fileset containing it.
+
+If we're in VC-dir mode, FILESET is the list of marked files.
+Otherwise, if in a buffer visiting a version-controlled file,
+FILESET is a single-file fileset containing that file.
+Otherwise, if ALLOW-UNREGISTERED is non-nil and the visited file
+is unregistered, FILESET is a single-file fileset containing it.
Otherwise, throw an error.
STATE-MODEL-ONLY-FILES if non-nil, means that the caller needs
@@ -1048,34 +1048,27 @@ current buffer."
;;;###autoload
(defun vc-next-action (verbose)
"Do the next logical version control operation on the current fileset.
-This requires that all files in the fileset be in the same state.
-
-For locking systems:
- If every file is not already registered, this registers each for version
-control.
- If every file is registered and not locked by anyone, this checks out
-a writable and locked file of each ready for editing.
- If every file is checked out and locked by the calling user, this
-first checks to see if each file has changed since checkout. If not,
-it performs a revert on that file.
- If every file has been changed, this pops up a buffer for entry
-of a log message; when the message has been entered, it checks in the
-resulting changes along with the log message as change commentary. If
-the variable `vc-keep-workfiles' is non-nil (which is its default), a
-read-only copy of each changed file is left in place afterwards.
- If the affected file is registered and locked by someone else, you are
-given the option to steal the lock(s).
-
-For merging systems:
- If every file is not already registered, this registers each one for version
-control. This does an add, but not a commit.
- If every file is added but not committed, each one is committed.
- If every working file is changed, but the corresponding repository file is
-unchanged, this pops up a buffer for entry of a log message; when the
-message has been entered, it checks in the resulting changes along
-with the logmessage as change commentary. A writable file is retained.
- If the repository file is changed, you are asked if you want to
-merge in the changes into your working copy."
+This requires that all files in the current VC fileset be in the
+same state. If not, signal an error.
+
+For merging-based version control systems:
+ If every file in the VC fileset is not registered for version
+ control, register the fileset (but don't commit).
+ If every work file in the VC fileset is added or changed, pop
+ up a *vc-log* buffer to commit the fileset.
+ For a centralized version control system, if any work file in
+ the VC fileset is out of date, offer to update the fileset.
+
+For old-style locking-based version control systems, like RCS:
+ If every file is not registered, register the file(s).
+ If every file is registered and unlocked, check out (lock)
+ the file(s) for editing.
+ If every file is locked by you and has changes, pop up a
+ *vc-log* buffer to check in the changes. If the variable
+ `vc-keep-workfiles' is non-nil (the default), leave a
+ read-only copy of each changed file after checking in.
+ If every file is locked by you and unchanged, unlock them.
+ If every file is locked by someone else, offer to steal the lock."
(interactive "P")
(let* ((vc-fileset (vc-deduce-fileset nil t 'state-model-only-files))
(backend (car vc-fileset))