Moving changesets between branches - mercurial

I have the following situation in my repositorium:
/ b1
----
\ b2
b1, b2 means branch1 and branch2 respectively.
I would like make some changes to branch and I would like to apply this changes to b2 as well. What is the best (and recommended way) to do it?

It depends, there's two ways:
1 Merge
You can merge one branch into the other. But that means basically carrying over all changes to the other branch. You might not want that.
2 Graft
More likely what you need: You simply copy the selected changesets from one branch to the other. Checkout the branch which is missing the changes and then graft them:
hg graft --rev XXX
You can give the revision argument several times.

Related

How to merge multiple steps into one undo / redo?

I use mxGraph to make an editor. When the user clicks a button once, I need to perform many steps in the graph (such as moving the position of some nodes, adding or deleting some nodes, and modifying the properties of some nodes).
Generally, I can use mxModel.setValue (), mxGraph.removeCells () to complete one operation, but the user needs to press ctrl + z multiple times to restore the original state of the graph.
How to merge any number of operations into one operation and restore the state of the entire graph with one undo / redo?
I don't know if this is what you are looking for, but if everything you do between one model.beginUpdate() and a model.endUpdate() belongs to the same "undo" action. By calling the mxUndoManager.undo once you should be able to undo all of them at once...

Revset filter to show merges / splits of named branches

I want to filter commits in TortoiseHg in such a way that only commits are shown that:
Have at least one parent commit in a different named branch; or
Have at least one child commit in different named branch; or
Are the original starting point (commit 0); or
Are the head of a named branch or closing commit of a named branch;
Basically: how can I get a condensed graph showing how named branches flow?
As an example, I want to condense this kind of revision graph:
Into a form where these are omitted:
Rev 15 (green)
Rev 14 (green)
Rev 13 (blue)
Rev 10 (blue)
Rev 7 (blue)
Rev 4 (red)
Rev 1 (blue)
I've tried using the concrete suggestion I got in this answer at SoftwareRecs:
children(branchpoint() or merge()) or parents(branchpoint() or merge())
However, that doesn't work as I want it to, it still includes several commits that don't have any details on branching, and cuts e.g. the default branch short by showing too early a commit:
How can I change the revset filter so that I get a more condensed graph? Is it even possible? As a sub-optimal solution I guess it would also be acceptable if no distinction was made between branches being named or not.
This should get you what you're looking for, minus the comparison between branch names:
merge() or parents(merge()) or branchpoint() or children(branchpoint())
This should give you all merge changesets, the direct parents of the merges, all branchpoint changesets, and the direct children of the branchpoints.
In the example in your question post you are including the children of merge changesets and the parents of branchpoints because of the compound nature of the revsets you set up. By breaking those apart, the results are trimmed down a bit.

SSIS control flow 2 out of 3

I have a package where I want to have task A always run and B or C run (but not both) and I want them to run concurrently before they (all three) go to the next task. So I know how to set the constraints so that either B or C succeeds but adding in A is a problem. In the Multiple Constraints part of the editor I need another option to point to the task (A) that is AND while the other two tasks are OR.
Anybody know a way to work around that?

Synchronizing two Mercurial branches

I sometimes need to "synchronize" my current (named) branch A with another branch B, i.e. merge B into A and then merge A into B.
This is how I currently do this in TortoiseHg:
Update to tip of A (if necessary)
Right-click tip of B, "Merge with local..."
Update to tip of B
Right-click tip of A, "Merge with local..."
Update to tip of A
Is there an easier/faster way to achieve this?

How do I find the lastest changeset of a branch that was merged into another branch in Mercurial

I have some anonymous branches in dev named branch that eventually will be merged into default branch. How do I find the latest changeset of dev branch that was already merged into default branch?
This is what I came up:
I started by showing all the merges in default branch:
merge() and branch(default)
What I really want is their parents in dev branch:
parents(merge() and branch(default)) and branch(dev)
That gives me all the dev changesets that were merged into default branch. Now I just add max to get the latest one. This is the final expression:
max(parents(merge() and branch(default)) and branch(dev))
The problem is that I think that this query is too big. Is it possible to get this information with a simpler query?
I think that this will do it:
max(p2(branch(default)) & branch(dev))
It gets the changesets on dev that are the second parent of a changeset on the default branch and the max gets the latest one.
It's only one condition shorter though (because the p2 condition effectively combines the parent and merge of your query because you can't be the second parent if you're not a merge).