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: Dmitry Kakurin
Subject: Re: [Monotone-devel] Re: How do I merge 2 unrelated branches into 1 ?
Date: Fri, 6 Oct 2006 08:51:04 -0700

Thank you for detailed explanation Dan,
The way I understood it: every directory has a unique GUID, so my CS
directories have same names but different GUIDs and they are not
related (for Monotone).
Furthermore, since they don't have a common ancestor, they cannot be
merged using 3-way merge. And this is why it's a conflict.
Now, I expect conflicts to be presented to the user for conflict
resolution. And I'd like to be able to perform baseless (2-way) merge
in this case. I would even expect this merge to happen automatically
(once I initiate it) since there are no file name conflicts (only dir
names).
I also wonder why keeping track of dirs is necessary. Perforce (for
example) gets away with only keeping track of files and creates dirs
on demand.

Dmitry.

On 10/5/06, Daniel Carosone <address@hidden> wrote:
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.







reply via email to

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