Sign up for California Today for the latest news on the June 5 primary and more here.

SAN FRANCISCO — In the bluest of blue cities, it can be hard to tell political candidates apart. The four front-runners in the June 5 San Francisco mayoral election, all Democrats, talk about the importance of protecting immigrants and the pernicious effects of income inequality. It goes without saying that they support gay rights, legalized marijuana and more funding for public transportation.

Ron Turner, a book publisher and longtime San Francisco resident, compares the election to “trying to pick a leader at a family picnic.”

And yet on one issue — the roughly 7,000 homeless people and the tent encampments that many of them live in — there are shades of discord. Two of the candidates, London Breed, the current president of the board of supervisors, and Angela Alioto, a past president of the board, speak about using a harder edge when it comes to restoring order to the streets.

“This is an iconic city that is being totally devastated by poverty, filth and crime,” Ms. Alioto said in her law offices across the street from Transamerica Pyramid, the building that defined the San Francisco of a generation ago, when the city still occasionally elected Republicans.