ECToo / xdelta

Automatically exported from code.google.com/p/xdelta
0 stars 0 forks source link

Forward and backward patches (enhancement) #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What is the posibility of creating the vcdiff files for two files for both 
directions at the same time, e.g. a forward patch and reverse patch at the 
same time, I guess it must be posible it is just how complicated is it to 
do. It would be the same as doing 

xdelta3.exe file1.exe -s file2.exe output1.vcdiff

and 

xelta3.exe file2.exe -s file1.exe output2.vcdiff

doing this in a single step would improve the performance in my case as I 
want to keep 2 copies of each of the source files one locally with reverse 
patches and one updated on a server located on the internet updated with 
the forward patch.

thanks

Original issue reported on code.google.com by a...@intralan.co.uk on 8 Jan 2008 at 5:57

GoogleCodeExporter commented 9 years ago
I am more interested in a utility to reverse a patch, given its source file.  
Then
you could run something like:

xdelta3.exe -s file1 file2 out2.vcdiff
xdelta3.exe reverse -s file1 out2.vcdiff out1.vcdiff

But first, I need to finish the "merge" command, which I'm working on.

Original comment by josh.mac...@gmail.com on 10 Jan 2008 at 2:51

GoogleCodeExporter commented 9 years ago
so let me understand this better, with your idea of reverse a single patch 
could 
roll a file forward or backward?, if this is the case and the merge command did 
what 
I expect there could be a single command to take a file forward or backward and 
many 
versions. Rather than having to process the file forward and then backward to 
create 
both patches and having to roll x patches forward or backward to make a 
specific 
revision of the file. Am I right?

Original comment by a...@intralan.co.uk on 10 Jan 2008 at 8:05

GoogleCodeExporter commented 9 years ago
Yes, correct.

Original comment by josh.mac...@gmail.com on 10 Jan 2008 at 8:37

GoogleCodeExporter commented 9 years ago
Hi Josh, the idea of being able to reverse a patch interests me too. Have you 
any 
idea when you might have this available? Is the diff structure such that 
everything 
can be reliably reversed (e.g. Insert n bytes at offset m -> remove n bytes at 
offset m) etc... or will additional info be required inside the diff file - if 
the 
file has got smaller, I assume you don't store the data that was removed in the 
diff 
file so addional info would be required in to go backwards?? I guess what I'm 
driving at is do you think it might work with existing diff files produced with 
an 
older version of xdelta? I suspect not.

Original comment by m...@cucku.com on 8 May 2008 at 12:55

GoogleCodeExporter commented 9 years ago
A reverse patching mechanism would be very helpful indeed.  I have an 
application by 
which I want to take a patch file and be able to use it to:  given A create B, 
or if 
given B, create A.

An excellent program btw, thanks for the time and effort you've put into this.

Original comment by joeainte...@gmail.com on 9 Jun 2008 at 9:13

GoogleCodeExporter commented 9 years ago
There seem to be several approaches:

1. Modify the software and file format to support bi-directional patches
2. Modify the software to support a "reverse" operation

#2 is easier.  You would compute the forward differences and then compute the
reverse.  It's not a single step and it's a little less efficient, but it's 
much more
flexible.

Computing the reverse would require the target file to be present.  I.e.,

xdelta3 -s SOURCE TARGET FORWARD.vcdiff
xdelta3 reverse -s TARGET FORWARD.vcdiff REVERSE.vcdiff

The code to compute the reverse operation would be useful for computing 
reversals in
a chain of deltas.  For example, if you have v1->v2, v2->v3 stored, and you 
would
like to prepare a v3->v1 difference file...

Original comment by josh.mac...@gmail.com on 11 Jun 2008 at 4:54

GoogleCodeExporter commented 9 years ago
Is there any progression?
I'm interesting in reversing xdelta patch.

Original comment by Rimidal...@gmail.com on 11 Jun 2010 at 7:10