From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jpkotta Newsgroups: gmane.emacs.help Subject: Re: Committing only specific hunks in VC Date: Fri, 18 Feb 2011 11:08:44 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <4d2e17cd$0$23755$14726298@news.sunsite.dk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1298155578 29503 80.91.229.12 (19 Feb 2011 22:46:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 Feb 2011 22:46:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 19 23:46:11 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 1PqvZ2-00054K-BL for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Feb 2011 23:46:08 +0100 Original-Received: from localhost ([127.0.0.1]:41852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqvZ1-0006M8-PL for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Feb 2011 17:46:07 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!q7g2000vbd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 64.122.85.37 Original-X-Trace: posting.google.com 1298056246 13219 127.0.0.1 (18 Feb 2011 19:10:46 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 18 Feb 2011 19:10:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q7g2000vbd.googlegroups.com; posting-host=64.122.85.37; posting-account=EwI0QQoAAADdqmqX_mVfawBNtwyks2YE User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.7.62 Version/11.01,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:185050 X-Mailman-Approved-At: Sat, 19 Feb 2011 17:41:46 -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:79240 Archived-At: On Jan 12, 3:06=A0pm, "Colin S. Miller" wrote: > 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 t= he hostname to reply. Sorry this is very late, I stopped reading these lists for a while. I've been using a tool called commit-patch. It's supposed to work with just about any SCM, but I use it with Mercurial. It comes with an elisp file to make it work with vc-mode. The only trouble I have with it is if you try to edit the patch in a way that should still let it apply cleanly, it often complains and does nothing (but I've never had it corrupt a patch). It always works for me to selectively remove hunks from the patch. http://porkrind.org/commit-patch/ Before I used commit-patch, I used the Mercurial extension crecord.