Branching models (was Re: Suffering from CVS mindset)
Benoit Boissinot
bboissin at gmail.com
Mon Apr 12 03:09:41 CDT 2010
On Mon, Apr 12, 2010 at 4:40 AM, Yawar Amin <yawar.amin at gmail.com> wrote:
> On 4/11/10 8:28 PM, Greg Ward said:
>> [we've drifted away from the original topic, so I've edit the subject
>> and cc list]
>> [...]
>> But technically, that's just convention: you could
>> construct a bizarre repo where a "named branch" is an arbitrary subset
>> of changesets scattered throughout the graph with no topological
>> consistency.
>>
>
> You mean like this:
>
> $ hg init branchtest
> $ cd branchtest/
> $ echo a >a
> $ hg branch a
> marked working directory as branch a
> $ hg ci -m "Add a"
> $ echo b >b
> $ hg branch b
> marked working directory as branch b
> $ hg ci -m "Add b"
> $ echo a2 >>a
> $ hg branch a
> abort: a branch of the same name already exists (use --force to override)
> $ hg branch a --force
> marked working directory as branch a
> $ hg ci -m "Add to a"
> $ hg glog -vp |less
>
> Which results in this monster:
>
> @ changeset: 2:0a4935f69af3
> | branch: a
> | tag: tip
> | user: Yawar Amin <yawar.amin at gmail.com>
> | date: Sun Apr 11 22:24:00 2010 -0400
> | description:
> | Add to a
> |
> |
> |
> o changeset: 1:cdb03c133b13
> | branch: b
> | user: Yawar Amin <yawar.amin at gmail.com>
> | date: Sun Apr 11 22:23:33 2010 -0400
> | description:
> | Add b
> |
> |
> |
> o changeset: 0:0992669ee067
> branch: a
> user: Yawar Amin <yawar.amin at gmail.com>
> date: Sun Apr 11 22:23:16 2010 -0400
> description:
> Add a
>
> And apparently Mercurial can't diff the changesets. Of course, this
> could be a bug (I'm using version 1.4+20091117).
>
What do you mean by "can't diff" ?
> I have to say I like Mercurial in general (and I love the Windows
> support), but this feels kinda weird to me. Thinking in terms of
> pointers is much simpler.
FYI the best ressources on branching is still Steve's post:
http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/
Cheers,
Benoit
More information about the Mercurial
mailing list