Any way to relate repos w/o cloning?

Giorgos Keramidas keramida at ceid.upatras.gr
Thu Nov 13 21:00:57 UTC 2008


On Thu, 13 Nov 2008 10:38:38 -0600, "Chris Stromberger" <chris.stromberger at gmail.com> wrote:
> Yes, but if I do the pull without doing an update, shouldn't hg st
> report the updates that would occur in the working dir when I do an
> update?

Not really, no.  Mercurial doesn't preemptively report that you would
have updates if you ran an `hg update' command, because you can run --
at any time -- `hg update' to *any* changeset number and ``fork'' the
history by committing on top of _that_ particular changeset; even if it
is a very old changeset.  For more insight about how the history of a
repository can be a `graph' of all the changes, see the tutorial at:

    http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial

Look at least at the `TutorialHistory' page.a

The short and long of it is that when you do a `pull' without an
`update' there are no changes to the _working_ area.  Hg just fetches
the changesets and stores them inside its repository data-store under
the `.hg/' subdirectory of your repository root :)

> Does it have something to do with the multiple heads??  Here's the
> output from hg heads:
>
> changeset:   1:ec46614b071e
> tag:         tip
> parent:      -1:000000000000
> user:        cstromberger
> date:        Thu Nov 13 07:13:24 2008 -0800
> summary:     Initial import
>
> changeset:   0:cc98724a0a7a
> user:        cstromberger
> date:        Thu Nov 13 08:11:06 2008 -0800
> summary:     Initial import

Are both of these initial imports 'clean' or do they have the personal
changes of each developer in the pair?  If they are clean you should see
no differences when you run:

    % hg diff --git -r 0:1

If they are initial imports but from a different 'base' snapshot, then
you can merge the two repository 'roots' with:

    % hg update --clean 0
    % hg merge 1

_Then_, after you finish merging, the `hg status' command will show some
changes.  You can commit those, and essentially `link' the two imports
to a single history graph like this:


                         ,------------------.
                         |  2:XXXXXXXXXXXX  |
                         |   cstromberger   |
                         `------------------'
                                  |
              ,-------------------+-------------------.
              |                                       |
    ,------------------.                    ,------------------.
    |  0:cc98724a0a7a  |                    |  1:ec46614b071e  |
    |   cstromberger   |                    |   cstromberger   |
    `------------------'                    `------------------'


At this point it should be possible to start pushing and pulling between
the two repositories, because they have ``something in common'', the
link between their histories at changeset `2:XXXXXXXXXXXX'.




More information about the Mercurial mailing list