Fix infinite loop in PhutilFileTree

Summary: In one of our diff we have files with name '10.8' and '10.80' in the same dir, which caused infinite loop since numerically they are the same hence getNextSibling() call on 10.80 will always gets itself.

Test Plan: Load the diff with fix.

Reviewers: epriestley, lifeihuang, JoelB, cdentel, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D8091
Add "%R" to csprintf(), for printing more readable commands

Summary: Ref T4175. The clone commands we print have quoted arguments, but usually don't need them. Add "%R", which is like "%s" but only adds quotes if they're required. This produces slightly more readable commands in the few cases we're generating commands for users to copy/paste.

Test Plan: Added unit tests. Looked up shell metacharacters to double check my definition.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T4175

Differential Revision: https://secure.phabricator.com/D8099