package conex

  1. Overview
  2. Docs

Module Conex_diffSource

Diff: decode patch files into hunks.

Sourcetype hunk

A hunk.

Sourcetype t = {
  1. mine_name : string;
  2. their_name : string;
  3. hunks : hunk list;
}

A diff is a list of hunks, and a filename (mine and their are different for file addition and removal, otherwise they should be equal.

Sourceval file : t -> string

file diff is mine_name unless this is "/dev/null", in which case their_name is used. A potentially leading "a/" or "b/" is stripped from mine/their.

Sourceval to_diffs : string -> t list

to_diffs str decodes the given patch into a list of diff.

Sourceval ids : string -> Conex_utils.path -> t list -> (bool * Conex_utils.S.t, string) result

ids rootname keydir diffs returns whether the root file was changed, and the set of modified ids.

Sourceval patch : string option -> t -> string

patch data diff is data', which is the result of applying diff to data.