From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Colin S. Miller" Newsgroups: gmane.emacs.help Subject: Re: Committing only specific hunks in VC Date: Wed, 12 Jan 2011 21:06:20 +0000 Organization: SunSITE.dk - Supporting Open source Message-ID: <4d2e17cd$0$23755$14726298@news.sunsite.dk> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1294872527 15722 80.91.229.12 (12 Jan 2011 22:48:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 12 Jan 2011 22:48:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 12 23:48:44 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pd9Uh-0002Y3-Cs for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Jan 2011 23:48:43 +0100 Original-Received: from localhost ([127.0.0.1]:55523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pd9Ug-0006He-RX for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Jan 2011 17:48:42 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 27 Original-NNTP-Posting-Host: 62.56.70.212 Original-X-Trace: news.sunsite.dk DXC=8EDn9cDW9hE1F[; SJ[; K0EYSB=nbEKnkKOoZn^kHoPeHG1[Bg<0aH5@\VT\m5_SIbFU_42Df:PaKHTcL2h5ahoTOkF_>m>CYcVO6FGchXCha7G018PZgQ4ieB1SI Original-X-Complaints-To: staff@sunsite.dk Original-Xref: usenet.stanford.edu gnu.emacs.help:184241 X-Mailman-Approved-At: Wed, 12 Jan 2011 17:47:56 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78416 Archived-At: Oleksandr Gavenko wrote: > On 11.01.2011 7:40, Deniz Dogan wrote: >> I have a bunch of files that have been modified and I'd like to commit >> all of these changes except for one hunk in one of the files. >> >> How would I do this from Emacs? I've heard that it's possible to stage >> only specific hunks in magit, but I'm using Mercurial. >> > I usually save common patch in '.diff' like file. > I'd do something similar, when I need to do this in CVS. I copy the entire tree, and then on the copy use # M-x cvs-mode and 'd e' to locate the changes I want to remove. Then I commit from this tree, and afterwards update the original tree. Patch normally makes a good job of figuring out what to do, unless one of the non-commited hunks is right beside a commited hunk, in which case I'd normally delete the original hunk in the conflict and use 'd e' to decide what parts of the modified hunk to keep. HTH, Colin S. Miller -- Replace the obvious in my email address with the first three letters of the hostname to reply.