Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nahomy/diffoscope
  • reproducible-builds/diffoscope
  • eighthave/diffoscope
  • justinkb-guest/diffoscope
  • xavierbriand-guest/diffoscope
  • mattia/diffoscope
  • gaviriar-guest/diffoscope
  • amurzeau/diffoscope
  • marmarek/diffoscope
  • wjt/diffoscope
  • mgedmin/diffoscope
  • aparcar-guest/diffoscope
  • chabala/diffoscope
  • jelle/diffoscope
  • ygy/diffoscope
  • grahamc-guest/diffoscope
  • emaste-guest/diffoscope
  • bradfordboyle/diffoscope
  • kerlyn-guest/diffoscope
  • aarushi-guest/diffoscope
  • weatherwaxed-guest/diffoscope
  • vagishagupta23-guest/diffoscope
  • soumya-guest/diffoscope
  • m-boselli-guest/diffoscope
  • Vibhu-guest/diffoscope
  • akanksham-guest/diffoscope
  • JPEWhacker-guest/diffoscope
  • mikeroyal-guest/diffoscope
  • marc-guest/diffoscope
  • lamby/diffoscope
  • pabs/diffoscope
  • sangy-guest/diffoscope
  • dr_rtx/diffoscope
  • danielfullmer/diffoscope
  • FrazerClews/diffoscope
  • xXxrAinZyian/diffoscope
  • jelmer/diffoscope
  • ratschance/diffoscope
  • jimis/diffoscope
  • rclobus-guest/diffoscope
  • jgart/diffoscope
  • zach.welch.timesys/diffoscope
  • SmileyKeith/diffoscope
  • rbalint/diffoscope
  • zbyszek-guest/diffoscope
  • benjaminp/diffoscope
  • JRomain/diffoscope
  • trofi/diffoscope
  • blmaier-col/diffoscope
  • spillner/diffoscope
  • primeos-guest/diffoscope
  • qyliss/diffoscope
  • obfusk/diffoscope
  • cbaines-guest/diffoscope
  • thesamesam/diffoscope
  • AkihiroSuda/diffoscope
  • efraim-guest/diffoscope
  • dkg/diffoscope
  • Raviu/diffoscope
  • tchx84/diffoscope
  • fridtjof/diffoscope
  • felixonmars/diffoscope
  • ernstki/diffoscope
  • sethmlarson/diffoscope
  • Vekhir2/diffoscope
  • amarshall/diffoscope
66 results
Show changes
Commits on Source (2)
......@@ -120,8 +120,10 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
"has_same_content_as returned True; skipping further comparisons"
)
return None
if diff_content_only:
return None
elif diff_content_only:
return Difference(file1.name, file2.name, comment="Files differ")
......@@ -137,10 +139,11 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
and (not file1.is_directory() and not file2.is_directory())
):
return file1.compare_bytes(file2, source)
with profile("compare_files (cumulative)", file1):
if file2.is_directory():
difference = file2.compare(file1, source)
if difference is not None:
if isinstance(difference, Difference):
difference = difference.get_reverse()
return difference
return file1.compare(file2, source)
......@@ -169,6 +172,7 @@ def compare_binary_files(file1, file2, source=None):
try:
if source is None:
source = [file1.name, file2.name]
return Difference.from_operation(
Xxd,
file1.path,
......@@ -189,9 +193,11 @@ def compare_binary_files(file1, file2, source=None):
def hexdump_fallback(path):
hexdump = io.StringIO()
with open(path, "rb") as f:
for buf in iter(lambda: f.read(32), b""):
hexdump.write(
"{}\n".format(binascii.hexlify(buf).decode("us-ascii"))
)
return hexdump.getvalue()