Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Parse error happened when using UnifiedDiffReader.parseUnifiedDiff #85

Closed
@HuGanghui

Description

@HuGanghui

Describe the bug
Parse error happened when using UnifiedDiffReader.parseUnifiedDiff to parse a Hg Diff Patch file.

To Reproduce
Steps to reproduce the behavior:

  1. Example data
  2. simple programm snippet
  3. See error

here is the Hg Diff Patch file:

# HG changeset patch# User Anton Shestakov <av6@dwimlabs.net># Date 1591442367 -28800# Node ID a4438263b228dd3e2983d59095c6180b1411f0e8# Parent  83e41b73d115e3717943c2e5a83d36d05670384ctests: skip pyflakes for mercurial/thirdparty/The current version of pyflakes (2.2.0) correctly detects one issue:  mercurial/thirdparty/selectors2.py:335:40 '...'.format(...) has unused arguments at position(s): 1But we're not interested in fixing lint errors in third-party code, so we needto exclude at least selectors2.py. And in the discussion for this patch it wasdecided to just skip the entire thirdparty directory.Differential Revision: https://phab.mercurial-scm.org/D8619diff -r 83e41b73d115 -r a4438263b228 tests/test-check-pyflakes.t--- a/tests/test-check-pyflakes.tTue Jun 09 17:13:26 2020 -0400+++ b/tests/test-check-pyflakes.tSat Jun 06 19:19:27 2020 +0800@@ -16,9 +16,7 @@   $ testrepohg locate 'set:**.py or grep("^#!.*python")' \   > -X hgext/fsmonitor/pywatchman \   > -X mercurial/pycompat.py -X contrib/python-zstandard \-  > -X mercurial/thirdparty/cbor \-  > -X mercurial/thirdparty/concurrent \-  > -X mercurial/thirdparty/zope \+  > -X mercurial/thirdparty \   > 2>/dev/null \   > | xargs $PYTHON -m pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"   contrib/perf.py:*:* undefined name 'xrange' (glob) (?)

when I run the following codes error happened:

publicvoidtestHgDiffPatch()throwsException {finalUnifiedDiffdiff =getUnifiedDiff("PatchFileFromDiffTools/HGDiffPatch.txt");assertEquals(1,diff.getFiles().size());finalUnifiedDiffFilefile1 =diff.getFiles().get(0);assertEquals("diff -r 83e41b73d115 -r a4438263b228 tests/test-check-pyflakes.t",file1.getDiffCommand());assertEquals("tests/test-check-pyflakes.t",file1.getFromFile());assertEquals("tests/test-check-pyflakes.t",file1.getToFile());assertEquals(1,file1.getPatch().getDeltas().size());assertNull(diff.getTail());    }

error information is here:

org.junit.ComparisonFailure: Expected :tests/test-check-pyflakes.tActual   :tests/test-check-pyflakes.tTue Jun 09 17:13:26 2020 -0400

Expected behavior
A clear and concise description of what you expected to happen.

I hope to parse this file correctly.

System

  • Java version 1.8
  • Version [e.g. 22]
    Maven plugin
<groupId>io.github.java-diff-utils</groupId><artifactId>java-diff-utils</artifactId><version>4.5</version>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp