My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 62: Forward and backward patches (enhancement)
3 people starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  josh.macdonald
Type-Enhancement
Priority-Medium


Sign in to add a comment
 
Reported by a...@intralan.co.uk, Jan 08, 2008
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


 
Comment 1 by josh.macdonald, Jan 09, 2008
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.
Status: Accepted
Labels: -Type-Defect Type-Enhancement
Comment 2 by a...@intralan.co.uk, Jan 10, 2008
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?


 
Comment 3 by josh.macdonald, Jan 10, 2008
Yes, correct.
Comment 4 by m...@cucku.com, May 08, 2008
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.
Comment 5 by joeaintexas, Jun 09, 2008
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.
Comment 6 by josh.macdonald, Jun 10, 2008
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...

Owner: josh.macdonald
Sign in to add a comment

Hosted by Google Code