* bug#22860: 24.3; hg merge not too functional @ 2016-02-29 20:56 Ross Boylan 2019-11-23 18:12 ` bug#22860: [PATCH] vc-hg: prompt for branch to merge Andrii Kolomoiets 0 siblings, 1 reply; 16+ messages in thread From: Ross Boylan @ 2016-02-29 20:56 UTC (permalink / raw) To: 22860 C-x v d put me in version control dired mode for a mercurial-controlled directory. C-x v m then says Running "hg merge"... abort: branch 'logit' has one head - please merge with an explicit rev (run 'hg heads' to see all heads) It doesn't seem there's any way to specify the merge target. I am not prompted for it, even if using C-u as a prefix. vc.el says ;; - merge-branch () ;; ;; Merge another branch into the current one, prompting for a ;; location to merge from. ;; but in vc-hg.el that does not seem to be the behavior. This is probably a known problem, since the header on vc-hg.el has ;; - merge (file rev1 rev2) NEEDED This comment remains in the latest git revision. In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian System Description: Ubuntu 14.04.4 LTS Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Recent input: G M C-g # # SPC n e w SPC d a y RET d a t e ; SPC h g SPC h e a d s RET C-x v d RET C-x v m C-u C-x v m C-h c C-x v m C-h f v c - m e r g e RET C-x o ESC O B ESC O C ESC O C RET ESC [ 6 ~ ESC [ 5 ~ C-s v c - m e r g e C-s - b C-s C-s C-s C-s C-s C-g C-g ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O A ESC O C ESC O C ESC O C ESC O C ESC O C ESC O C ESC O C C-r v c - c a l l - b a c k e n d C-r C-r C-r C-r C-r RET C-r d e f u n SPC v c - c a l l C-s C-s C-s ESC < C-s v c - c a l l - b a c k e n d C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s C-s ESC < ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ C-x C-f v c - h g TAB RET C-s d e f u n SPC m e r DEL DEL DEL v c - m e r g e RET C-s m e r g e - b r ESC < ESC [ 6 ~ ESC [ 5 ~ ESC x r e p o r t - b u g RET Recent messages: uncompressing vc.el.gz...done Note: file is write protected Quit Mark saved where search started [2 times] Mark set Mark saved where search started Mark set uncompressing vc-hg.el.gz...done Note: file is write protected Mark saved where search started [2 times] Load-path shadows: /usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup Features: (shadow sort gnus-util mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils find-func vc-git vc-bzr vc-sccs vc-svn vc-cvs vc-rcs vc-dir ewoc vc vc-dispatcher help-mode misearch multi-isearch dired ediff-merg ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff server jka-compr info vc-hg ido ess-toolbar ess-mouse mouseme thingatpt browse-url ess-menu ess-swv ess-noweb ess-noweb-font-lock-mode ess-bugs-l essd-els ess-sas-d ess-sas-l ess-sas-a shell pcomplete ess-sta-d ess-sta-l cc-vars cc-defs make-regexp ess-sp6-d ess-sp3-d ess-julia ess-r-d compile ess-tracebug format-spec ess-roxy advice cl-lib advice-preload hideshow ess-help ess-developer ess-r-args eldoc help-fns ess-s-l ess ess-inf comint ansi-color ring ess-mode ess-noweb-mode ess-utils time-date ess-custom executable easymenu ess-compat ess-site emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2016-02-29 20:56 bug#22860: 24.3; hg merge not too functional Ross Boylan @ 2019-11-23 18:12 ` Andrii Kolomoiets 2019-11-23 18:34 ` Eli Zaretskii 0 siblings, 1 reply; 16+ messages in thread From: Andrii Kolomoiets @ 2019-11-23 18:12 UTC (permalink / raw) To: 22860 [-- Attachment #1: Type: text/plain, Size: 26 bytes --] Hi, See attached patch. [-- Attachment #2: 0001-vc-hg-prompt-for-branch-to-merge.patch --] [-- Type: application/octet-stream, Size: 2614 bytes --] From 52af9a5a85aadb305035139fab2a962abb4eead0 Mon Sep 17 00:00:00 2001 From: Andrii Kolomoiets <andreyk.mad@gmail.com> Date: Sat, 23 Nov 2019 18:43:47 +0200 Subject: [PATCH] vc-hg: prompt for branch to merge * lisp/vc/vc-hg.el (vc-hg-merge-branch): Prompt for branch to merge. (vc-hg-revision-table): Use branches and tags as competion candidates. * etc/NEWS Mention changes of vc-hg.el This fixes bug#22860 diff --git a/etc/NEWS b/etc/NEWS index ad349b1613..abd2c616bd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -933,6 +933,11 @@ values. The 'C-x v h' command now works in buffers that visit files controlled by Hg. +*** The Hg (Mercurial) back-end now prompt for branch to merge. + +*** The Hg (Mercurial) back-end now use tag and branch names instead of +revision numbers as completion candidates on reading revision. + +++ *** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions and compares their entire trees. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 17d38fa400..b6cb315c1b 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -564,7 +564,8 @@ vc-hg-expanded-log-entry (defun vc-hg-revision-table (files) (let ((default-directory (file-name-directory (car files)))) (with-temp-buffer - (vc-hg-command t nil files "log" "--template" "{rev} ") + (vc-hg-command t nil nil "branches" "-q") + (vc-hg-command t nil nil "tags" "-q") (split-string (buffer-substring-no-properties (point-min) (point-max)))))) @@ -1483,13 +1484,16 @@ vc-hg-push (vc-hg--pushpull "push" prompt nil (called-interactively-p 'interactive))) (defun vc-hg-merge-branch () - "Merge incoming changes into the current working directory. + "Prompts for branch and merge it into the current branch. This runs the command \"hg merge\"." (let* ((root (vc-hg-root default-directory)) (buffer (format "*vc-hg : %s*" (expand-file-name root))) ;; Disable pager. - (process-environment (cons "HGPLAIN=1" process-environment))) - (apply 'vc-do-async-command buffer root vc-hg-program '("--config" "ui.report_untrusted=0" "merge")) + (process-environment (cons "HGPLAIN=1" process-environment)) + (branch (vc-read-revision "Merge from branch: "))) + (apply 'vc-do-async-command buffer root vc-hg-program + (append '("--config" "ui.report_untrusted=0" "merge") + (unless (string= branch "") (list branch)))) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg))) (vc-set-async-update buffer))) -- 2.15.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-23 18:12 ` bug#22860: [PATCH] vc-hg: prompt for branch to merge Andrii Kolomoiets @ 2019-11-23 18:34 ` Eli Zaretskii 2019-11-23 18:46 ` Dmitry Gutov 2019-11-23 18:51 ` Andrii Kolomoiets 0 siblings, 2 replies; 16+ messages in thread From: Eli Zaretskii @ 2019-11-23 18:34 UTC (permalink / raw) To: Andrii Kolomoiets; +Cc: 22860 > From: Andrii Kolomoiets <andreyk.mad@gmail.com> > Date: Sat, 23 Nov 2019 20:12:27 +0200 > > See attached patch. Thanks. > +*** The Hg (Mercurial) back-end now use tag and branch names instead of > +revision numbers as completion candidates on reading revision. Why "instead of revision numbers"? it sounds like a backward incompatible change. Can't we use both revision numbers and branch/tag names? > (defun vc-hg-merge-branch () > - "Merge incoming changes into the current working directory. > + "Prompts for branch and merge it into the current branch. "Prompt", not "prompts", for consistency with how we word our doc strings for functions. ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-23 18:34 ` Eli Zaretskii @ 2019-11-23 18:46 ` Dmitry Gutov 2019-11-23 18:51 ` Eli Zaretskii 2019-11-23 18:51 ` Andrii Kolomoiets 1 sibling, 1 reply; 16+ messages in thread From: Dmitry Gutov @ 2019-11-23 18:46 UTC (permalink / raw) To: Eli Zaretskii, Andrii Kolomoiets; +Cc: 22860 On 23.11.2019 20:34, Eli Zaretskii wrote: >> +*** The Hg (Mercurial) back-end now use tag and branch names instead of >> +revision numbers as completion candidates on reading revision. > Why "instead of revision numbers"? it sounds like a backward > incompatible change. Can't we use both revision numbers and > branch/tag names? It's a good change. You could see it in the patch I send yesterday too. The user doesn't need completion for revisions, but they can still input them. And for a large repository, listing all revisions is hella slow. ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-23 18:46 ` Dmitry Gutov @ 2019-11-23 18:51 ` Eli Zaretskii 2019-11-23 18:53 ` Dmitry Gutov 0 siblings, 1 reply; 16+ messages in thread From: Eli Zaretskii @ 2019-11-23 18:51 UTC (permalink / raw) To: Dmitry Gutov; +Cc: 22860, andreyk.mad > Cc: 22860@debbugs.gnu.org > From: Dmitry Gutov <dgutov@yandex.ru> > Date: Sat, 23 Nov 2019 20:46:48 +0200 > > On 23.11.2019 20:34, Eli Zaretskii wrote: > >> +*** The Hg (Mercurial) back-end now use tag and branch names instead of > >> +revision numbers as completion candidates on reading revision. > > Why "instead of revision numbers"? it sounds like a backward > > incompatible change. Can't we use both revision numbers and > > branch/tag names? > > It's a good change. You could see it in the patch I send yesterday too. > > The user doesn't need completion for revisions, but they can still input > them. And for a large repository, listing all revisions is hella slow. Do we perhaps want an option to get back the old behavior? ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-23 18:51 ` Eli Zaretskii @ 2019-11-23 18:53 ` Dmitry Gutov 0 siblings, 0 replies; 16+ messages in thread From: Dmitry Gutov @ 2019-11-23 18:53 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 22860, andreyk.mad On 23.11.2019 20:51, Eli Zaretskii wrote: > Do we perhaps want an option to get back the old behavior? I don't think so. There's little point in completion for numbers. ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-23 18:34 ` Eli Zaretskii 2019-11-23 18:46 ` Dmitry Gutov @ 2019-11-23 18:51 ` Andrii Kolomoiets 2019-11-23 19:01 ` Eli Zaretskii 1 sibling, 1 reply; 16+ messages in thread From: Andrii Kolomoiets @ 2019-11-23 18:51 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 22860 [-- Attachment #1: Type: text/plain, Size: 901 bytes --] On 23 Nov 2019, at 20:34, Eli Zaretskii <eliz@gnu.org> wrote: > >> +*** The Hg (Mercurial) back-end now use tag and branch names instead of >> +revision numbers as completion candidates on reading revision. > > Why "instead of revision numbers"? it sounds like a backward > incompatible change. Can't we use both revision numbers and > branch/tag names? You are right, it's backward incompatible. And yes, revision numbers can be used with branch/tag names. But they should not. It was big surprise for me to see numbers from 0 to 116K as completion candidates on vc-retrieve-tag. IMO revision numbers are useles in completions. >> (defun vc-hg-merge-branch () >> - "Merge incoming changes into the current working directory. >> + "Prompts for branch and merge it into the current branch. > > "Prompt", not "prompts", for consistency with how we word our doc > strings for functions. Fixed. [-- Attachment #2: 0001-vc-hg-prompt-for-branch-to-merge.patch --] [-- Type: application/octet-stream, Size: 2613 bytes --] From 52af9a5a85aadb305035139fab2a962abb4eead0 Mon Sep 17 00:00:00 2001 From: Andrii Kolomoiets <andreyk.mad@gmail.com> Date: Sat, 23 Nov 2019 18:43:47 +0200 Subject: [PATCH] vc-hg: prompt for branch to merge * lisp/vc/vc-hg.el (vc-hg-merge-branch): Prompt for branch to merge. (vc-hg-revision-table): Use branches and tags as competion candidates. * etc/NEWS Mention changes of vc-hg.el This fixes bug#22860 diff --git a/etc/NEWS b/etc/NEWS index ad349b1613..abd2c616bd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -933,6 +933,11 @@ values. The 'C-x v h' command now works in buffers that visit files controlled by Hg. +*** The Hg (Mercurial) back-end now prompt for branch to merge. + +*** The Hg (Mercurial) back-end now use tag and branch names instead of +revision numbers as completion candidates on reading revision. + +++ *** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions and compares their entire trees. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 17d38fa400..b6cb315c1b 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -564,7 +564,8 @@ vc-hg-expanded-log-entry (defun vc-hg-revision-table (files) (let ((default-directory (file-name-directory (car files)))) (with-temp-buffer - (vc-hg-command t nil files "log" "--template" "{rev} ") + (vc-hg-command t nil nil "branches" "-q") + (vc-hg-command t nil nil "tags" "-q") (split-string (buffer-substring-no-properties (point-min) (point-max)))))) @@ -1483,12 +1484,15 @@ vc-hg-push (vc-hg--pushpull "push" prompt nil (called-interactively-p 'interactive))) (defun vc-hg-merge-branch () - "Merge incoming changes into the current working directory. + "Prompt for branch and merge it into the current branch. This runs the command \"hg merge\"." (let* ((root (vc-hg-root default-directory)) (buffer (format "*vc-hg : %s*" (expand-file-name root))) ;; Disable pager. - (process-environment (cons "HGPLAIN=1" process-environment))) - (apply 'vc-do-async-command buffer root vc-hg-program '("--config" "ui.report_untrusted=0" "merge")) + (process-environment (cons "HGPLAIN=1" process-environment)) + (branch (vc-read-revision "Merge from branch: "))) + (apply 'vc-do-async-command buffer root vc-hg-program + (append '("--config" "ui.report_untrusted=0" "merge") + (unless (string= branch "") (list branch)))) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg))) (vc-set-async-update buffer))) -- 2.15.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-23 18:51 ` Andrii Kolomoiets @ 2019-11-23 19:01 ` Eli Zaretskii 2019-11-23 20:15 ` Andrii Kolomoiets 0 siblings, 1 reply; 16+ messages in thread From: Eli Zaretskii @ 2019-11-23 19:01 UTC (permalink / raw) To: Andrii Kolomoiets; +Cc: 22860 > From: Andrii Kolomoiets <andreyk.mad@gmail.com> > Date: Sat, 23 Nov 2019 20:51:28 +0200 > Cc: 22860@debbugs.gnu.org > > +*** The Hg (Mercurial) back-end now prompt for branch to merge. ^^^^^^ "Prompts" is more correct English. Also, I'm guessing this is about the "C-x v m" command, not in general? The NEWS item should say so. And finally, "C-x v m" is described in the user manual, but it only talks about Git and Bazaar; I thin we should mention Mercurial there as well. ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-23 19:01 ` Eli Zaretskii @ 2019-11-23 20:15 ` Andrii Kolomoiets 2019-11-25 14:41 ` Dmitry Gutov 0 siblings, 1 reply; 16+ messages in thread From: Andrii Kolomoiets @ 2019-11-23 20:15 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 22860 [-- Attachment #1: Type: text/plain, Size: 614 bytes --] On 23 Nov 2019, at 21:01, Eli Zaretskii <eliz@gnu.org> wrote: > >> From: Andrii Kolomoiets <andreyk.mad@gmail.com> >> Date: Sat, 23 Nov 2019 20:51:28 +0200 >> Cc: 22860@debbugs.gnu.org >> >> +*** The Hg (Mercurial) back-end now prompt for branch to merge. > ^^^^^^ > "Prompts" is more correct English. > > Also, I'm guessing this is about the "C-x v m" command, not in > general? The NEWS item should say so. > > And finally, "C-x v m" is described in the user manual, but it only > talks about Git and Bazaar; I thin we should mention Mercurial there > as well. Done. [-- Attachment #2: 0001-vc-hg-prompt-for-branch-to-merge.patch --] [-- Type: application/octet-stream, Size: 4277 bytes --] From 7fe0f7cb6cd15dfb307601eb126f1b1b72b073bd Mon Sep 17 00:00:00 2001 From: Andrii Kolomoiets <andreyk.mad@gmail.com> Date: Sat, 23 Nov 2019 18:43:47 +0200 Subject: [PATCH] vc-hg: prompt for branch to merge * lisp/vc/vc-hg.el (vc-hg-merge-branch): Prompt for branch to merge. (vc-hg-revision-table): Use branches and tags as competion candidates. * etc/NEWS Mention changes of vc-hg.el * doc/emacs/maintaining.texi (Switching Branches): Mention 'hg update' command. (Merging): Mention 'hg merge' command. This fixes bug#22860 diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 33a1ec0be0..6e25461507 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1427,7 +1427,9 @@ Switching Branches working tree to match the branch you switch to. Bazaar also supports co-located branches, in which case the @command{bzr switch} command will switch branches in the current directory. With Subversion, you -switch to another branch using the @command{svn switch} command. +switch to another branch using the @command{svn switch} command. On +Mercurial, command @command{hg update} is used to swith to another +branch. The VC command to switch to another branch in the current directory is @kbd{C-x v r @var{branch-name} @key{RET}} (@code{vc-retrieve-tag}). @@ -1542,8 +1544,9 @@ Merging the exact arguments to pass to @command{bzr merge}, offering a sensible default if possible. On Git, this prompts for the name of a branch to merge from, with completion (based on the branch names known -to the current repository). The output from running the merge command -is shown in a separate buffer. +to the current repository). On Mercurial, this prompts for argument to +pass to @command{hg merge}, with branch and tag names completion. The +output from running the merge command is shown in a separate buffer. On a centralized version control system like CVS, @kbd{C-x v m} prompts for a branch ID, or a pair of revision IDs (@pxref{Switching diff --git a/etc/NEWS b/etc/NEWS index ad349b1613..462b0ef6a2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -933,6 +933,12 @@ values. The 'C-x v h' command now works in buffers that visit files controlled by Hg. +*** The Hg (Mercurial) back-end now prompts for revision to merge on +'C-x v m' ('vc-merge'). + +*** The Hg (Mercurial) back-end now use tag and branch names instead of +revision numbers as completion candidates on reading revision. + +++ *** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions and compares their entire trees. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 17d38fa400..3a52e699ec 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -564,7 +564,8 @@ vc-hg-expanded-log-entry (defun vc-hg-revision-table (files) (let ((default-directory (file-name-directory (car files)))) (with-temp-buffer - (vc-hg-command t nil files "log" "--template" "{rev} ") + (vc-hg-command t nil nil "branches" "-q") + (vc-hg-command t nil nil "tags" "-q") (split-string (buffer-substring-no-properties (point-min) (point-max)))))) @@ -1483,13 +1484,16 @@ vc-hg-push (vc-hg--pushpull "push" prompt nil (called-interactively-p 'interactive))) (defun vc-hg-merge-branch () - "Merge incoming changes into the current working directory. + "Prompt for revision and merge it into working directory. This runs the command \"hg merge\"." (let* ((root (vc-hg-root default-directory)) (buffer (format "*vc-hg : %s*" (expand-file-name root))) ;; Disable pager. - (process-environment (cons "HGPLAIN=1" process-environment))) - (apply 'vc-do-async-command buffer root vc-hg-program '("--config" "ui.report_untrusted=0" "merge")) + (process-environment (cons "HGPLAIN=1" process-environment)) + (branch (vc-read-revision "Merge from branch: "))) + (apply 'vc-do-async-command buffer root vc-hg-program + (append '("--config" "ui.report_untrusted=0" "merge") + (unless (string= branch "") (list branch)))) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg))) (vc-set-async-update buffer))) -- 2.15.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-23 20:15 ` Andrii Kolomoiets @ 2019-11-25 14:41 ` Dmitry Gutov 2019-11-25 21:55 ` Andrii Kolomoiets 0 siblings, 1 reply; 16+ messages in thread From: Dmitry Gutov @ 2019-11-25 14:41 UTC (permalink / raw) To: Andrii Kolomoiets, Eli Zaretskii; +Cc: 22860 Hi Andrii, The patch looks good to me. Some minor nits: On 23.11.2019 22:15, Andrii Kolomoiets wrote: > * etc/NEWS Mention changes of vc-hg.el It's missing a colon after "NEWS" (":"). > +to the current repository). On Mercurial, this prompts for argument to > +pass to @command{hg merge}, with branch and tag names completion. The > +output from running the merge command is shown in a separate buffer. The fact that there is completion here is incidental. I'd omit that from this particular place in the manual. > +*** The Hg (Mercurial) back-end now prompts for revision to merge on > +'C-x v m' ('vc-merge'). Branch or revision? I understand that in practice the difference is minimal, but we should pick one or the other wording and use it consistently. Here, in the functions' docstrings, and in the prompt string as well. I'd prefer "branch" since it's usually what someone merges, but saying "revision" everywhere should also be okay. ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-25 14:41 ` Dmitry Gutov @ 2019-11-25 21:55 ` Andrii Kolomoiets 2019-11-25 22:57 ` Dmitry Gutov 2019-11-26 18:16 ` Eli Zaretskii 0 siblings, 2 replies; 16+ messages in thread From: Andrii Kolomoiets @ 2019-11-25 21:55 UTC (permalink / raw) To: Dmitry Gutov; +Cc: 22860 [-- Attachment #1: Type: text/plain, Size: 1584 bytes --] On 25 Nov 2019, at 16:41, Dmitry Gutov <dgutov@yandex.ru> wrote: > > Hi Andrii, Hi Dmitry, > On 23.11.2019 22:15, Andrii Kolomoiets wrote: >> * etc/NEWS Mention changes of vc-hg.el > > It's missing a colon after "NEWS" (":"). Fixed. >> +to the current repository). On Mercurial, this prompts for argument to >> +pass to @command{hg merge}, with branch and tag names completion. The >> +output from running the merge command is shown in a separate buffer. > > The fact that there is completion here is incidental. I'd omit that from this particular place in the manual. Fixed. In my defense, that sentence was modelled after git's one :) >> +*** The Hg (Mercurial) back-end now prompts for revision to merge on >> +'C-x v m' ('vc-merge'). > > Branch or revision? I understand that in practice the difference is minimal, but we should pick one or the other wording and use it consistently. Here, in the functions' docstrings, and in the prompt string as well. > > I'd prefer "branch" since it's usually what someone merges, but saying "revision" everywhere should also be okay. Initially it was "branch". But vc-hg doesn't work with branches at the moment. Even vc-create-tag creates bookmark instead of branch, see bug#17586 (but let's leave it to the future patches). Besides that, "revision" is used in the "merge" command manual. "revision" can mean a lot of things, see "hg help revisions". Thats why I decide to replace "branch" with "revision". Please see attached patch. Besides fixes, "bookmarks" added to completion candidates. [-- Attachment #2: 0001-vc-hg-prompt-for-branch-to-merge.patch --] [-- Type: application/octet-stream, Size: 4313 bytes --] From cf764cbe233eb162e3afa9d3f25acc96875e3f8e Mon Sep 17 00:00:00 2001 From: Andrii Kolomoiets <andreyk.mad@gmail.com> Date: Sat, 23 Nov 2019 18:43:47 +0200 Subject: [PATCH] vc-hg: prompt for branch to merge * lisp/vc/vc-hg.el (vc-hg-merge-branch): Prompt for revision to merge. (vc-hg-revision-table): Use branches, tags and bookmarks as competion candidates. * etc/NEWS: Mention changes of vc-hg.el * doc/emacs/maintaining.texi (Switching Branches): Mention 'hg update' command. (Merging): Mention 'hg merge' command. This fixes bug#22860 diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 33a1ec0be0..67072b5e92 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1427,7 +1427,9 @@ Switching Branches working tree to match the branch you switch to. Bazaar also supports co-located branches, in which case the @command{bzr switch} command will switch branches in the current directory. With Subversion, you -switch to another branch using the @command{svn switch} command. +switch to another branch using the @command{svn switch} command. On +Mercurial, command @command{hg update} is used to swith to another +branch. The VC command to switch to another branch in the current directory is @kbd{C-x v r @var{branch-name} @key{RET}} (@code{vc-retrieve-tag}). @@ -1542,8 +1544,9 @@ Merging the exact arguments to pass to @command{bzr merge}, offering a sensible default if possible. On Git, this prompts for the name of a branch to merge from, with completion (based on the branch names known -to the current repository). The output from running the merge command -is shown in a separate buffer. +to the current repository). On Mercurial, this prompts for argument to +pass to @command{hg merge}. The output from running the merge command is +shown in a separate buffer. On a centralized version control system like CVS, @kbd{C-x v m} prompts for a branch ID, or a pair of revision IDs (@pxref{Switching diff --git a/etc/NEWS b/etc/NEWS index ad349b1613..4a718e1357 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -933,6 +933,12 @@ values. The 'C-x v h' command now works in buffers that visit files controlled by Hg. +*** The Hg (Mercurial) back-end now prompts for revision to merge on +'C-x v m' ('vc-merge'). + +*** The Hg (Mercurial) back-end now use tags, branches and bookmarks +instead of revision numbers as completion candidates on reading revision. + +++ *** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions and compares their entire trees. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 17d38fa400..4d45ea1ccc 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -564,7 +564,9 @@ vc-hg-expanded-log-entry (defun vc-hg-revision-table (files) (let ((default-directory (file-name-directory (car files)))) (with-temp-buffer - (vc-hg-command t nil files "log" "--template" "{rev} ") + (vc-hg-command t nil nil "branches" "-q") + (vc-hg-command t nil nil "bookmarks" "-q") + (vc-hg-command t nil nil "tags" "-q") (split-string (buffer-substring-no-properties (point-min) (point-max)))))) @@ -1483,13 +1485,16 @@ vc-hg-push (vc-hg--pushpull "push" prompt nil (called-interactively-p 'interactive))) (defun vc-hg-merge-branch () - "Merge incoming changes into the current working directory. + "Prompt for revision and merge it into working directory. This runs the command \"hg merge\"." (let* ((root (vc-hg-root default-directory)) (buffer (format "*vc-hg : %s*" (expand-file-name root))) ;; Disable pager. - (process-environment (cons "HGPLAIN=1" process-environment))) - (apply 'vc-do-async-command buffer root vc-hg-program '("--config" "ui.report_untrusted=0" "merge")) + (process-environment (cons "HGPLAIN=1" process-environment)) + (branch (vc-read-revision "Revision to merge: "))) + (apply 'vc-do-async-command buffer root vc-hg-program + (append '("--config" "ui.report_untrusted=0" "merge") + (unless (string= branch "") (list branch)))) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg))) (vc-set-async-update buffer))) -- 2.15.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-25 21:55 ` Andrii Kolomoiets @ 2019-11-25 22:57 ` Dmitry Gutov 2019-11-26 18:19 ` Eli Zaretskii 2019-11-26 18:16 ` Eli Zaretskii 1 sibling, 1 reply; 16+ messages in thread From: Dmitry Gutov @ 2019-11-25 22:57 UTC (permalink / raw) To: Andrii Kolomoiets; +Cc: 22860 On 25.11.2019 23:55, Andrii Kolomoiets wrote: >> It's missing a colon after "NEWS" (":"). > > Fixed. Thank you. >>> +to the current repository). On Mercurial, this prompts for argument to >>> +pass to @command{hg merge}, with branch and tag names completion. The >>> +output from running the merge command is shown in a separate buffer. >> >> The fact that there is completion here is incidental. I'd omit that from this particular place in the manual. > > Fixed. In my defense, that sentence was modelled after git's one :) In that case, my opinion might conflict with Eli's (sorry). So I'll leave the final review to him. >>> +*** The Hg (Mercurial) back-end now prompts for revision to merge on >>> +'C-x v m' ('vc-merge'). >> >> Branch or revision? I understand that in practice the difference is minimal, but we should pick one or the other wording and use it consistently. Here, in the functions' docstrings, and in the prompt string as well. >> >> I'd prefer "branch" since it's usually what someone merges, but saying "revision" everywhere should also be okay. > > Initially it was "branch". But vc-hg doesn't work with branches at the moment. Even vc-create-tag creates bookmark instead of branch, see bug#17586 (but let's leave it to the future patches). Sure. It really creates (if branchp "bookmark" "tag"), but I'm not clear on the difference between branches and bookmarks in Mercurial anyway. > Besides that, "revision" is used in the "merge" command manual. "revision" can mean a lot of things, see "hg help revisions". Thats why I decide to replace "branch" with "revision". Ok, thank you. I think that "meaning lots of things" can correspond to Git's notion of "ref". ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-25 22:57 ` Dmitry Gutov @ 2019-11-26 18:19 ` Eli Zaretskii 0 siblings, 0 replies; 16+ messages in thread From: Eli Zaretskii @ 2019-11-26 18:19 UTC (permalink / raw) To: Dmitry Gutov; +Cc: 22860, andreyk.mad > From: Dmitry Gutov <dgutov@yandex.ru> > Date: Tue, 26 Nov 2019 00:57:59 +0200 > Cc: 22860@debbugs.gnu.org > > >>> +to the current repository). On Mercurial, this prompts for argument to > >>> +pass to @command{hg merge}, with branch and tag names completion. The > >>> +output from running the merge command is shown in a separate buffer. > >> > >> The fact that there is completion here is incidental. I'd omit that from this particular place in the manual. > > > > Fixed. In my defense, that sentence was modelled after git's one :) > > In that case, my opinion might conflict with Eli's (sorry). So I'll > leave the final review to him. If it's important to mention completion, we should do that for all back-ends that support this command. Right now, the text mentions the default offered by the prompt for Bazaar, but with Git and Mercurial it mentions completion. Don't the latter two offer sensible defaults as well? If they do, let's mention them; if they don't, perhaps its better to say something like Git and Mercurial don't offer a default revision, but they provide completion to help you specify the revision. ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-25 21:55 ` Andrii Kolomoiets 2019-11-25 22:57 ` Dmitry Gutov @ 2019-11-26 18:16 ` Eli Zaretskii 2019-11-26 19:28 ` Andrii Kolomoiets 1 sibling, 1 reply; 16+ messages in thread From: Eli Zaretskii @ 2019-11-26 18:16 UTC (permalink / raw) To: Andrii Kolomoiets; +Cc: 22860, dgutov > From: Andrii Kolomoiets <andreyk.mad@gmail.com> > Date: Mon, 25 Nov 2019 23:55:16 +0200 > Cc: Eli Zaretskii <eliz@gnu.org>, > 22860@debbugs.gnu.org > > --- a/doc/emacs/maintaining.texi > +++ b/doc/emacs/maintaining.texi > @@ -1427,7 +1427,9 @@ Switching Branches > working tree to match the branch you switch to. Bazaar also supports > co-located branches, in which case the @command{bzr switch} command > will switch branches in the current directory. With Subversion, you > -switch to another branch using the @command{svn switch} command. > +switch to another branch using the @command{svn switch} command. On > +Mercurial, command @command{hg update} is used to swith to another > +branch. I suggest "with Mercurial", not "on Mercurial". > @@ -1542,8 +1544,9 @@ Merging > the exact arguments to pass to @command{bzr merge}, offering a > sensible default if possible. On Git, this prompts for the name of a > branch to merge from, with completion (based on the branch names known > -to the current repository). The output from running the merge command > -is shown in a separate buffer. > +to the current repository). On Mercurial, this prompts for argument to Likewise here. (Yes, the Git sentence is also wrong.) > +pass to @command{hg merge}. The output from running the merge command is ^^ Two spaces between sentences, please. > +*** The Hg (Mercurial) back-end now prompts for revision to merge on > +'C-x v m' ('vc-merge'). ^^ ^^^^^^^^ "when you invoke 'C-x v m'" > +*** The Hg (Mercurial) back-end now use tags, branches and bookmarks > +instead of revision numbers as completion candidates on reading revision. ^^^^^^^^^^^^^^^^^^^ "when it prompts for a revision" Thanks. ^ permalink raw reply [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-26 18:16 ` Eli Zaretskii @ 2019-11-26 19:28 ` Andrii Kolomoiets 2019-11-30 12:02 ` Eli Zaretskii 0 siblings, 1 reply; 16+ messages in thread From: Andrii Kolomoiets @ 2019-11-26 19:28 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 22860, Dmitry Gutov [-- Attachment #1: Type: text/plain, Size: 279 bytes --] On 26 Nov 2019, at 20:16, Eli Zaretskii <eliz@gnu.org> wrote: > > I suggest "with Mercurial", not "on Mercurial". > > Two spaces between sentences, please. > > "when you invoke 'C-x v m'" > > "when it prompts for a revision" All issues are fixed. Please see updated patch. [-- Attachment #2: 0001-vc-hg-prompt-for-branch-to-merge.patch --] [-- Type: application/octet-stream, Size: 4549 bytes --] From 50c9bb40f1fb859cded12eaccf56835f3a90eea3 Mon Sep 17 00:00:00 2001 From: Andrii Kolomoiets <andreyk.mad@gmail.com> Date: Sat, 23 Nov 2019 18:43:47 +0200 Subject: [PATCH] vc-hg: prompt for branch to merge * lisp/vc/vc-hg.el (vc-hg-merge-branch): Prompt for revision to merge. (vc-hg-revision-table): Use branches, tags and bookmarks as competion candidates. * etc/NEWS: Mention changes of vc-hg.el * doc/emacs/maintaining.texi (Switching Branches): Mention 'hg update' command. (Merging): Mention 'hg merge' command. This fixes bug#22860 --- doc/emacs/maintaining.texi | 9 ++++++--- etc/NEWS | 9 +++++++++ lisp/vc/vc-hg.el | 13 +++++++++---- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 33a1ec0be0..f48173ae91 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1427,7 +1427,9 @@ Switching Branches working tree to match the branch you switch to. Bazaar also supports co-located branches, in which case the @command{bzr switch} command will switch branches in the current directory. With Subversion, you -switch to another branch using the @command{svn switch} command. +switch to another branch using the @command{svn switch} command. With +Mercurial, command @command{hg update} is used to swith to another +branch. The VC command to switch to another branch in the current directory is @kbd{C-x v r @var{branch-name} @key{RET}} (@code{vc-retrieve-tag}). @@ -1542,8 +1544,9 @@ Merging the exact arguments to pass to @command{bzr merge}, offering a sensible default if possible. On Git, this prompts for the name of a branch to merge from, with completion (based on the branch names known -to the current repository). The output from running the merge command -is shown in a separate buffer. +to the current repository). With Mercurial, this prompts for argument +to pass to @command{hg merge}. The output from running the merge +command is shown in a separate buffer. On a centralized version control system like CVS, @kbd{C-x v m} prompts for a branch ID, or a pair of revision IDs (@pxref{Switching diff --git a/etc/NEWS b/etc/NEWS index ad349b1613..bb5c54dabe 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -933,6 +933,15 @@ values. The 'C-x v h' command now works in buffers that visit files controlled by Hg. ++++ +*** The Hg (Mercurial) back-end now prompts for revision to merge when +you invoke 'C-x v m' ('vc-merge'). + +--- +*** The Hg (Mercurial) back-end now use tags, branches and bookmarks +instead of revision numbers as completion candidates when it prompts +for a revision. + +++ *** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions and compares their entire trees. diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 17d38fa400..4d45ea1ccc 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -564,7 +564,9 @@ vc-hg-expanded-log-entry (defun vc-hg-revision-table (files) (let ((default-directory (file-name-directory (car files)))) (with-temp-buffer - (vc-hg-command t nil files "log" "--template" "{rev} ") + (vc-hg-command t nil nil "branches" "-q") + (vc-hg-command t nil nil "bookmarks" "-q") + (vc-hg-command t nil nil "tags" "-q") (split-string (buffer-substring-no-properties (point-min) (point-max)))))) @@ -1483,13 +1485,16 @@ vc-hg-push (vc-hg--pushpull "push" prompt nil (called-interactively-p 'interactive))) (defun vc-hg-merge-branch () - "Merge incoming changes into the current working directory. + "Prompt for revision and merge it into working directory. This runs the command \"hg merge\"." (let* ((root (vc-hg-root default-directory)) (buffer (format "*vc-hg : %s*" (expand-file-name root))) ;; Disable pager. - (process-environment (cons "HGPLAIN=1" process-environment))) - (apply 'vc-do-async-command buffer root vc-hg-program '("--config" "ui.report_untrusted=0" "merge")) + (process-environment (cons "HGPLAIN=1" process-environment)) + (branch (vc-read-revision "Revision to merge: "))) + (apply 'vc-do-async-command buffer root vc-hg-program + (append '("--config" "ui.report_untrusted=0" "merge") + (unless (string= branch "") (list branch)))) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'hg))) (vc-set-async-update buffer))) -- 2.15.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* bug#22860: [PATCH] vc-hg: prompt for branch to merge 2019-11-26 19:28 ` Andrii Kolomoiets @ 2019-11-30 12:02 ` Eli Zaretskii 0 siblings, 0 replies; 16+ messages in thread From: Eli Zaretskii @ 2019-11-30 12:02 UTC (permalink / raw) To: Andrii Kolomoiets; +Cc: 22860-done, dgutov > From: Andrii Kolomoiets <andreyk.mad@gmail.com> > Date: Tue, 26 Nov 2019 21:28:41 +0200 > Cc: Dmitry Gutov <dgutov@yandex.ru>, > 22860@debbugs.gnu.org > > All issues are fixed. Please see updated patch. Thanks, installed. ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2019-11-30 12:02 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-02-29 20:56 bug#22860: 24.3; hg merge not too functional Ross Boylan 2019-11-23 18:12 ` bug#22860: [PATCH] vc-hg: prompt for branch to merge Andrii Kolomoiets 2019-11-23 18:34 ` Eli Zaretskii 2019-11-23 18:46 ` Dmitry Gutov 2019-11-23 18:51 ` Eli Zaretskii 2019-11-23 18:53 ` Dmitry Gutov 2019-11-23 18:51 ` Andrii Kolomoiets 2019-11-23 19:01 ` Eli Zaretskii 2019-11-23 20:15 ` Andrii Kolomoiets 2019-11-25 14:41 ` Dmitry Gutov 2019-11-25 21:55 ` Andrii Kolomoiets 2019-11-25 22:57 ` Dmitry Gutov 2019-11-26 18:19 ` Eli Zaretskii 2019-11-26 18:16 ` Eli Zaretskii 2019-11-26 19:28 ` Andrii Kolomoiets 2019-11-30 12:02 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).