]> khamidou — GitHub mirrors - arcanist.git/commit
When converting a file to a binary, populate the binary's data
authorepriestley <git@epriestley.com>
Tue, 27 Aug 2013 16:34:30 +0000 (09:34 -0700)
committerepriestley <git@epriestley.com>
Tue, 27 Aug 2013 16:34:30 +0000 (09:34 -0700)
commit3ad72195bfc187c8d5e573f9ef0659b286aec327
treeceac0530c9d5f6a957811d122f0da210ea6d1efe
parenta28d4ff3e451714258e49481d7bfaf97ad36ccbe
When converting a file to a binary, populate the binary's data

Summary:
Currently, we prompt the user to mark non-UTF8 files as binary, but don't actually attach the data to the change when they do. This means we don't upload the data, and can't patch it later.

A simple reproduction case is to build a test file (I used one with bytes from 1..255):

  $ # Don't include \0, since Git treats that specially.
  $ ./echo_every_byte_from_1_to_255_inclusive.erl > example.txt

Then add it:

  $ git add example.txt
  $ git commit -a -m derp
  $ arc diff --only HEAD^

You'll be prompted to convert the file to binary:

  Do you want to mark this file as binary and continue? [Y/n] y

Before this patch, that would be followed by:

  Uploading 0 files...

...which is incorrect; we need to upload the new data. After this patch, this shows:

  Uploading 1 files...

...which is also incorrect, but only grammatically. Diffs created after this patch apply back cleanly with `arc patch` and restore the file properly.

Test Plan: Followed instructions above, restoring a textual binary conversion by using `arc patch`.

Reviewers: zeeg, btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D6815
src/parser/diff/ArcanistDiffChange.php
src/workflow/ArcanistDiffWorkflow.php