Module Apply_patch

val patch_prefix : string
val patch_suffix : string
val add_file_prefix : string
val delete_file_prefix : string
val update_file_prefix : string
val move_file_to_prefix : string
val end_of_file_prefix : string
val hunk_add_line_prefix : char
type action_kind =
  1. | Add
  2. | Delete
  3. | Update
type file_change = {
  1. kind : action_kind;
  2. old_text : string option;
  3. new_text : string option;
  4. move_path : string option;
}
type commit = {
  1. changes : file_change Core.String.Map.t;
}
type chunk = {
  1. mutable orig_index : int;
  2. del_lines : string list;
  3. ins_lines : string list;
}
type patch_action = {
  1. kind : action_kind;
  2. new_file : string option;
  3. chunks : chunk list;
  4. move_path : string option;
}
type patch = {
  1. actions : patch_action Core.String.Map.t;
}
exception Diff_error of string
module Canon : sig ... end
val slc : 'a list -> int -> int -> 'a list
val join : string list -> string
val find_context_core : lines:string list -> context:string list -> start:int -> int * int
val find_context : lines:string list -> context:string list -> start:int -> eof:bool -> int * int
val peek_next_section : string array -> idx0:int -> string list * chunk list * int * bool
module Parser : sig ... end
val text_to_patch : string -> string Core.String.Map.t -> patch * int
val identify_files_needed : Core.String.t -> Core.String.t Base.List.t
val identify_files_added : string -> string list
val list_slice : 'a list -> pos:int -> len:int -> 'a list
val updated_file_old : orig_text:string -> patch_action -> path:string -> string
val updated_file : orig_text:string -> patch_action -> path:string -> string
val patch_to_commit : patch -> string Core.String.Map.t -> commit
val load_files : Core.String.Map.Key.t list -> open_fn:(Core.String.Map.Key.t -> 'a) -> 'a Core.String.Map.t
val apply_commit : commit -> write_fn:(Core.String.Map.Key.t -> string -> Base.Unit.t) -> remove_fn:(Core.String.Map.Key.t -> Base.Unit.t) -> Base.Unit.t
val process_patch : text:string -> open_fn:(string -> string) -> write_fn:(string -> string -> unit) -> remove_fn:(string -> unit) -> string