monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] Re: Sharing subprojects between projects


From: Pavel Cahyna
Subject: [Monotone-devel] Re: Sharing subprojects between projects
Date: Thu, 14 Jun 2007 21:20:38 +0200
User-agent: mutt-ng/devel-r529 (NetBSD)

On Thu, Jun 14, 2007 at 10:26:31AM +0100, Anthony Williams wrote:
> Hi,
> 
> I've just started trying out monotone as a replacement for CVS. I'm sure this
> has been covered a squillion times before, but I couldn't find a clear guide
> as to the best way to proceed, so I'm asking again.
> 
> One thing that I do quite often is have a subproject shared between several
> other projects. In CVS I have
> 
>     shared_project/
>         file1.cpp
>         file2.cpp
>     project1/
>         project1.cpp
>     project2/
>         project2.cpp
> 
> I check out shared_project into a subdirectory of each project on disk, so on
> disk I have:
> 
>     project1/
>         project1.cpp
>         shared_project/
>             file1.cpp
>             file2.cpp
>     project2/
>         project2.cpp
>         shared_project/
>             file1.cpp
>             file2.cpp
> 
> With CVS this mostly works OK, since commits in the top level dir recurse
> down, and commit the shared project too. With monotone, if I try the same
> thing then it doesn't recurse into the shared project, and I have to commit
> separately, which is easy to forget.
> 
> I tried using merge_into_dir to add the shared_project files as a subdir of
> project1, which sort-of works, but now I have to remember to pluck the changes
> back to the shared_project branch. Also, if I add a file in
> project1/shared_project and then pluck that change back to shared_project,
> then a subsequent propagate will break, complaining that the two adds
> conflict.
> 
> What's the best way to do this with monotone?

I think you should use merge_into_dir, but never commit changes to the
shared_project directories that you have merged into project1 or project2.
Rather, you should make a branch of the shared_project for every project
it is imported in and make the local changes in those branches. This way
you should be able to propagate them back easily. Each change to those
branches would be propagated to the project containing them, and the
directories project[12]/shared_project would be changed only by those
propagates, never by direct commits.

But, as you have said, such rules are easy to forget...

Pavel




reply via email to

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