On Fri, Jul 01, 2005 at 05:17:31PM +0200, Thomas Zander wrote:
> > But there are some more theoretical implications I don't understand.
> > First of all, I cannot seem to come up with a way to resolve the
> > conflict by renaming.  The history of one or the other must be broken.
> > Why is this so?  One would think that the neatest way of resolving an
> > add conflict would be to rename one of the files.
> Honestly, I can't follow what the heck your problem is.

Probably that's because there are so many interconnected things here.
There was one bug report, one question about why files that had a common
filename once in the history make a conflict when merged, and then this
practical question about resolving addition conflicts, which I can
elaborate on:

> Could you explain 
> instead of complain about the problem you have?

You have a project, P.
You make a branch from P, P'.
You make a file, called foo, in P.  Let's call this file F.
You make another file, also called foo, in P'.  Let's call this file F'.
You pull changes from P into P'.
Obviously, you now have a conflict.  Both F and F' want the name "foo".
There are two scenarios how I could imagine one would want the conflict
resolved.  I can't find a proper way to do either of them.  How to do
them, is my question.

1. most often, one would want to rename for example F into "foo2".  I
think this should be possible.  The patches the involve F and F' have no
common dependencies, so one can always make the "addfile foo" of F'
depend on "move foo foo2" of F.  This way, one could resolve the
conflict so that in a way, there never was one.

It need not be handled exactly like that.  All I want, in this scenario,
is a way to have two files (whatever their names), one corresponding to
F, the other corresponding to F'.  Their histories should not be broken.
That is, after the merge and its conflict resolution, darcs should know
that a line of F in P and the same line of F in P' are the same line, so
that further changes to F in P get applied properly when pulled into P'.
The same requirement goes for lines in F' and changes to F'.  Now, here
is the question: what is the way to achieve this?  I can't find a way to
achieve it for _either_ file.

2. sometimes, one would like to have content merges of the files - that
is, a file that has some (or all) of the content of both F and F'.
Let's call this file F'' (whatever its filename), though it can be
identical to either of these files if it makes the implementation
easier.  Now, I know there's currently no way to do this without
breaking the history of one or the other file's content, because darcs
does not have a patch type for moving content between files (it
definitely should, if you ask me - but you need not).  But I can't come
up with a way to do it even so that history _is_ broken, except with
this tedious manual procedure:

 - say 'darcs resolve'
 - guess (or check by comparing against older versions) which file's
   contents you got
 - if you've got this branch's version, copy manually the other version
   from the other branch
 - if you've got the other branch's version, unpull the conflicting
   patch, copy manually the file-before-conflict under another name,
   pull the conflicting patch back, and do 'darcs resolve'.
 - after having both versions, merge manually and commit.

Note that this procedure breaks histories of _both_ file's contents, not
only the history of the file merged in manually.  This is bad.  So, now,
here are the questions: how do I get the contents of _both_ conflicting
files more practically?  And how do I avoid breaking the history of the
contents of _both_ files?

I hope this clarifies what I'm asking in the first place.  This question
includes approximately one-fourth of the issues of the original posting.

Panu

-- 
personal contact: [EMAIL PROTECTED], +35841 5323835, +3589 85619369
work contact: [EMAIL PROTECTED], +35850 3678003
kotisivu (henkkoht):    http://www.iki.fi/atehwa/
homepage (technical):   http://sange.fi/~atehwa/

_______________________________________________
darcs-users mailing list
[email protected]
http://www.abridgegame.org/mailman/listinfo/darcs-users

Reply via email to