From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: Committing only specific hunks in VC Date: Wed, 12 Jan 2011 11:40:04 +0200 Message-ID: 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 1294825287 28944 80.91.229.12 (12 Jan 2011 09:41:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 12 Jan 2011 09:41:27 +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 10:41:22 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 1PcxCj-0001Pr-Av for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Jan 2011 10:41:21 +0100 Original-Received: from localhost ([127.0.0.1]:54080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcxCi-0004nw-GT for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Jan 2011 04:41:20 -0500 Original-Received: from [140.186.70.92] (port=40213 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcxBe-0004nQ-Rd for help-gnu-emacs@gnu.org; Wed, 12 Jan 2011 04:40:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcxBe-0004Z5-1n for help-gnu-emacs@gnu.org; Wed, 12 Jan 2011 04:40:14 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:33314) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcxBd-0004Yx-RG for help-gnu-emacs@gnu.org; Wed, 12 Jan 2011 04:40:14 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PcxBb-0000oH-TF for help-gnu-emacs@gnu.org; Wed, 12 Jan 2011 10:40:11 +0100 Original-Received: from 91.193.68.214 ([91.193.68.214]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Jan 2011 10:40:11 +0100 Original-Received: from gavenko by 91.193.68.214 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Jan 2011 10:40:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 91.193.68.214 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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 X-Spam-Report: 5.4 points; * -0.0 SPF_PASS SPF: sender matches SPF record * 4.0 RCVD_NUMERIC_HELO Received: contains an IP address used for HELO * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] * 4.0 RCVD_IN_SBL RBL: Received via a relay in Spamhaus SBL * [91.193.68.214 listed in zen.spamhaus.org] Xref: news.gmane.org gmane.emacs.help:78406 Archived-At: 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. Then in diff-mode can revert patch (C-c C-r), then apply C-c C-a for hunks that don't like. After than commit and revert '.diff' again to apply reverted hunks. This allow don't depend on deep VCS knowledge and available/missing features. Also I practice storing 2 copy of source - working and original/clean. Applying parts of '.diff' to clean source tree, test, commit and then update working tree.