Hi.<div><br></div><div>I've just identified the nasty regression this patch causes somewhere deep inside "darcs pull". I'll investigate and get back to you.<br><br><div class="gmail_quote">On Wed, Sep 1, 2010 at 6:39 PM, Florent Becker <span dir="ltr"><<a href="mailto:bugs@darcs.net">bugs@darcs.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Florent Becker <<a href="mailto:florent.becker@ens-lyon.org">florent.becker@ens-lyon.org</a>> added the comment:<br>
<br>
><br>
>New patches:<br>
><br>
>[Fix for issue1932<br>
>Dmitry Astapov <<a href="mailto:dastapov@gmail.com">dastapov@gmail.com</a>>**20100825173045<br>
> Ignore-this: 68db2c42ef376307271a7f609e62481c<br>
<div class="im">> Do _not_ check for colons in "isRelative" - everything is covered<br>
> inside Add.lhs and governed by use of "--reserved-ok" option.<br>
><br>
> Replace isRelative and isAbsolute with functions from System.FilePath<br>
> for correct handling of platform specifics.<br>
</div>>] hunk ./src/Darcs/Commands/Add.lhs 48<br>
> , doesFileReallyExist, treeHas, treeHasDir,<br>
treeHasAnycase )<br>
> import Darcs.RepoPath ( SubPath, toFilePath, simpleSubPath, toPath )<br>
> import Darcs.Repository.Prefs ( darcsdirFilter, boringFileFilter )<br>
>-import Data.Maybe ( maybeToList, fromJust )<br>
>+import Data.Maybe ( maybeToList )<br>
> import System.FilePath.Posix ( takeDirectory, (</>) )<br>
> import qualified System.FilePath.Windows as WindowsFilePath<br>
> import Printer( text )<br>
>hunk ./src/Darcs/Commands/Add.lhs 54<br>
><br>
> #include "gadts.h"<br>
>+#include "impossible.h"<br>
><br>
> addDescription :: String<br>
> addDescription = "Add one or more new files or directories."<br>
><br>
Why exchange the import of fromJust for the inclusion of impossible? I don't<br>
see the point.<br>
<br>
>hunk ./src/Darcs/URL.hs 30<br>
> * A URL contains the sequence @\":\/\/\"@.<br>
><br>
> * A local filepath does not contain colons, except<br>
>- as second character (windows drives).<br>
>+ as second character (windows drives) when this<br>
>+ filepath is meant to be used as repository name<br>
><br>
> * A path that is neither a URL nor a local file<br>
> is an ssh-path.<br>
>hunk ./src/Darcs/URL.hs 56<br>
> isSshNopath<br>
> ) where<br>
><br>
>+import qualified System.FilePath as FP (isRelative, isAbsolute, isValid)<br>
>+<br>
> #include "impossible.h"<br>
><br>
> isRelative :: String -> Bool<br>
>hunk ./src/Darcs/URL.hs 61<br>
>-isRelative (_:':':_) = False<br>
<div class="im">>-isRelative f@(c:_) = isFile f && c /= '/' && c /= '~'<br>
</div>> isRelative "" = bug "Empty filename in isRelative"<br>
>hunk ./src/Darcs/URL.hs 62<br>
>+isRelative f = FP.isRelative f<br>
><br>
> isAbsolute :: String -> Bool<br>
> isAbsolute "" = bug "isAbsolute called with empty filename"<br>
>hunk ./src/Darcs/URL.hs 66<br>
>-isAbsolute f = isFile f && (not $ isRelative f)<br>
>+isAbsolute f = FP.isAbsolute f<br>
><br>
We are now using the stdlib isRelative and isAbsolute. We still have<br>
isAbsolute = not . isRelative .<br>
<br>
> isFile :: String -> Bool<br>
>hunk ./src/Darcs/URL.hs 69<br>
>-isFile (_:_:fou) = ':' `notElem` fou<br>
>-isFile _ = True<br>
>+isFile f@(_:_:fou) = ':' `notElem` fou && FP.isValid f<br>
>+isFile f = FP.isValid f<br>
><br>
> isUrl :: String -> Bool<br>
> isUrl (':':'/':'/':_:_) = True<br>
><br>
<br>
We still have :<br>
<br>
isSsh :: String -> Bool<br>
isSsh s = not (isFile s || isUrl s)<br>
<br>
This means (IIUC) that on windows, trying to use a "special" filename<br>
such as "prn" would try to do an "ssh prn". I'm applying this anyway,<br>
but we should give some other error message ("darcs pull prn" --> "no<br>
route to host prn" would be a bit puzzling). Can you do that in a<br>
followup patch?<br>
<br>
----------<br>
status: review-in-progress -> accepted-pending-tests<br>
<div><div></div><div class="h5"><br>
__________________________________<br>
Darcs bug tracker <<a href="mailto:bugs@darcs.net">bugs@darcs.net</a>><br>
<<a href="http://bugs.darcs.net/patch368" target="_blank">http://bugs.darcs.net/patch368</a>><br>
__________________________________<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Dmitry Astapov<br>
</div>