diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index b482f5658c3..2400440f951 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1109,6 +1109,15 @@ but limited to the current fileset. If you customize @code{vc-use-incoming-outgoing-prefixes} to non-@code{nil}, this command becomes available on @kbd{C-x v O =}. +@item C-x v E D +Display a combined diff of all changes that will be sent by the next +push operation plus any uncommitted changes. + +@item C-x v E = +Display a combined diff of all changes that will be sent by the next +push operation plus any uncommitted changes, but limited to the current +fileset. + @item C-x v h Display the history of changes made in the region of file visited by the current buffer (@code{vc-region-history}). @@ -1223,6 +1232,17 @@ The difference is that the diffs reported are limited to the current fileset. Don't forget that actual pull and push operations always affect the whole working tree, not just the current fileset. +@kindex C-x v E = +@kindex C-x v E D +@findex vc-diff-outgoing-and-edited +@findex vc-root-diff-outgoing-and-edited + Finally, there is also @kbd{C-x v E D} +(@code{vc-root-diff-outgoing-and-edited}) which shows a combined diff of +all changes that would be pushed plus any uncommitted changes. It is +useful to show all work that's present only locally. There is also +@kbd{C-x v E =} (@code{vc-diff-outgoing-and-edited}) which is the same +but limited to the current fileset. + @cindex VC log buffer, commands in @cindex vc-log buffer In the @file{*vc-change-log*} buffer, you can use the following keys diff --git a/etc/NEWS b/etc/NEWS index b5c09ed78e0..8e9e2ce8ed9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3008,6 +3008,13 @@ These are useful to view all outstanding (unmerged, unpushed) changes on the current branch. They are also available as 'T =', 'T D', 'T l' and 'T L' in VC Directory buffers. ++++ +*** New commands to report combined diffs of all local changes. +'C-x v E =' ('vc-diff-outgoing-and-edited') and 'C-x v E D' +('vc-root-diff-outgoing-and-edited') report combined diffs of all +outgoing changes plus any uncommitted changes. They are useful to show +all work that's present only locally. + +++ *** New user option 'vc-use-incoming-outgoing-prefixes'. If this is customized to non-nil, 'C-x v I' and 'C-x v O' become prefix diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 8094148c051..2b8e5d4540c 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -412,6 +412,9 @@ an \\+`up-to-date' or \\+`ignored' file." (define-key map "TL" #'vc-root-log-unintegrated) (define-key map "T=" #'vc-diff-unintegrated) (define-key map "TD" #'vc-root-diff-unintegrated) + (define-key map "EL" #'vc-root-log-outgoing) + (define-key map "E=" #'vc-diff-outgoing-and-edited) + (define-key map "ED" #'vc-root-diff-outgoing-and-edited) (define-key map "V" #'vc-dir-root-next-action) (let ((branch-map (make-sparse-keymap))) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index d5f87f859d9..a7d7352b069 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -1040,6 +1040,14 @@ In the latter case, VC mode is deactivated for this buffer." "T L" #'vc-root-log-unintegrated "T =" #'vc-diff-unintegrated "T D" #'vc-root-diff-unintegrated + ;; There are no -log-outgoing-and-edited commands because by + ;; definition these are the same as -log-outgoing. + ;; Additionally bind the -log-outgoing commands under C-x v E l/L as + ;; nothing else could conceivably go there and it might help someone. + ;; (Fileset-specific outgoing log command coming in Emacs 32. --spwhitton) + "E L" #'vc-root-log-outgoing + "E =" #'vc-diff-outgoing-and-edited + "E D" #'vc-root-diff-outgoing-and-edited "m" #'vc-merge "r" #'vc-retrieve-tag "s" #'vc-create-tag diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index e083ea88da0..30a5c296898 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -3459,6 +3459,41 @@ When called from Lisp, optional argument FILESET overrides the fileset." nil (called-interactively-p 'interactive)))) +;;;###autoload +(defun vc-root-diff-outgoing-and-edited (&optional upstream-location) + "Report combined diff of all outgoing and uncommitted changes. +Outgoing changes are those that would be pushed to UPSTREAM-LOCATION. +When unspecified UPSTREAM-LOCATION is the place \\[vc-push] would push +to. When called interactively with a prefix argument, prompt for +UPSTREAM-LOCATION. In some version control systems UPSTREAM-LOCATION +can be a remote branch name. +When called from Lisp optional argument FILESET overrides the VC +fileset. + +This command is the same as `vc-root-diff-unintegrated' used on a trunk." + (declare (interactive-only vc-root-diff-unintegrated)) + (interactive (list (or (vc--maybe-read-outgoing-base) t))) + (vc-root-diff-unintegrated upstream-location)) + +;;;###autoload +(defun vc-diff-outgoing-and-edited (&optional upstream-location fileset) + "Report combined diff of outgoing and uncommitted changes to VC fileset. +Outgoing changes are those that would be pushed to UPSTREAM-LOCATION. +When unspecified UPSTREAM-LOCATION is the place \\[vc-push] would push +to. When called interactively with a prefix argument, prompt for +UPSTREAM-LOCATION. In some version control systems UPSTREAM-LOCATION +can be a remote branch name. +When called from Lisp optional argument FILESET overrides the VC +fileset. + +This command is the same as `vc-diff-unintegrated' used on a trunk." + (declare (interactive-only vc-diff-unintegrated)) + (interactive (let ((fileset (vc-deduce-fileset t))) + (list (or (vc--maybe-read-outgoing-base (car fileset)) + t) + fileset))) + (vc-diff-unintegrated upstream-location fileset)) + ;;;###autoload (defun vc-log-unintegrated (&optional upstream-location fileset) "Show log for the VC fileset since the merge base with UPSTREAM-LOCATION.