> * Only test for SSH ControlMaster if there are ssh paths in args.
> (Fixes issue171)
> hunk ./DarcsCommands.lhs 321
> runWithPostHook os ex =
[...]
> + let sshServers = nub $ sort [ takeWhile (/= ':') p | p
> <- ex, is_ssh p ]
> + useSSHCtrl = not (DisableSSHControlMaster `elem` os)
> + when (useSSHCtrl && (not.null $ sshServers)) $
Eric, I'm still not convinced this is the right solution -- it feels
brittle to me. The trouble is that instead of checking whether we
need ssh, you're checking whether there are any ssh paths. Now the
two happen to be equivalent in the current implementation -- but
there's no reason why they should be in the future.
In order to really check whether we need ssh, I'd do
hasSSHControlMasterIO :: IO Bool
...
hasSSHControlMaster :: Bool
hasSSHControlMaster = unsafePerformIO hasSSHControlMasterIO
and use the latter in the low-level function that uses ssh. Since
Darcs is lazy, it will be evaluated just once.
If you disagree strongly with that, I will apply your solution, of course.
Juliusz
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel