Use of named branches
Daniel Holth
dholth at fastmail.fm
Sat May 5 13:01:42 UTC 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Sebastien Lucas wrote:
> Hi,
>
> First some background, I have happily used Subversion for 2 years at
> work and I think I learned how to use it right. I'm currently
> reviewing mercurial for my personal needs. I'm using 0.9.3 on debian.
>
> Coming from subversion, I'm used to have a trunk (where the main
> developpement take place) and my branches in the same repository. I
> know that's the prefered way is to use hg clone to create a branch but
> I'd prefer to use named branches to keep everything (trunk and dev
> branches) in the same repository.
>
> I made some experiment last night :
>
....
>
> I really feel I have missed something (or everything). Can anybody
> enlight me on a proper use of named branches ?
>
> Thanks in advance.
>
> Sebastien
It really helps to see a graph of the history. Here is a graph of your
first example, produced by the graphlog extension:
hg glog
@ changeset: 3:5b6296f3a53e
|\ branch: trunk
| | tag: tip
| | parent: 2:1d83dd56f1bb
| | parent: 1:735f6ca138b0
| | summary: merge
| |
| o changeset: 2:1d83dd56f1bb
| | branch: trunk
| | parent: 0:b9d86061fb9e
| | summary: commit to trunk again
| |
o | changeset: 1:735f6ca138b0
|/ branch: seb-dev
| summary: commit to seb-dev
|
o changeset: 0:b9d86061fb9e
branch: trunk
summary: commit to trunk
Here is your second example:
hg glog
o changeset: 1:9a534b2e2d3b
| branch: seb-dev
| tag: tip
| summary: commit to seb-dev
|
@ changeset: 0:f057905ed14e
branch: trunk
summary: commit to trunk
In the second example, it is impossible to merge with trunk, because
seb-dev is directly descended from trunk and there is no diverging
change. I can create my own idea of what should come after trunk:
touch b.txt
hg add b.txt
hg commit
Creating:
hg glog
@ changeset: 2:d02f1d650c2f
| branch: trunk
| tag: tip
| parent: 0:f057905ed14e
| summary: add b
|
| o changeset: 1:9a534b2e2d3b
|/ branch: seb-dev
| summary: commit to seb-dev
|
o changeset: 0:f057905ed14e
branch: trunk
summary: commit to trunk
Now there is a structural branch in our revision history. It now
possible to merge revision 1 into revision 2.
hg merge
hg commit
hg glog
@ changeset: 3:e1bbc47eb8eb
|\ branch: trunk
| | tag: tip
| | parent: 2:d02f1d650c2f
| | parent: 1:9a534b2e2d3b
| | summary: merge
| |
| o changeset: 2:d02f1d650c2f
| | branch: trunk
| | parent: 0:f057905ed14e
| | summary: add b
| |
o | changeset: 1:9a534b2e2d3b
|/ branch: seb-dev
| summary: commit to seb-dev
|
o changeset: 0:f057905ed14e
branch: trunk
summary: commit to trunk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGPIA1Vh4W2pVfoMsRAhF8AKDW6X7t58IhYxM7/sd5WecKN1ONiACfYIl0
g1RfX+7i48HUUalmKz+wuhc=
=U6Cn
-----END PGP SIGNATURE-----
More information about the Mercurial
mailing list