[Top][All Lists]

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

Re: [Gnu-arch-users] merging two projects

From: Scott Bronson
Subject: Re: [Gnu-arch-users] merging two projects
Date: Mon, 16 Feb 2004 12:32:04 -0800

On Mon, 2004-02-16 at 11:07, Gergely Nagy wrote:
> > Let's say I have a project named `emacs' and a smaller project named `url'
> > and I want to merge them by adding `url' into my `emacs' project.
> If I'm not terribly long, you can. Copy the file from url into
> emaacs/lisp/url, and in the emacs project, do a tla sync-tree url. That
> way, you'll import url's history too. Since the inventory ids were
> preserved, this will Just Work(tm).

This is exactly right.

The cool thing about doing this is that, as long as you ensure that the
file and directory ID tags are the same (easy for tagline tagging,
takes a bit of effort for explicit tagging), you can now merge patches
into the 'emacs' project as if it was the 'url' project itself.  This
probably doesn't make much sense so I'll elaborate and add this to Arch
Recipes on the Wiki.

> I recall a similar situation a month or two ago, when tla bash
> completion was merged into tlacontrib.

Yeah, I was the guinea pig...  Here's the thread describing my
attempt and David Allouche's corrections.

Here's my Wiki addition.  Tell me if I made any mistakes.

    - Scott

12. Merge one project into another

Let's say you created a small project named tla-bash-complete. Things
changed however, and now you wish that you had made it a subdirectory in
the tlacontrib--devo--1.2 project. You now want to merge all the files
and change history from tla-bash-complete into tlacontrib. Easy enough: 

$ tla get address@hidden/tla-bash-complete--sb--1.0 sb
$ cd sb
$ cp README TODO gen-tla-commands tla-bash-complete \../tlacontrib/bash-complete
$ cp .arch-ids/ .arch-ids/ 
\../tlacontrib/bash-complete/.arch-ids$ cd ../tlacontrib
$ tla sync-tree address@hidden/tla-bash-complete--sb--1.0
$ tla log-for-merge >> `tla make-log`
$ tla commit

You need to ensure that the inventory IDs did not change during the copy
(use tla inventory --ids, see ID-tagging methods for more). To keep
merging simple, you should ensure that you copy ALL files from project A
into project B. You can delete any that you don't want in another commit
after the merge. One change per commit. 

Now, if someone branches from the now obsolete
tla-bash-complete--sb--1.0, makes some changes, and asks you to merge
them into your tree, you can just "tla star-merge
tla-bash-complete--other-person--1.0" into tlacontrib as if it were
still the original tree. At first it seems like that shouldn't work at
all -- you're trying to merge changes from one project into a totally
different project! But, of course, they're not totally different. As
long as you were careful to maintain the inventory IDs then, as far as
Arch is concerned, they're now equivalent. You can merge changesets from
either ancestor into the combined tree as if the tree had never been

Doing the opposite -- forking one project into two -- should be obvious.
Create the new archive and tag it from the original. Then delete all the
files you don't want from each archive and then commit. Now you have two
separate archives that share a common ancestor. 

    - Scott

reply via email to

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