[darcs-users] packages + revision control: is that possible?

Mojca Miklavec mojca.miklavec.lists at gmail.com
Tue Sep 18 23:39:28 UTC 2007


On 9/17/07, Nathan Gray wrote:
> On Mon, Sep 17, 2007 at 04:35:34AM +0200, Mojca Miklavec wrote:
> > On 9/12/07, Nathan Gray wrote:
> > > With darcs, I would set up two repositories (package1 and package2).
> > > I would then set up a combined repository:
> > >
> > >   darcs get package1 combined
> > >   cd combined
> > >   darcs pull ../package2
> > >
> > > I would then continue to make edits to 'package1' and 'package2', and keep
> > > 'combined' up-to-date by pulling from both source repositories.
> > >
> > > There has been talk about nested repositories in darcs, but the
> > > concept is still very ellusive.
> >
> > I'm sorry for this complete newbie question. I have now tried the
> > following, but the last command fails:
> >
> > mkdir p1
> > mkdir p2
> > mkdir p12
> >
> > cd p1
> > darcs init
> > mkdir dir1
> > mkdir dir2
> > touch dir1/file1 dir1/file2 dir2/file1
> > darcs add -r dir1/
> > darcs add -r dir2/
> > darcs record -a -m "p1 added"
> >
> > cd ../p2
> > darcs init
> > mkdir dir1
> > mkdir dir2
> > touch dir1/file3 dir2/file2
> > darcs add -r dir1/
> > darcs add -r dir2/
> > darcs record -a -m "p2 added"
>
> The problem appears to be that you are recording everything for each
> repo in a single patch.  There are two conflicts: 'mkdir dir1' and
> 'mkdir dir2'.  If you record those separately, you need not ever
> experience a conflict.
>
> Let's introduce a third repository, which contains only the directory
> structure, with no files:
>
> mkdir directory_layout
> cd directory_layout
> darcs init
> mkdir dir1
> darcs add dir1
> darcs record -a -m 'dir1 added'
> mkdir dir2
> darcs add dir2
> darcs record -a -m 'dir2 added'
>
> cd ..
> darcs get directory_layout p1
> cd p1
> touch dir1/file1 dir1/file2 dir2/file1
> darcs add -r dir1/
> darcs add -r dir2/
> darcs record -a -m "p1 files added"
>
> cd ..
> darcs get directory_layout p2
> cd p2
> touch dir1/file3 dir2/file2
> darcs add -r dir1/
> darcs add -r dir2/
> darcs record -a -m "p2 files added"
>
> You should now be able to pull into your combined repository without
> any conflicts.
>
> > cd ../p12
> > darcs init
> > darcs pull -a ../p1
> > darcs pull -a ../p2
>
> -kolibrie

Thanks a lot for that! This worked perfectly and made me understand
darcs phylosophy much better :).

The only problem that I didn't realize before is that the the
repository at the user is now twice the original size, which is not
needed since the user is not supposed to modify things, at least not
the big binaries, but well ...

Mojca


More information about the darcs-users mailing list