Page MenuHomePhabricator

Parsing rcsdiff -u
ClosedPublic

Authored by Afaque_Hussain on Mar 11 2013, 7:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 1:47 PM
Unknown Object (File)
Fri, Apr 12, 11:47 AM
Unknown Object (File)
Fri, Apr 12, 11:47 AM
Unknown Object (File)
Fri, Apr 12, 11:47 AM
Unknown Object (File)
Fri, Apr 12, 11:47 AM
Unknown Object (File)
Fri, Apr 12, 10:56 AM
Unknown Object (File)
Thu, Apr 11, 10:30 AM
Unknown Object (File)
Feb 7 2024, 8:43 AM

Details

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

Branch
rcsDiffSamples
Lint
Lint Passed
Unit
Tests Passed

Event Timeline

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 to Unknown Object (????).Mar 13 2013, 7:19 PM

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

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

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 to Unknown Object (????).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 changed the visibility from "All Users" to "Public (No Login Required)".