monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: How do I merge 2 unrelated branches into 1 ?


From: Daniel Carosone
Subject: Re: [Monotone-devel] Re: How do I merge 2 unrelated branches into 1 ?
Date: Fri, 6 Oct 2006 06:34:07 +1000
User-agent: Mutt/1.5.13 (2006-08-11)

On Thu, Oct 05, 2006 at 01:02:25PM -0700, Dmitry Kakurin wrote:
> Could you please explain what 'mtn pivot_root' does ?

It exchanges the named directory with the root directory.  It's almost
the same as moving all the contents around, and in your specific case
doing something like:

  mv CS/proj2/* . ; rmdir CS/proj2 CS

would have basically the same effect.  The difference can be important
in some other cases, though.

> And what is root (which is apparently empty in my case) anyway  ?

It's a directory, like any other, that happens to be at the top of the
workspace and called "".  Directories, like files, have permanent
identities and temporary names - and the merger works with their
permanent identities so that the same 'real' file or directory is
merged even where it has been renamed on one or both sides of the
merge.  

pivot_root is a slightly tricky way of renaming the root directory,
just because there always has to be a directory called "" at the root.
You use it when you want to make top-level rearrangements in a project
and still have later merges and propagates follow the renames.

Because you're about to merge_into_dir one branch into the other, and
because merge_into_dir grafts the root directory of one branch into
the other, you want to make the original CS/proj2 dir the root of the
proj2 branch, so it then winds up as the CS/proj2 dir in the target
branch.

The reason you can't just merge them directly is because the
directories called "" and "CS" in each of your branches are actually
different directories with different identities, because they don't
both derive from the same "add" event in a common ancestor.

The permanent identity is internal and basically invisible unless you
look carefully; it's similar to the inode number in the unix
filesystem.  They're created and assigned when the item is added, and
inherited by all descendents.

--
Dan.

Attachment: pgpAnuDR_0JJ6.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]