From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?B?SvxyZ2VuIEEu?= Erhard Newsgroups: gmane.emacs.devel Subject: Re: vc-hg-rename-file does not expand the file name arguments Date: Fri, 28 Dec 2012 16:10:50 +0100 Organization: Lost Worlds Inc. (I keep dreaming) Message-ID: <20121228151050.GB2232@jaerhard.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1356707536 2920 80.91.229.3 (28 Dec 2012 15:12:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2012 15:12:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 28 16:12:32 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tobbo-0007KS-Ho for ged-emacs-devel@m.gmane.org; Fri, 28 Dec 2012 16:12:28 +0100 Original-Received: from localhost ([::1]:51105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TobbZ-0007Sj-Vr for ged-emacs-devel@m.gmane.org; Fri, 28 Dec 2012 10:12:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TobbV-0007Sc-Kf for emacs-devel@gnu.org; Fri, 28 Dec 2012 10:12:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TobbN-0002CF-Gr for emacs-devel@gnu.org; Fri, 28 Dec 2012 10:12:09 -0500 Original-Received: from dedicated.jaerhard.com ([80.82.209.27]:44603 helo=mx0.jaerhard.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TobbN-000296-Ac for emacs-devel@gnu.org; Fri, 28 Dec 2012 10:12:01 -0500 Original-Received: from [89.204.153.50] (helo=leno.internal.jaerhard.com) by mx0.jaerhard.com with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Tobal-0006Wx-T4 for emacs-devel@gnu.org; Fri, 28 Dec 2012 16:11:24 +0100 Original-Received: from debian64vm.internal.jaerhard.com ([10.1.0.5]) by leno.internal.jaerhard.com with esmtp (Exim 4.80) (envelope-from ) id 1TobaE-0001dG-D5 for emacs-devel@gnu.org; Fri, 28 Dec 2012 16:10:50 +0100 Original-Received: from jae by debian64vm.internal.jaerhard.com with local (Exim 4.80) (envelope-from ) id 1TobaE-0007PC-As; Fri, 28 Dec 2012 16:10:50 +0100 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 80.82.209.27 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:155961 Archived-At: On Tue, Jan 26, 2010 at 11:58:09AM +0800, Alex Harsanyi wrote: > I believe there is a problem with the implementation of > `vc-hg-rename-file`, in the call: (vc-hg-command nil 0 new "mv" old), > only the NEW parameter will be expanded using `expand-file-name`, > because `vc-hg-command` treats it as a file. The OLD parameter is not > expanded because it is treated as a flag. The problem is that > `vc-rename-file` will read a file name from he minibuffer and pass in > a filename like "~/Projects/test-repo/file1.txt" to the function. > This name is passed directly to the "hg" executable which will fail > because the file does not exist (hg does not do file-name expansion > internally). > > For example, create the following mercurial repository: > > $ mkdir ~/test-repo > $ cd ~/test-repo > $ hg init . > $ echo Hello > ./file1.txt > $ hg add file1.txt > $ hg commit -m "File1 added" > > Now, open file1.txt in Emacs, and try to rename it using "M-x > vc-rename-file". The rename will fail and the *vc* buffer will > contain: > > ~/test-repo/file1.txt: No such file or directory > abort: no files to copy > > I believe the simplest fix is to call `expand-file-name` on the file > names before passing them to the "hg" command. > > Based on the comment in the code, I think the same problem exists with > the bzr backend as well. Seems the bzr backend has been fixed. Since it's the main Emacs repo, that's not surprising. Bump to get a fix in. Grits, J PS: Sorry for that earlier direct reply, Alex.