Hello,

here's my situation. I have two repositories:

  [EMAIL PROTECTED] ~]$ cd conflicts/
  [EMAIL PROTECTED] conflicts]$ ll
  total 28436
  drwxrwx---  11 jll dev     4096 Mar  3 11:19 t3.conflicts
  drwxr-xr-x  11 jll dev     4096 Mar  3 11:20 t3.xml

t3.xml was cloned from t3.conflicts. Some worked occured in both
repositories. Actually t3.conflicts is the central repository, it
received patches from here and there. I have made changes in t3.xml
and I want to send them to the central repository.

First I check that everything is recorded:


  [EMAIL PROTECTED] conflicts]$ cd t3.xml
  [EMAIL PROTECTED] t3.xml]$ darcs whatsnew
  No changes!

Following a habit I took with BitKeeper I first pull from the central
repository:

  [EMAIL PROTECTED] t3.xml]$ darcs pull
  Pulling from "../t3.conflicts"...
  
  Thu Feb 23 21:16:19 UTC 2006  [EMAIL PROTECTED]
    * doc: xml tool documentation + java examples same as perl examples
  Shall I pull this patch? (1/27) [ynWvpxqadjk], or ? for help: a
  
  Finished pulling and applying.

Now I tru to push:

  [EMAIL PROTECTED] t3.xml]$ darcs push
  Pushing to ../t3.conflicts...
  
  Wed Mar  1 16:48:31 UTC 2006  [EMAIL PROTECTED]
    * perl+xml: sync with java
  Shall I push this patch? (1/1) [ynWvpxqadjk], or ? for help: y
  
  
  darcs failed:  Refusing to apply patches leading to conflicts.
  If you would rather apply the patch and mark the conflicts,
  use the --mark-conflicts option to apply.
  There are conflicts in the following files:
  ./perl/Tangram-XML/lib/Tangram/XML/Storage/Flat.pm
  
Let's do as Darcs suggests then:

  [EMAIL PROTECTED] t3.xml]$ darcs push  --mark-conflicts
  
  darcs failed:  unrecognized option `--mark-conflicts'
  
Okay, I see that in general it's not a good idea to mark conflicts in
the repository one pushes to so I'll do it from the other side
although it'sstarting to feel a bit unnatural:

  [EMAIL PROTECTED] t3.xml]$ cd ../t3.conflicts/
  [EMAIL PROTECTED] t3.conflicts]$ darcs pull ../t3.xml/
  
  Wed Mar  1 16:48:31 UTC 2006  [EMAIL PROTECTED]
    * perl+xml: sync with java
  Shall I pull this patch? (1/1) [ynWvpxqadjk], or ? for help: y
  
  We have conflicts in the following files:
  ./perl/Tangram-XML/lib/Tangram/XML/Storage/Flat.pm
  Error applying patch to recorded!
  The patch was:
  {
  [perl+xml: sync with java
  [EMAIL PROTECTED] {
  hunk ./perl/Tangram-XML/lib/Tangram/XML.pm 229
  -      $tag =~ s/::/:/g;
  +      $tag =~ s/::/-/g;
  hunk ./perl/Tangram-XML/lib/Tangram/XML/Storage/Flat.pm 80
  +sub user_type_tag ($) {
  +  my $name = shift;
  +  $name =~ s/::/-/g;
  +  $name
  +}
  +
  hunk ./perl/Tangram-XML/lib/Tangram/XML/Storage/Flat.pm 110
  -  $writer->xmlDecl('US-ASCII');
  +  my $root_tag = user_type_tag ref $self;
  +
  +  $writer->xmlDecl('utf-8');
  hunk ./perl/Tangram-XML/lib/Tangram/XML/Storage/Flat.pm 114
  -  $writer->startTag($self->{TAG}, class => "$self->{TAG}", storage => 
"$xml_class", @schema_attr);
  +  $writer->startTag($root_tag);
  hunk ./perl/Tangram-XML/lib/Tangram/XML/Storage/Flat.pm 123
  -  $writer->endTag($self->{TAG});
  +  $writer->endTag($root_tag);
  }
  }

At least I see what's going on - or at least what the conflicts are
but not the patches that led to the conflict.

So let's try that option again:

  [EMAIL PROTECTED] t3.conflicts]$ darcs pull ../t3.xml/ --mark-conflicts
  
  darcs failed:  unrecognized option `--mark-conflicts'
  
Okay, this is a replay of the story that is a bit longer but I'll
shorten it a bit: realizing that it's 'darcs apply' that has a
--mark-conflicts option I used 'darcs send' to create a patch bundle
and tried to apply it with --mark-conflicts. I don't remember the
details but this approach failed too. I guess I could reproduce it
though. I ended up taking a backup of the central repository and
replacing it with my t3.xml work repository.

I think that Darcs can be improved a lot here. As I understand the
manual on conflicts, there is an important bit of information that's
missing from Darcs' error messages: the patch dependency tree that led
to the conflict. And the messages you do get are wrong.

I was expecting to solve the problem by creating a new patch in my
work repository then pushing it. That was the reason for the initial
pull. But perhaps there's something I misunderstood?

The two repositories - as they were before I typed all the commands
above - are available here
http://jimi.soundobjectlogic.com/darcs/conflicts.tgz.
-- 
Jean-Louis Leroy
Sound Object Logic
http://www.soundobjectlogic.com

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

Reply via email to