Skip to content

the behavior of compare and patch file of the same? #7

Description

@fwang2

If two files are the same content, applying the following procedure will fail ... diff mytest.1.txt and mytest3.txt will differ. Is this the intended behavior, or am I missing something.

#!/usr/bin/python

import librsync

with open("mytest1.txt", "wb") as f:
    f.write("hello world\n")

with open("mytest2.txt", "wb") as f:
    f.write("hello world\n")

with file("mytest1.txt", "rb") as src, file("mytest2.txt", "rb") as dest, \
    file("mytest3.txt", "wb") as patched:

    signature = librsync.signature(dest)
    delta = librsync.delta(src, signature)
    librsync.patch(dest, delta, patched)

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