New submission from Ben Franksen <[email protected]>:

I encountered this when trying to create a patch index for some pretty old
repositories.

1 patch for repository http://darcs.net/screened:

patch 3abf50ef2bf85dec34e31b284594f2c1aad7a19c
Author: Ben Franksen <[email protected]>
Date:   Thu Nov 28 14:54:39 CET 2024
  * patch index: missing fid is not necessarily a bug

  Such an error can happen if the repo contains broken patches, especially
  broken move patches with either missing source or target. So it makes more
  sense to ask the user to try repair.

----------
files: patch-index_-missing-fid-is-not-necessarily-a-bug.dpatch, 
patch-preview.txt
messages: 24106
nosy: bfrk
status: needs-screening
title: patch index: missing fid is not necessarily a bug

__________________________________
Darcs bug tracker <[email protected]>
<https://bugs.darcs.net/patch2429>
__________________________________
[patch index: missing fid is not necessarily a bug
Ben Franksen <[email protected]>**20241128135439
 Ignore-this: 47e37be6f94623abd78a02fcc397d423918627a7d2a0bad707ce82acf9ffb331095eee33b7b17f78
 
 Such an error can happen if the repo contains broken patches, especially
 broken move patches with either missing source or target. So it makes more
 sense to ask the user to try repair.
] hunk ./src/Darcs/Repository/PatchIndex.hs 40
-import Control.Exception ( catch )
+import Control.Exception ( catch, throw )
hunk ./src/Darcs/Repository/PatchIndex.hs 278
-        Nothing -> error $ "couldn't find " ++ displayPath fn ++ " in patch index"
+        Nothing ->
+            -- This error may be caused by broken patches, rather than a bug in
+            -- the patch index itself, for instance, broken move patches with
+            -- non-existing source or target. Thus we should not use 'error' here.
+            throw $ userError $
+                "Couldn't find " ++ displayPath fn ++ " in patch index.\n\
+                \Please run `darcs check`. If that reports issues mentioning " ++ displayPath fn ++ " \n\
+                \then running `darcs repair` probably fixes the problem."

Attachment: patch-index_-missing-fid-is-not-necessarily-a-bug.dpatch
Description: application/darcs-patch

_______________________________________________
darcs-devel mailing list
[email protected]
https://lists.darcs.net/mailman/listinfo/darcs-devel

Reply via email to