help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Committing only specific hunks in VC


From: jpkotta
Subject: Re: Committing only specific hunks in VC
Date: Fri, 18 Feb 2011 11:08:44 -0800 (PST)
User-agent: G2/1.0

On Jan 12, 3:06 pm, "Colin S. Miller" <no-spam-
thank-...@csmiller.demon.co.uk> 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 the 
> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]