anti-dummy merge cherry pick from one commit of different branch

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

anti-dummy merge cherry pick from one commit of different branch

Uwe Brauer

Hi

I have the following workflow. Collaborator pushes to repo to his
branch.
I pull and merge to the default branch.

Then

    -  either there is no conflict.

    -  or if there is a conflict , a merging tool (in my case meld) pops
       up, indicating the conflict(s).


The question is this: Could I force to pop up a merging tool (again say
meld) which just would show me all the changes of the collaborator's
branch, so that I could cherry pick what I like?

Thanks

Uwe Brauer

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

hg record and merge does not work (was: anti-dummy merge cherry pick from one commit of different branch)

Uwe Brauer
>>> "Uwe" == Uwe Brauer <[hidden email]> writes:

   > Hi

   > The question is this: Could I force to pop up a merging tool (again say
   > meld) which just would show me all the changes of the collaborator's
   > branch, so that I could cherry pick what I like?


The following comes close to what I am looking for, alas it does not
work


hg init
echo Main1 > main.txt
hg add main.txt
hg commit -m "Main1"
echo Main2 >> main.txt
hg commit -m "Main2"
echo Main3 >> main.txt
hg commit -m "Main3"
hg branch feature
echo Feature1 >> main.txt
hg commit -m "Feature1"
echo Feature2 >> main.txt
hg commit -m "Feature2"
hg up default
hg merge
hg record
hg commit --interactively

Now I obtain
abort: cannot partially commit a merge (use "hg commit" instead)

The documentation states it is not possible. But is there a similar
command which would do this?

Uwe Brauer

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

patches, record almost (was: anti-dummy merge cherry pick from one commit of different branch)

Uwe Brauer
In reply to this post by Uwe Brauer
>>> "Uwe" == Uwe Brauer <[hidden email]> writes:
   > The question is this: Could I force to pop up a merging tool (again say
   > meld) which just would show me all the changes of the collaborator's
   > branch, so that I could cherry pick what I like?



So the following does almost what I want

hg init
echo Main1 > main.txt
hg add main.txt
hg commit -m "Main1"
echo Main2 >> main.txt
hg commit -m "Main2"
echo Main3 >> main.txt
hg commit -m "Main3"
hg branch feature
echo Feature1 >> main.txt
hg commit -m "Feature1"
echo Feature2 >> main.txt
hg commit -m "Feature2"
hg up default
hg diff -r default -r feature > mypatch.patch
patch < mypatch.patch
hg record

Now hg asks me whether I want all changes, I chose the edit option, emacs
pops up, I delete the Feature2 line, check main.txt does not contain the
Feature2 line, then emacs ask for a commit message and oops Feature2
line is in again.

What do I miss?

Thanks

Uwe Brauer

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

SOLVED (was: patches, record almost)

Uwe Brauer
>>> "Uwe" == Uwe Brauer <[hidden email]> writes:

>>> "Uwe" == Uwe Brauer <[hidden email]> writes:


    > So the following does almost what I want

    > hg init
    > echo Main1 > main.txt
    > hg add main.txt
    > hg commit -m "Main1"
    > echo Main2 >> main.txt
    > hg commit -m "Main2"
    > echo Main3 >> main.txt
    > hg commit -m "Main3"
    > hg branch feature
    > echo Feature1 >> main.txt
    > hg commit -m "Feature1"
    > echo Feature2 >> main.txt
    > hg commit -m "Feature2"
    > hg up default
    > hg diff -r default -r feature > mypatch.patch
    > patch < mypatch.patch
    > hg record

    > Now hg asks me whether I want all changes, I chose the edit option, emacs
    > pops up, I delete the Feature2 line, check main.txt does not contain the
    > Feature2 line, then emacs ask for a commit message and oops Feature2
    > line is in again.

    > What do I miss?

To answer my own question: I must run
hg shelve

And everything is fine.


_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial