Page MenuHomePhabricator

Add trailing tabs when generating synthetic Git diffs for files with spaces
ClosedPublic

Authored by epriestley on Jan 16 2018, 4:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 11:55 PM
Unknown Object (File)
Mon, Apr 22, 2:59 AM
Unknown Object (File)
Fri, Apr 19, 7:04 PM
Unknown Object (File)
Thu, Apr 11, 8:11 AM
Unknown Object (File)
Tue, Apr 2, 9:10 AM
Unknown Object (File)
Tue, Apr 2, 8:40 AM
Unknown Object (File)
Tue, Apr 2, 8:40 AM
Unknown Object (File)
Tue, Apr 2, 8:40 AM
Subscribers
None

Details

Summary

Fixes T8768. See PHI294. See that task for more details.

Git, Mercurial, diff, and patch have conspired to make things weird. To correctly handle files with spaces in the way everything else does and expects, we need to emit semantic trailing whitespace literals.

Test Plan
  • Created a file with spaces in it in a Mercurial repositroy, committed it, diffed it into a revision.
  • Used arc patch to apply the change to a clean copy of the repository.
  • Before patch: Mercurial incorrectly creates a file named X, not a file named X Y.txt.
  • After patch: arc patch commit is identical to genuine commit.
  • Also added test coverage. The other general behaviors here are fairly well covered already.

Diff Detail

Repository
rARC Arcanist
Branch
patch1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 19039
Build 25689: Run Core Tests
Build 25688: arc lint + arc unit