Originally Posted by
Blasphemous
The act itself doesn't make the town hostile, or even the shopkeeper.
I had this happen recently but I was cautious and did not hit the dwarf in question.
I led him upstairs, passing the shop on my way out and slew him outside of DT.
Town hostility happens when you actually take a hostile action against the dwarf in question, which is often the case accidentally because you fail to notice that he turned hostile and running into him again acts like an attack instead of swapping.