how to push selected changes only?

Dave S snidely.too at gmail.com
Mon Jan 20 21:33:27 UTC 2014


On Sat, Jan 18, 2014 at 10:15 PM, Anton Shestakov <engored at gmail.com> wrote:

> 2014/1/19  <hamann.w at t-online.de>:
> > I have just upgraded my installation (which was too old to offer graft)
> and tried it, but
> > unfortunately no success.
> > The way I am trying is
> > cd orig-dir
> > hg graft -R ../clone-dir -r 13:14 -r 17:20
> > (I had to use the -R because it complained about unknown revisions in
> orig-dir)
> > Should I perhaps run the command from the clone-dir instead?
>
> As far as I understand, graft works only on one repository. Supplying
> -R will switch to that repository and ignore current working
> directory.
>
> Here's what you probably need to do: go to repository with your
> changes (or probably a clone of that to be safe), update it to the
> reference revision with "hg update REV", then do "hg graft -r 13:14 -r
> 17:20". Use --dry-run to see what will happen.
>
> This will create an unnamed branch with copies of 13:14 and 17:20 on
> top of your reference revision. They will have different revision
> numbers, but you'll be able to push them separately. That is because
> you created a fork in your repo's history (you can see it with
> graphlog extension). Later, if you need to push your other changes,
> you will have to merge those two branches. If that sounds complicated,
> read a guide to branches/branching in mercurial [1].
>
> This is not the most elegant way to separate changes, as it leaves
> original changes in place and creates an unnamed branch, but it's a
> non-destructive operation. When you feel comfortable with editing
> history, you might be better off with a destructive operation, such as
> one of the commands provided by mq extension.
>
> This question on SO [2] is similar to what you are suggested to do.
>
> [1]: http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/
> [2]:
> https://stackoverflow.com/questions/8467624/splitting-linear-history-into-two-branches-in-mercurial
>

Another option might be to use hg export and hg patch; if the size of the
changes to be transferred is small, then the manual aspects of this won't
be too bad.   The Mercurial developers use patchbombs to review changes
proposed for Mercurial itself.

/dps

-- 
test signature -- please apply at front gate on Tuesdays only.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20140120/f43bbe8f/attachment-0002.html>


More information about the Mercurial mailing list