List Info

Thread: Supporting XML rather than line-based diffs/patches




Supporting XML rather than line-based diffs/patches
user name
2007-09-17 13:46:07
I'm looking for version control system which I can adapt to store and retrieve XML diffs (as opposed to line-based diffs).  We've already written code to produce and apply the XML diffs so we're looking for a version control system which can be easily modified to use our external programs for diff & patch.

This academic paper by Ronnau, Scheffczyk, & Borghoff describes modifying darcs 1.0.4 to support xydiff (an external XML diff and patching program).  They said they chose darcs because of its "abstract data type for deltas which reduces implementation efforts (they needed to change less than 100 lines of code within 10 darcs Haskell modules)."  I've sent them an email...anyone on this mailing list work with those researchers?

Any pointers on how to approach this problem (e.g. which modules control the diff/patch, major difficulties, etc)?

Thanks,
   Rocky Kahn
 ;  rocky at teampatent dot com
Re: Supporting XML rather than line-based diffs/patches
user name
2007-09-18 15:07:25
Hi Rocky,

> Any pointers on how to approach this problem (e.g.
which modules
> control the diff/patch, major difficulties, etc)?

Short answer
------------
Here are some files which you would probably want to start
with
    # core stuff
    src/Darcs/Patch/Core.lhs
    src/Darcs/Diff.lhs
    src/Darcs/Patch/Commute.lhs

    # reading and writing patches
    src/Darcs/Patch/Read.lhs
    src/Darcs/Patch/Show.lhs

    # user interface
    src/Darcs/Repository/Prefs.lhs
    src/Darcs/Repository/Format.lhs

This is off the darcs-unstable repo;
   darcs get http://darcs.net/repo
s/unstable

Long answer
-----------
You might be pleased to note that the darcs is already
designed around
the idea that there are different kinds of patches, so the
underlying
framework you will need to make this work is already in
place.  Here are
the basic patch types that darcs uses now:
  - remove file
  - add file
  - remove dir
  - add dir
  - move file/dir
  - modify binary file
  - add/remove hunk (line based diff)
  - replace token (replace all 'foo' in a given file by
'bar'

Extending darcs essentially consists of
  1. defining the new patch type (Darcs.Patch.Core)
  2. extending the diff algorithm (Darcs.Diff)
  3. specifying how this patch should interact with other
patches (Darcs.Patch.Commute)
The underlying patch algebra takes care of the rest,
ensuring that
merging and conflict resolution happen nicely.

If you are interested, some other new patch types have also
been
proposed: 'unindent/indent' patches http://bugs.darcs.net/
issue311 ,
character-based diffs (as opposed to line-based ones), and
text
displacement patches (for moving blocks of code around). 
Sadly, there
is nobody to work on them yet.

Hope this helps! If not, I hope David can give you a more
official
answer.

-- 
Eric Kow                     http://www.loria.fr/~kow

PGP Key ID: 08AC04F9         Merci de corriger mon
français.

_______________________________________________
darcs-users mailing list
darcs-usersdarcs.net

http://lists.osuosl.org/mailman/listinfo/darcs-users

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )