From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andrii Kolomoiets Newsgroups: gmane.emacs.bugs Subject: bug#22860: [PATCH] vc-hg: prompt for branch to merge Date: Mon, 25 Nov 2019 23:55:16 +0200 Message-ID: References: <86wppnkzgq.fsf@ross-sas.epi-ucsf.org> <14D12E8F-EFDE-4C94-8C95-9440F56D3633@gmail.com> <83lfs6tpb1.fsf@gnu.org> <1C27CCD0-2335-4EE2-B815-3D85F4B84D85@gmail.com> <83ftieto20.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_71E7F6DC-1404-4129-AE51-4FC397CEED9C" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="238883"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 22860@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 25 22:56:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iZML4-000zzF-Tu for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Nov 2019 22:56:11 +0100 Original-Received: from localhost ([::1]:48604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZML3-0001Hb-LI for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Nov 2019 16:56:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35881) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZMKx-0001HI-Lr for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 16:56:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZMKw-0002JK-Lw for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 16:56:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43848) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iZMKw-0002JD-I6 for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 16:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iZMKw-00053R-Fy for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2019 16:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrii Kolomoiets Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Nov 2019 21:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22860 X-GNU-PR-Package: emacs Original-Received: via spool by 22860-submit@debbugs.gnu.org id=B22860.157471892719381 (code B ref 22860); Mon, 25 Nov 2019 21:56:02 +0000 Original-Received: (at 22860) by debbugs.gnu.org; 25 Nov 2019 21:55:27 +0000 Original-Received: from localhost ([127.0.0.1]:49820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZMKM-00052X-OR for submit@debbugs.gnu.org; Mon, 25 Nov 2019 16:55:27 -0500 Original-Received: from mail-wr1-f68.google.com ([209.85.221.68]:42745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZMKL-00052K-0i for 22860@debbugs.gnu.org; Mon, 25 Nov 2019 16:55:25 -0500 Original-Received: by mail-wr1-f68.google.com with SMTP id a15so20036245wrf.9 for <22860@debbugs.gnu.org>; Mon, 25 Nov 2019 13:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=7HPjbnwMGWRmrm1SiWr7SNvNhMTknCn5rq0/a8eq3Zo=; b=SWDPu1vnjcSkHlHsxKl0fxh5khnrKquTpGwUKw2RgtY+WKWu59eGWO9ODoh6RKQlzg brneS4BFN8eSpT98WY5tY7Qp3F8OXFEklIgW5eOtE+fHL8fJJaR72sowZk3SUDWynZxq bbHIQM/ts7H8FlHopeUml/VjxuRQf/OdflxEMbF2Lhnla2vG5Q1ghorvyec7B4nosJRJ cF24HEexNyY9zJATEb2EzqD0CrsKhViRYx92yHlF9xTUz2sog1cDP4Cje59VCplUcVDi I1mvDTrWVvt6t+3QX0AT86OmULHumxmc6lJffIZeSm/INNC+HgF2+X+8YLYVV2zKuhY0 ppMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=7HPjbnwMGWRmrm1SiWr7SNvNhMTknCn5rq0/a8eq3Zo=; b=tkWmQCg+kgaXAPVGmQrAP+BGIBHOJr85S9W3GxZBakRtKUnnfRdaDoEMYXfWeiR8h+ wz9aHUFZqRuiMu5281stJRPOZrrlID3dYLvLMSzCQJcpA26G1B3JGA4n48nfKbJo8LmB 43aNpznbHTrtpsjs9Z2shSmJk41+MciT0mKo3gtsJnTz16GLnb1AiSZNNuMbSiaN/sAr lIQf37vH3lbP2yE2jTRZrjxiQ17JbH1x5jeuZw3eJ470Vfz5nXHO6i3bPXV2ew5qrU1D GgaamygYs8qJuHvdJDk3DXm8UO0qfrCufSDz23bTxJntaLpxE14CNM85okZmtjPOwFFC 7sug== X-Gm-Message-State: APjAAAXx7hfoudIFzxjNrAD/SfNKLWXmgwJFDRAOOrqgwIdkIjoMVKvY oT/G2ljdk+mGaXVjmqUZs8I= X-Google-Smtp-Source: APXvYqzIYmVqXrCWqrZffm9k6RvqWaHBH/vildGXrqgvyVHJy/yC8AOWA9OAe0j/SIV73Grc/r22xA== X-Received: by 2002:adf:e911:: with SMTP id f17mr35313816wrm.300.1574718919010; Mon, 25 Nov 2019 13:55:19 -0800 (PST) Original-Received: from [192.168.0.104] ([91.206.110.132]) by smtp.gmail.com with ESMTPSA id 19sm14014360wrc.47.2019.11.25.13.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Nov 2019 13:55:18 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3601.0.10) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172392 Archived-At: --Apple-Mail=_71E7F6DC-1404-4129-AE51-4FC397CEED9C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 25 Nov 2019, at 16:41, Dmitry Gutov wrote: >=20 > Hi Andrii, Hi Dmitry, > On 23.11.2019 22:15, Andrii Kolomoiets wrote: >> * etc/NEWS Mention changes of vc-hg.el >=20 > 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. >=20 > 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'). >=20 > 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. >=20 > 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. --Apple-Mail=_71E7F6DC-1404-4129-AE51-4FC397CEED9C Content-Disposition: attachment; filename=0001-vc-hg-prompt-for-branch-to-merge.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-vc-hg-prompt-for-branch-to-merge.patch" Content-Transfer-Encoding: quoted-printable =46rom=20cf764cbe233eb162e3afa9d3f25acc96875e3f8e=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Andrii=20Kolomoiets=20=0A= Date:=20Sat,=2023=20Nov=202019=2018:43:47=20+0200=0ASubject:=20[PATCH]=20= vc-hg:=20prompt=20for=20branch=20to=20merge=0A=0A*=20lisp/vc/vc-hg.el=20= (vc-hg-merge-branch):=20Prompt=20for=20revision=20to=20merge.=0A= (vc-hg-revision-table):=20Use=20branches,=20tags=20and=20bookmarks=20as=20= competion=0Acandidates.=0A=0A*=20etc/NEWS:=20Mention=20changes=20of=20= vc-hg.el=0A=0A*=20doc/emacs/maintaining.texi=20(Switching=20Branches):=20= Mention=20'hg=20update'=0Acommand.=0A(Merging):=20Mention=20'hg=20merge'=20= command.=0A=0AThis=20fixes=20bug#22860=0A=0Adiff=20--git=20= a/doc/emacs/maintaining.texi=20b/doc/emacs/maintaining.texi=0Aindex=20= 33a1ec0be0..67072b5e92=20100644=0A---=20a/doc/emacs/maintaining.texi=0A= +++=20b/doc/emacs/maintaining.texi=0A@@=20-1427,7=20+1427,9=20@@=20= Switching=20Branches=0A=20working=20tree=20to=20match=20the=20branch=20= you=20switch=20to.=20=20Bazaar=20also=20supports=0A=20co-located=20= branches,=20in=20which=20case=20the=20@command{bzr=20switch}=20command=0A= =20will=20switch=20branches=20in=20the=20current=20directory.=20=20With=20= Subversion,=20you=0A-switch=20to=20another=20branch=20using=20the=20= @command{svn=20switch}=20command.=0A+switch=20to=20another=20branch=20= using=20the=20@command{svn=20switch}=20command.=20=20On=0A+Mercurial,=20= command=20@command{hg=20update}=20is=20used=20to=20swith=20to=20another=0A= +branch.=0A=20=0A=20=20=20The=20VC=20command=20to=20switch=20to=20= another=20branch=20in=20the=20current=20directory=0A=20is=20@kbd{C-x=20v=20= r=20@var{branch-name}=20@key{RET}}=20(@code{vc-retrieve-tag}).=0A@@=20= -1542,8=20+1544,9=20@@=20Merging=0A=20the=20exact=20arguments=20to=20= pass=20to=20@command{bzr=20merge},=20offering=20a=0A=20sensible=20= default=20if=20possible.=20=20On=20Git,=20this=20prompts=20for=20the=20= name=20of=20a=0A=20branch=20to=20merge=20from,=20with=20completion=20= (based=20on=20the=20branch=20names=20known=0A-to=20the=20current=20= repository).=20=20The=20output=20from=20running=20the=20merge=20command=0A= -is=20shown=20in=20a=20separate=20buffer.=0A+to=20the=20current=20= repository).=20=20On=20Mercurial,=20this=20prompts=20for=20argument=20to=0A= +pass=20to=20@command{hg=20merge}.=20The=20output=20from=20running=20the=20= merge=20command=20is=0A+shown=20in=20a=20separate=20buffer.=0A=20=0A=20=20= =20On=20a=20centralized=20version=20control=20system=20like=20CVS,=20= @kbd{C-x=20v=20m}=0A=20prompts=20for=20a=20branch=20ID,=20or=20a=20pair=20= of=20revision=20IDs=20(@pxref{Switching=0Adiff=20--git=20a/etc/NEWS=20= b/etc/NEWS=0Aindex=20ad349b1613..4a718e1357=20100644=0A---=20a/etc/NEWS=0A= +++=20b/etc/NEWS=0A@@=20-933,6=20+933,12=20@@=20values.=0A=20The=20'C-x=20= v=20h'=20command=20now=20works=20in=20buffers=20that=20visit=20files=20= controlled=0A=20by=20Hg.=0A=20=0A+***=20The=20Hg=20(Mercurial)=20= back-end=20now=20prompts=20for=20revision=20to=20merge=20on=0A+'C-x=20v=20= m'=20('vc-merge').=0A+=0A+***=20The=20Hg=20(Mercurial)=20back-end=20now=20= use=20tags,=20branches=20and=20bookmarks=0A+instead=20of=20revision=20= numbers=20as=20completion=20candidates=20on=20reading=20revision.=0A+=0A=20= +++=0A=20***=20'C-u=20C-x=20v=20D'=20('vc-root-version-diff')=20prompts=20= for=20two=20revisions=0A=20and=20compares=20their=20entire=20trees.=0A= diff=20--git=20a/lisp/vc/vc-hg.el=20b/lisp/vc/vc-hg.el=0Aindex=20= 17d38fa400..4d45ea1ccc=20100644=0A---=20a/lisp/vc/vc-hg.el=0A+++=20= b/lisp/vc/vc-hg.el=0A@@=20-564,7=20+564,9=20@@=20= vc-hg-expanded-log-entry=0A=20(defun=20vc-hg-revision-table=20(files)=0A=20= =20=20(let=20((default-directory=20(file-name-directory=20(car=20= files))))=0A=20=20=20=20=20(with-temp-buffer=0A-=20=20=20=20=20=20= (vc-hg-command=20t=20nil=20files=20"log"=20"--template"=20"{rev}=20")=0A= +=20=20=20=20=20=20(vc-hg-command=20t=20nil=20nil=20"branches"=20"-q")=0A= +=20=20=20=20=20=20(vc-hg-command=20t=20nil=20nil=20"bookmarks"=20"-q")=0A= +=20=20=20=20=20=20(vc-hg-command=20t=20nil=20nil=20"tags"=20"-q")=0A=20=20= =20=20=20=20=20(split-string=0A=20=20=20=20=20=20=20=20= (buffer-substring-no-properties=20(point-min)=20(point-max))))))=0A=20=0A= @@=20-1483,13=20+1485,16=20@@=20vc-hg-push=0A=20=20=20(vc-hg--pushpull=20= "push"=20prompt=20nil=20(called-interactively-p=20'interactive)))=0A=20=0A= =20(defun=20vc-hg-merge-branch=20()=0A-=20=20"Merge=20incoming=20changes=20= into=20the=20current=20working=20directory.=0A+=20=20"Prompt=20for=20= revision=20and=20merge=20it=20into=20working=20directory.=0A=20This=20= runs=20the=20command=20\"hg=20merge\"."=0A=20=20=20(let*=20((root=20= (vc-hg-root=20default-directory))=0A=20=09=20(buffer=20(format=20"*vc-hg=20= :=20%s*"=20(expand-file-name=20root)))=0A=20=20=20=20=20=20=20=20=20=20= ;;=20Disable=20pager.=0A-=20=20=20=20=20=20=20=20=20(process-environment=20= (cons=20"HGPLAIN=3D1"=20process-environment)))=0A-=20=20=20=20(apply=20= 'vc-do-async-command=20buffer=20root=20vc-hg-program=20'("--config"=20= "ui.report_untrusted=3D0"=20"merge"))=0A+=20=20=20=20=20=20=20=20=20= (process-environment=20(cons=20"HGPLAIN=3D1"=20process-environment))=0A+=20= =20=20=20=20=20=20=20=20(branch=20(vc-read-revision=20"Revision=20to=20= merge:=20")))=0A+=20=20=20=20(apply=20'vc-do-async-command=20buffer=20= root=20vc-hg-program=0A+=20=20=20=20=20=20=20=20=20=20=20(append=20= '("--config"=20"ui.report_untrusted=3D0"=20"merge")=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(unless=20(string=3D=20branch=20= "")=20(list=20branch))))=0A=20=20=20=20=20(with-current-buffer=20buffer=20= (vc-run-delayed=20(vc-compilation-mode=20'hg)))=0A=20=20=20=20=20= (vc-set-async-update=20buffer)))=0A=20=0A--=20=0A2.15.1=0A=0A= --Apple-Mail=_71E7F6DC-1404-4129-AE51-4FC397CEED9C--