Here's a fix for a bug that shows up when you try
darcs put remote.server:
And then a refactor to get rid of those Regexes.
David
Fri Sep 12 13:35:01 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* change is_file to return false on [EMAIL PROTECTED]:
Fri Sep 12 13:36:11 EDT 2008 David Roundy <[EMAIL PROTECTED]>
* refactor Darcs.URL to eliminate use of Regexes.
The algorithms here are not tricky, and I find this easier to read.
New patches:
[change is_file to return false on [EMAIL PROTECTED]:
David Roundy <[EMAIL PROTECTED]>**20080912173501] hunk ./src/Darcs/URL.hs 44
c:/src/darcs - local file
http://darcs.net/ - URL
[EMAIL PROTECTED]:/path - ssh
+ [EMAIL PROTECTED]: - ssh
host:/path - ssh
hunk ./src/Darcs/URL.hs 55
-}
match_not_file :: Regex
-match_not_file = mkRegex "..+:.+"
+match_not_file = mkRegex "..+:"
match_url :: Regex
match_url = mkRegex ".+://.+"
match_ssh_nopath :: Regex
[refactor Darcs.URL to eliminate use of Regexes.
David Roundy <[EMAIL PROTECTED]>**20080912173611
The algorithms here are not tricky, and I find this easier to read.
] hunk ./src/Darcs/URL.hs 26
is_ssh_nopath
) where
-import Data.Maybe ( isNothing, isJust )
-
-import Text.Regex ( Regex, mkRegex, matchRegex )
#include "impossible.h"
{-
hunk ./src/Darcs/URL.hs 51
Perhaps ssh-paths should use "ssh://[EMAIL PROTECTED]/path"-syntax instead?
-}
-match_not_file :: Regex
-match_not_file = mkRegex "..+:"
-match_url :: Regex
-match_url = mkRegex ".+://.+"
-match_ssh_nopath :: Regex
-match_ssh_nopath = mkRegex "^[^:]{2,}:$"
-
is_relative :: String -> Bool
hunk ./src/Darcs/URL.hs 52
-is_absolute :: String -> Bool
-is_file :: String -> Bool
-is_url :: String -> Bool
-is_ssh :: String -> Bool
-is_ssh_nopath :: String -> Bool
-
is_relative (_:':':_) = False
is_relative f@(c:_) = is_file f && c /= '/' && c /= '~'
is_relative "" = bug "Empty filename in is_relative"
hunk ./src/Darcs/URL.hs 56
+is_absolute :: String -> Bool
is_absolute f = is_file f && (not $ is_relative f)
hunk ./src/Darcs/URL.hs 59
-is_file fou = isNothing $ matchRegex match_not_file fou
-is_url s = isJust $ matchRegex match_url s
+is_file :: String -> Bool
+is_file (_:_:fou) = ':' `notElem` fou
+is_file _ = True
+
+is_url :: String -> Bool
+is_url (':':'/':'/':_) = True
+is_url (_:x) = is_url x
+is_url "" = False
+
+is_ssh :: String -> Bool
is_ssh s = not (is_file s || is_url s)
hunk ./src/Darcs/URL.hs 70
-is_ssh_nopath s = isJust $ matchRegex match_ssh_nopath s
+
+is_ssh_nopath :: String -> Bool
+is_ssh_nopath s = case reverse s of
+ ':':x@(_:_:_) -> ':' `notElem` x
+ _ -> False
Context:
[clean up whitespace.
David Roundy <[EMAIL PROTECTED]>**20080912150248]
[fix manual for optional arguments.
David Roundy <[EMAIL PROTECTED]>**20080912150231]
[clean up whitespace.
David Roundy <[EMAIL PROTECTED]>**20080912145708]
[add test for new --output-auto-name feature.
David Roundy <[EMAIL PROTECTED]>**20080912145648]
[Spaces in Darcs.Commands.Send module.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912122223]
[Make '--output-auto-name' accept optional directory argument.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912120516]
[Add DarcsOptAbsPathOption for options with optional path argument.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912112458]
[Refactor Darcs.Repository.Prefs.getCaches.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912055204]
[Print warning when '--http-pipelining' option is used, but darcs is compiled without HTTP pipelining support.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912054253]
[Do not download URL we have speculated before.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912053236]
[Spaces and parentheses in URL module.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080912053000]
[Coding style in Darcs.Arguments.network_options.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911140710]
[Resolve issue1054: --no-cache option to ignore patch caches.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911140233]
[Remove unused variable from configure.ac.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911132107]
[Comment in configure.ac.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911115840]
[Indentation fixes in configure.ac.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080911115117]
[Formating and minor refactoring in URL.urlThread.
Dmitry Kurochkin <[EMAIL PROTECTED]>**20080910061227]
[insecure printfs - fix the two that I can currently hit
Steve Cotton <[EMAIL PROTECTED]>**20080910230659]
[TAG this version works.
David Roundy <[EMAIL PROTECTED]>**20080910212908]
Patch bundle hash:
5cd3babeeb0d3ee3013aac6084dd17222f822875
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users