hg clone -r mybranch from two repos in sync leads to two different revisions

Matt Mackall mpm at selenic.com
Fri Jan 15 12:07:32 CST 2010


On Fri, 2010-01-15 at 06:55 -0800, Dario Sestito wrote:
> Hi!
> hope you can help me, I would like to understand if this is the intended
> behaviour for Mercurial or if I should raise a bug. If this is the intended
> behaviour I wouldn't mind understanding why :-)
> 
> Let repo1 and repo2 be two clones of the same repository that now and then I
> keep in sync with pull/push.
> I've noticed that running:
> 
> hg clone repo1 -r branch
> 
> and
> 
> hg clone repo2 -r branch
> 
> could lead to two different revisions even if repo1 and repo2 are in sync
> (i.e. hg -r repo1 incoming/outgoing repo2 shows nothing)

Sounds like your branch has multiple heads (check hg heads branch),
which is not the usual way to do things. In either case, you should get
the same csets in both clones, but with heads numbered differently.

> So my question is is this really intended, why not having -r branch pointing
> to the last (chronologically) submitted changeset, regardless of when it was
> added to the clone (i.e. regardless of the revision number)?

You mean aside from backward compatibility?

- using branch tip is fairly intuitive and deterministic and is simply
how Mercurial works
- we'd have to trust people's clocks


-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial mailing list