diff

Automatic conversion of specific binary files to text to compare (diff) in Mercurial

不想你离开。 提交于 2020-01-04 13:47:05
问题 I have several -small- binary files added in my Mercurial repository. The files are the "source" files of one of my development tools (report / form / class definitions). I made a program that dumps this binary files to a text file to allow easy diffs between them. Is there any way to tell Mercurial that certain file extensions need to run this conversion before running the diff program? Or I have to set my conversion program as the main diff tool and run the conversion -or not- and then run

How to optimize a recursive algorithm to not repeat itself?

雨燕双飞 提交于 2020-01-04 05:45:09
问题 After finding the difflib.SequenceMatcher class in Python's standard library to be unsuitable for my needs, a generic "diff"-ing module was written to solve a problem space. After having several months to think more about what it is doing, the recursive algorithm appears to be searching more than in needs to by re-searching the same areas in a sequence that a separate "search thread" may have also examined. The purpose of the diff module is to compute the difference and similarities between a

Diff-command: doesn't print lines that are different but still says the two files are different

邮差的信 提交于 2020-01-03 09:08:53
问题 I'm using the diff command to compare two text files. They need to be literally matched. So I use the diff: diff binary.out binary.expected (By the way, those files are NOT binary files. They are text file. I call them binary because that's the name of the project) and got Binary files binary.out and binary.expected differ When I use another diff tool, the smartest of all (AKA human), and there's really nothing different between the two files. Does anyone happen to know what's going on here?

tcl: capture output from “exec diff” which returned non-zero

若如初见. 提交于 2020-01-02 10:02:56
问题 I know it is common to use catch when executing commands that may return non-zero... but how can I get the output in that case? To be specific, I wish to do something like "catch {exec diff fileA fileB} ret". The files are different and ret value is 1. What I actaully need is the output of diff, the detailed differences. But I believe the "catch {exec ...} err" practice does not provide it, right? Can someone please suggest on this task? Is there tcl-builtin commands to do file diff? (I think

Are there java libraries to do a word-based diff?

六月ゝ 毕业季﹏ 提交于 2020-01-02 04:45:11
问题 I have two pieces of text. I would like to make a word-based diff between them (like whe unix utility wdiff does) but with more information in the output (I mean, the character's posizion where the added/delited word starts). I need to do this in Java, so a simple output of the differences (like wdiff ) doesn't suite for me: I would like to manipulate objects representing differences. 回答1: There's Diff,Match,Patch - available in Java, and a demo is avilable - it seems to do word differences.

SVN Diff: Why are some files marked as binary

落爺英雄遲暮 提交于 2020-01-02 00:53:13
问题 Directly related: svn diff: file marked as binary type (Per the comment on the answer) Why would my SVN client mark some files as binary? Specifically, .sql has prop svn:mime-type = application/octet-stream when using TortoiseSVN. I checked Right-click > Tortoise context menu > Settings > General > Subversion configuration file, and nothing is uncommented in [miscellany] or [auto-props] , so where is the decision coming from? From what I can see in the related posts, I can "fix it" by either

Diffing Binary Files In Python

徘徊边缘 提交于 2020-01-01 18:21:28
问题 I've got two binary files. They look something like this, but the data is more random: File A: FF FF FF FF 00 00 00 00 FF FF 44 43 42 41 FF FF ... File B: 41 42 43 44 00 00 00 00 44 43 42 41 40 39 38 37 ... What I'd like is to call something like: >>> someDiffLib.diff(file_a_data, file_b_data) And receive something like: [Match(pos=4, length=4)] Indicating that in both files the bytes at position 4 are the same for 4 bytes. The sequence 44 43 42 41 would not match because they're not in the

Diffing Binary Files In Python

孤街浪徒 提交于 2020-01-01 18:20:34
问题 I've got two binary files. They look something like this, but the data is more random: File A: FF FF FF FF 00 00 00 00 FF FF 44 43 42 41 FF FF ... File B: 41 42 43 44 00 00 00 00 44 43 42 41 40 39 38 37 ... What I'd like is to call something like: >>> someDiffLib.diff(file_a_data, file_b_data) And receive something like: [Match(pos=4, length=4)] Indicating that in both files the bytes at position 4 are the same for 4 bytes. The sequence 44 43 42 41 would not match because they're not in the

ClearCase: how to generate a patch (unified diff) file from an activity?

梦想的初衷 提交于 2020-01-01 16:50:50
问题 Is it possible to generate an patch file from the changeset of a UCM Activity in ClearCase? I can generate the list of changes this way: cleartool lsactivity -l activity:my_activity_name 回答1: The main approach is list all the files within an activity, and use cleartool diff -pred -diff_format in order to generate a diff. With the -diff_format option, you would get headers and differences in the same style as the UNIX and Linux diff utility. But that would require some scripting, as I

postgres diff tool [closed]

Deadly 提交于 2020-01-01 12:25:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 months ago . Can anyone recommend a good UI driven diff tool (schema and data) for comparing Postgres databases? Preferable something that runs on Windows as well. Thanks. 回答1: Take a look at the relevant section of the Postgres' "Software Catalogue" and also search the projects in pgFoundry. 来源: https://stackoverflow.com