When Jesus told the disciples to buy a sword, He was using an idiom similar to our saying, "Keep your powder dry." In other words, He was telling them the climate was changing from the days previously when they were embraced and provided for in ministry (Matthew 10).