Here's something joyful: when you close a branch in Mercurial, e.g. via
hg update -C branch-to-be-closed
hg commit --close-branch -m 'branch to be closed'
it becomes the "tip" - the most recent changest.
Many tools confuse "tip" with something like "the tip of the default branch". And do stuff like checking out or diffstat'ing with tip.
Which probably is not what you want for a closed branch.
Andy "Krazy" Glew is a computer architect, a long time poster on comp.arch ... and an evangelist of collaboration tools such as wikis, calendars, blogs, etc. Plus an occasional commentator on politics, taxes, and policy. Particularly the politics of multi-ethnic societies such as Quebec, my birthplace. Photo credit: http://docs.google.com/View?id=dcxddbtr_23cg5thdfj
Thursday, July 05, 2012
Merge node common to several branches
Noticing a pattern:
hg branch b
... edit b ...
... test ...
hg merge -r default
... test ...
hg ci -m 'merged default into b'
hg update -r default
hg merge -r b
... diff -r default -r b
... test ...
hg ci -m 'merged from branch b into default (after already merged default into branch b, i.e. identical node in both default and branch b'
This seems suboptimal.
It seems to me that instead of creating the same node, wrt content, on two branches, in this case default and b, we could create it once. And link it in to both branches.
Key: must remember that the node is on both branches, so that afterwards can continue working separately.
I.e. could have updated to the merge node M but be on the default branch. Or on the b branch. (Or possibly both?)
It may be common to end a branch at such a merge node. Perhaps commn enough to be the default. But not univeral.
hg branch b
... edit b ...
... test ...
hg merge -r default
... test ...
hg ci -m 'merged default into b'
hg update -r default
hg merge -r b
... diff -r default -r b
... test ...
hg ci -m 'merged from branch b into default (after already merged default into branch b, i.e. identical node in both default and branch b'
This seems suboptimal.
It seems to me that instead of creating the same node, wrt content, on two branches, in this case default and b, we could create it once. And link it in to both branches.
Key: must remember that the node is on both branches, so that afterwards can continue working separately.
I.e. could have updated to the merge node M but be on the default branch. Or on the b branch. (Or possibly both?)
It may be common to end a branch at such a merge node. Perhaps commn enough to be the default. But not univeral.