Parsing rcsdiff -u
ClosedPublic

Authored by Afaque_Hussain on Mar 11 2013, 7:01 PM.

Details

Reviewers
epriestley
Commits
rARCe0702d17c26c: Parsing rcsdiff -u
Apply Patch
arc patch D5324
Summary

Added some sample rcsdiffs for adding and deleting a line from a file. Wrote some test cases to be tested by ArcanistDiffParser.

Test Plan

By making all the test cases pass.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
epriestley requested changes to this revision.Mar 13 2013, 4:27 PM

Nice job getting the tests set up, those look perfect. Pointer inline.

src/parser/ArcanistDiffParser.php
308–312

I think you should be able to add something like this:

case 'rcsdiff -u':
  $this->parseIndexHunk($change);
  break;
Afaque_Hussain updated this revision.Mar 13 2013, 7:19 PM

Hacky way to pass the RCS revision tests (Just testing). Next upate will little better :P

epriestley added inline comments.Mar 13 2013, 10:38 PM
src/parser/__tests__/diff/rcs-deleteline.rcsdiff
8–9

Is this newline in the original? I can't reproduce it with rcsdiff -- my output looks like:

+++ a/testing.php 2013/03/11 16:46:19

i.e., all on one line

epriestley requested changes to this revision.Mar 13 2013, 10:48 PM

Okay, I made these changes:

https://secure.phabricator.com/differential/diff/11577/

And produced these two beautiful diffs:

https://secure.phabricator.com/differential/diff/11575/
https://secure.phabricator.com/differential/diff/11576/

...plus passing unit tests. Check if my inlines are on track and then I think we're in business?

src/parser/__tests__/ArcanistDiffParserTestCase.php
559

This should just be .rcsdiff, not .rcs.diff.

src/parser/__tests__/diff/rcs-addline.rcsdiff
7–8

(It looks like these are spaces in the files, but tabs from rcsdiff.)

{F35917}Hi evan,
I created the diffs another time, just to be sure, I am getting diffs like this:

Regarding spaces and tabs in diff's, yes in original diff's there were tabs but lint was raising errors because of tab literal.

If you think Lint is just bossing you around... Ignore it. You have good reason to. It's just a machine executing some slow and bad code, he can never know better than you.
littlebutwow

Ok, Google's an exception. Listen to Google. It knows advise and wisdom. But still, it won't lint code for you.

Afaque_Hussain updated this revision.Mar 14 2013, 9:54 AM

Updating D5324: Parsing rcsdiff -u

Somehow got it to pass the test.{F35930}

That's quite hacky, I have to say. But it works.

And it was fun doing in a class when professor was teaching :P

epriestley accepted this revision.Mar 14 2013, 1:10 PM

greatest feature ever

epriestley closed this revision.Mar 14 2013, 1:12 PM

Closed by commit rARCe0702d17c26c (authored by @Afaque_Hussain, committed by @epriestley).

epriestley changed the visibility from "All Users" to "Public (No Login Required)".Fri, Nov 18, 10:48 PM