Hi.<div><br></div><div>I&#39;ve just identified the nasty regression this patch causes somewhere deep inside &quot;darcs pull&quot;. I&#39;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">&lt;<a href="mailto:bugs@darcs.net">bugs@darcs.net</a>&gt;</span> wrote:<br>

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