[darcs-users] darcs patch: resolve issue1043: fix bug in mergeAfterConflicting.

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Sat Sep 27 07:35:17 UTC 2008


Le 27 sept. 08 à 00:27, Jason Dagit a écrit :

>
>
> On Fri, Sep 26, 2008 at 2:45 PM, David Roundy <droundy at darcs.net>  
> wrote:
> On Fri, Sep 26, 2008 at 10:31:48PM +0100, Eric Kow wrote:
> > On Fri, Sep 26, 2008 at 17:01:49 -0400, David Roundy wrote:
> > > Here's a bug fix for issue1043, which was a pretty scary bug in  
> the
> > > conflict-handling code for the darcs-2 formalism.  I had failed to
> > > take into account a possible scenario (which I wrongly thought was
> > > impossible).  I've fixed that by switching to using in
> > > mergeAfterConflicting a variant of commute which doesn't allow
> > > conflicting patches to commute, which seems to solve the problem.
> >
> > So, I haven't looked at this yet.
> > Do you reckon it's safe to put it in the release?
>
> I believe it should be.  Or rather, the code without this fix is
> definitely not safe to put into the release, so I think we're better
> off with the fix than without it.  It definitely fixes this particular
> problem (and yes, I was able to understand the problem enough to be
> confident of that).  I'm concerned that there might be similar bugs
> elsewhere in the code, but don't have the time for a full audit.
>
> Thanks for putting in a big comment in front of  
> mergeAfterConflicting.  I think that is quite nice.
>
> This sounds like a tricky bug.
>
> Maybe we can convince Florent to apply this and retry his test case  
> to see if those other not-audited places trigger.


Hi,

I'm afraid this patch didn't fully fixed the darcs-doc case:

[glehmann at gbook src]$ darcs get darcs-doc/ darcs-doc2
Copying patches, to get lazy repository hit ctrl-C...
Finished getting.
[glehmann at gbook src]$ cd -
/Users/glehmann/src/darcs-doc2
[glehmann at gbook darcs-doc2]$ ../darcs/darcs pull -a ../darcs
Pulling from "/Users/glehmann/src/darcs"...
darcs: mergeConflictingNons failed in geteff with ix
{{
|:
hunk ./src/Darcs/Arguments.lhs 174
+-- darcs-doc: TODO
|hunk ./src/Darcs/Arguments.lhs 174
|+fixFilePath :: [DarcsFlag] -> FilePath -> AbsolutePath
|+fixFilePath opts f = case extract_fix_path opts of
|+                       Nothing -> bug "Can't fix path in  
absoluteFilePath"
|+                       Just (_,o) -> makeAbsolute o f
|+
|:
hunk ./src/Darcs/Arguments.lhs 179
-fix_filepaths :: [DarcsFlag] -> [String] -> [DarcsPath]
-fix_filepaths opts args =
-  let fix = case extract_fix_path opts of
-            Nothing    -> map unfixedDarcsPath
-            Just (_,f) -> map (darcsPath f)
-  in nub $ fix $ filter (not.null) args
+fixFilePathOrStd :: [DarcsFlag] -> FilePath -> AbsolutePathOrStd
+fixFilePathOrStd opts f = case extract_fix_path opts of
+                            Nothing -> bug "Can't fix path in  
fixFilePathOrStd"
+                            Just (_,o) -> makeAbsoluteOrStd o f
|hunk ./src/Darcs/Arguments.lhs 174
|+fixFilePath :: [DarcsFlag] -> FilePath -> AbsolutePath
|+fixFilePath opts f = case extract_fix_path opts of
|+                       Nothing -> bug "Can't fix path in  
absoluteFilePath"
|+                       Just (_,o) -> makeAbsolute o f
|+
|:
hunk ./src/Darcs/Arguments.lhs 176
-                       Nothing -> bug "Can't fix path in  
absoluteFilePath"
+                       Nothing -> bug "Can't fix path in fixFilePath"
|:
hunk ./src/Darcs/Arguments.lhs 174
+fixFilePath :: [DarcsFlag] -> FilePath -> AbsolutePath
+fixFilePath opts f = case extract_fix_path opts of
+                       Nothing -> bug "Can't fix path in  
absoluteFilePath"
+                       Just (_,o) -> makeAbsolute o f
+
}}
xx
hunk ./src/Darcs/Arguments.lhs 174
-fix_filepaths :: [DarcsFlag] -> [String] -> [DarcsPath]
-fix_filepaths opts args =
-  let fix = case extract_fix_path opts of
-            Nothing    -> map unfixedDarcsPath
-            Just (_,f) -> map (darcsPath f)
-  in nub $ fix $ filter (not.null) args
-
-fix_flag :: AbsolutePath -> DarcsFlag -> DarcsFlag
-fix_flag fix (Sibling s) = Sibling $ toFilePath $ makeAbsolute fix s
-fix_flag fix (Verify s) = Verify $ toFilePath $ makeAbsolute fix s
-fix_flag fix (LogFile s) = LogFile $ toFilePath $ makeAbsolute fix s
-fix_flag fix (VerifySSL s) = VerifySSL $ toFilePath $ makeAbsolute  
fix s
-fix_flag _ (Context "") = Context ""
-fix_flag fix (Context s) = Context $ toFilePath $ makeAbsolute fix s
-fix_flag _ f = f
+-- darcs-doc: TODO
+fixFilePath :: [DarcsFlag] -> FilePath -> AbsolutePath
+fixFilePath opts f = case extract_fix_path opts of
+                       Nothing -> bug "Can't fix path in fixFilePath"
+                       Just (_,o) -> makeAbsolute o f
[glehmann at gbook darcs-doc2]$ ../darcs/darcs --version
2.1.0pre2 (+ 13 patches)

Gaëtan

-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr  http://www.mandriva.org
http://www.itk.org  http://www.clavier-dvorak.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20080927/d6dfd691/attachment.pgp 


More information about the darcs-users mailing list