[darcs-users] Merging and un-merging repos

Tommy Pettersson ptp at lysator.liu.se
Sat Jan 7 20:52:03 UTC 2006


On Thu, Jan 05, 2006 at 05:15:52PM -0600, Alan Shields wrote:
> Here's the situation: A project in repository P had some code in file S
> develop to the point where it was a project in its own right.
> Unfortunately, I was unable to disentangle s from P, so I did a straight
> copy into a new repository P2 (as opposed to a pull of some sort[1]).

Then you get two repos that don't share history.  Any file
created in one repo is different than any file created in
the other.  If they have different names you can probably pull
them without conflicts.  If they have the same name they will
conflict since you can't have two files with the same name
in a directory.

> People have now pulled from repo P2, and there has been one patch
> applied. Now we wish to pull patches from P2 into P - so we deleted s
> from P, recorded, and tried to pull from P2.
> 
> We get: (s is taint.lisp, ignore the others)
> ---------------------------------------
> diffing dir...
> We have conflicts in the following files:
> ./taint.lisp
> You have conflicting local changes to:
> ./cl-taint.asd ./taint-doc.html
> Proceed? [yn] y
> Applying patches to the local directories...
> ---------------------------------------
> 
> and s is not in the directory!

One line of history creates a file ./utils/tainted.lisp,
renames it to ./tainted.lisp, modifies it in several steps, and
finally removes it.  The other (conflicting) line of history
creates a file ./tainted.lisp and modifies it.  Now, should
there or should there not be a file named ./tainted.lisp,
and if so, what should it contain?  Darcs can't tell, but it
tries to help by doing its conflict markup, and alas darcs
currently performs very poorly on addfile/rmfile conflicts.
The result in your case was: no file.


> [1] - On a related note, if you just wanted to pull one file out of a
> repo, how would you do that?

If all changes to the file are in separate patches, and the
addfile patch only depends on single addir patches, you could
just pull all these patches to an empty repo.  If the file is
touched by patches that also touch other stuff, it's impossible
(without also pulling the other stuff).

In the latter case, I think one way is to do pull "the other
stuff" and then darcs rm it, or perhaps better, darcs mv it
to an Attic/ dir.


-- 
Tommy Pettersson <ptp at lysator.liu.se>




More information about the darcs-users mailing list