darcs

Issue 2731 darcs 2.18 can no longer pull: "allStack (from HasCallStack): error, called at src/Darcs/Patch/Conflict.hs"

Title darcs 2.18 can no longer pull: "allStack (from HasCallStack): error, called at src/Darcs/Patch/Conflict.hs"
Priority critical Status unknown
Milestone Resolved in
Superseder Nosy List bortzmeyer
Assigned To
Topics

Created on 2024-08-30.13:15:56 by bortzmeyer, last changed 2024-10-26.12:09:40 by bortzmeyer.

Messages
msg24077 (view) Author: bortzmeyer Date: 2024-08-30.13:15:50
% darcs pull
Pulling from "REPOS"...
patch 1f20d9756fd50d9b86c0c92e3e7671c6d261de22
Author: stephane...
Date:   Fri Aug 30 11:04:14 CEST 2024
  * Tout début rédaction article
Shall I pull this patch? (1/2) 
...

This is a bug! Please report it at http://bugs.darcs.net or via email to bugs@darcs.net:
precondition violated:
[First "entry" document
bortzmeyer@batilda.nic.fr**20050708135337] {
adddir ./entries
addfile ./entries/Makefile
hunk ./entries/Makefile 1
...
CallStack (from HasCallStack):
  error, called at src/Darcs/Patch/Conflict.hs:103:5 in darcs-2.18.3-5469898435c90cc53ddbdb01f4c15ff1619487ab9ba0b191543e64ba814b25a2:Darcs.Patch.Conflict

It is a large repository (8.3 GB, 20,705 patches) but darcs 2.16 has no problem with it.

%                    darcs --version
2.18.3 (release)

(Ubuntu/Linux)

I tried: 
* darcs optimize clean (no error but changes nothing)
* darcs get REPOS in an empty directoty (same error message)
msg24078 (view) Author: bortzmeyer Date: 2024-08-30.15:40:31
Retrieving the patches one by one (with darcs pull -h HASH) works...
msg24084 (view) Author: bfrk Date: 2024-10-14.09:06:23
This is bad, but there is probably not much we can do about it. The 
patches that make up your two repositories violate a certain global 
invariant. This is usually caused by bugs in the darcs-1 or darcs-2 
patch formats. An unfortunate side-effect of some refactors we made 
since 2.16 is that darcs is now more likely to "notice" violation of 
such invariants. In such a case there is really nothing we can do other 
than crashing.

However, there are things you can do to mitigate the situation.

My guess is that the repo you are pulling from ("REPOS") either has 
unresolved conflicts, in which case it may help to resolve these 
conflicts first. Otherwise, i.e. if the conflict is with patches in the 
repo into which you pull, you could try `darcs rebase pull`. This 
suspends any local patches that conflict. You can then `darcs rebase 
unsuspend` them one at a time, resolve the conflicts, and `darcs amend` 
those resolutions into the patch. (This works somewhat similar to `git 
pull --rebase`, in case you happen to be familiar with that.)
msg24089 (view) Author: bortzmeyer Date: 2024-10-24.12:33:11
I cannot find if I have conflicts since 'darcs mark-conflict' crashes with the same error. Searching conflict markers in the files find nothing.

'darcs rebase pull' in the local (destination) repo fails with the same error (CallStack (from HasCallStack): error, called at src/Darcs/Patch/Conflict.hs:103:5 in darcs-2.18.3-...

In the remote (source) repo:
% darcs rebase pull
Rebase finished!
No default repository to pull from, please specify one
msg24091 (view) Author: bfrk Date: 2024-10-26.10:04:27
So darcs-2.18.3 already crashes in your upstream repo ("REPOS") whenever it 
tries to run the "resolve/mark conflicts" procedure. So the only way to 
mitigate that situation is to make sure this doesn't happen.

One way do that may be to tag your upstream repo (`darcs tag <name of the 
tag>`). The tag then depends on every patch in your repository, so it will 
be seen by darcs as a resolution of any (possibly existing) conflicts. 
Hopefully this will result in `darcs mark-conflicts` (in REPOS) no longer 
crashing (it should report no conflicts). It should then be possible to pull 
patcehs into your local clone *IF* you pass the --reorder-patches option. 
This option means that any local patches not yet in upstream will be put on 
top of the remote ones, which in turn means that the conflict marking 
procedure will only act on those patches and leave all teh history up to the 
new tag alone.
msg24092 (view) Author: bortzmeyer Date: 2024-10-26.12:09:39
In the end, the solution was apparently simple: just run a 'darcs revert' in the upstream repository (there were unrecorded changes). Now, darcs 2.18 seems to be able to pull several patches in one operation.
History
Date User Action Args
2024-08-30 13:15:56bortzmeyercreate
2024-08-30 15:40:31bortzmeyersetmessages: + msg24078
2024-10-14 09:06:27bfrksetmessages: + msg24084
2024-10-24 12:33:14bortzmeyersetmessages: + msg24089
2024-10-26 10:04:30bfrksetmessages: + msg24091
2024-10-26 12:09:40bortzmeyersetmessages: + msg24092