HG extension "record" for partial commits

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

HG extension "record" for partial commits

Rik-4
jwe,

During Octconf 2018 we were talking about a methodology for doing partial
commits.  The use case is that one begins tackling a certain bug and makes
some code changes.  Along the way you notice a different bug, such as a
typo in the documentation of another function, which you also fix.  After
the code changes are complete you are ready to check in the changes for the
original bug, but the local repo contains modifications for both issues.

If the changes reside in different *files* then you can do 'hg ci
LIST_OF_BUG1_FILES' to check in the changes associated only with BUG1. 
However, if there are simultaneous changes in a single file then try 'hg
record'.  This will allow you to interactively choose, for each diff hunk,
which is recorded and which is not.

--Rik


Reply | Threaded
Open this post in threaded view
|

Re: HG extension "record" for partial commits

Mike Miller-4
On Thu, Mar 22, 2018 at 09:04:50 -0700, Rik wrote:
> If the changes reside in different *files* then you can do 'hg ci
> LIST_OF_BUG1_FILES' to check in the changes associated only with BUG1. 
> However, if there are simultaneous changes in a single file then try 'hg
> record'.  This will allow you to interactively choose, for each diff hunk,
> which is recorded and which is not.

I use the hg commit --interactive feature, available in Mercurial 3.8
and newer.

I *think* the "crecord" extension adds this feature to older versions of
Mercurial.

When I am working on multiple changes at once, hg commit -i gives a nice
curses tool for selecting and unselecting parts of diffs and committing
the result.

--
mike

signature.asc (849 bytes) Download Attachment