123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200(*******************************************************************************)(* Volgo - a Versatile OCaml Library for Git Operations *)(* Copyright (C) 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* *)(* This file is part of Volgo. *)(* *)(* Volgo is free software; you can redistribute it and/or modify it under *)(* the terms of the GNU Lesser General Public License as published by the *)(* Free Software Foundation either version 3 of the License, or any later *)(* version, with the LGPL-3.0 Linking Exception. *)(* *)(* Volgo is distributed in the hope that it will be useful, but WITHOUT ANY *)(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *)(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *)(* the file `NOTICE.md` at the root of this repository for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* and the LGPL-3.0 Linking Exception along with this library. If not, see *)(* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *)(*******************************************************************************)moduleTop=structmoduleGit=GitmoduleHg=Hgendopen!ImportmoduleAdd=Trait_addmoduleBranch=Trait_branchmoduleCommit=Trait_commitmoduleConfig=Trait_configmoduleCurrent_branch=Trait_current_branchmoduleCurrent_revision=Trait_current_revisionmoduleFile_system=Trait_file_systemmoduleGit=Trait_gitmoduleHg=Trait_hgmoduleInit=Trait_initmoduleLog=Trait_logmoduleLs_files=Trait_ls_filesmoduleName_status=Trait_name_statusmoduleNum_status=Trait_num_statusmoduleRefs=Trait_refsmoduleShow=Trait_showclasstypeadd=Add.tclasstypebranch=Branch.tclasstypecommit=Commit.tclasstypeconfig=Config.tclasstypecurrent_branch=Current_branch.tclasstypecurrent_revision=Current_revision.tclasstypefile_system=File_system.tclasstypegit=Git.tclasstypehg=Hg.tclasstypeinit=Init.tclasstypelog=Log.tclasstypels_files=Ls_files.tclasstypename_status=Name_status.tclasstypenum_status=Num_status.tclasstyperefs=Refs.tclasstypeshow=Show.tclasstypet=objectinheritaddinheritbranchinheritcommitinheritconfiginheritcurrent_branchinheritcurrent_revisioninheritfile_systeminheritgitinherithginheritinitinheritloginheritls_filesinheritname_statusinheritnum_statusinheritrefsinheritshowendclassunimplemented:t=(* When used through the vcs interface, the context for each method is already
part of the full error trace. This includes the [repo_root] and/or whatever
useful arguments for each of the methods in the error messages. We do not
want to include them here too, as they would simply be printed twice. *)letunimplemented~trait~method_=Error(Err.createPp.O.[Pp.text"Trait "++Pp_tty.id(moduleString)trait++Pp.text" method "++Pp_tty.id(moduleString)method_++Pp.text" is not available in this repository."])inobject(* add *)methodadd~repo_root:_~path:_=unimplemented~trait:"Vcs.Trait.add"~method_:"add"(* branch *)methodrename_current_branch~repo_root:_~to_:_=unimplemented~trait:"Vcs.Trait.branch"~method_:"rename_current_branch"(* commit *)methodcommit~repo_root:_~commit_message:_=unimplemented~trait:"Vcs.Trait.commit"~method_:"commit"(* config *)methodset_user_name~repo_root:_~user_name:_=unimplemented~trait:"Vcs.Trait.config"~method_:"set_user_name"methodset_user_email~repo_root:_~user_email:_=unimplemented~trait:"Vcs.Trait.config"~method_:"set_user_email"(* current_branch *)methodcurrent_branch~repo_root:_=unimplemented~trait:"Vcs.Trait.current_branch"~method_:"current_branch"(* current_revision *)methodcurrent_revision~repo_root:_=unimplemented~trait:"Vcs.Trait.current_revision"~method_:"current_revision"(* file_system *)methodload_file~path:_=unimplemented~trait:"Vcs.Trait.file_system"~method_:"load_file"methodsave_file?perms:_()~path:_~file_contents:_=unimplemented~trait:"Vcs.Trait.file_system"~method_:"save_file"methodread_dir~dir:_=unimplemented~trait:"Vcs.Trait.file_system"~method_:"read_dir"(* git *)methodgit:'a.?env:stringarray->unit->cwd:Absolute_path.t->args:stringlist->f:(Top.Git.Output.t->('a,Err.t)Result.t)->('a,Err.t)Result.t=fun?env:_()~cwd:_~args:_~f:_->unimplemented~trait:"Vcs.Trait.git"~method_:"git"(* hg *)methodhg:'a.?env:stringarray->unit->cwd:Absolute_path.t->args:stringlist->f:(Top.Hg.Output.t->('a,Err.t)Result.t)->('a,Err.t)Result.t=fun?env:_()~cwd:_~args:_~f:_->unimplemented~trait:"Vcs.Trait.hg"~method_:"hg"(* init *)methodinit~path:_=unimplemented~trait:"Vcs.Trait.init"~method_:"init"(* log *)methodget_log_lines~repo_root:_=unimplemented~trait:"Vcs.Trait.log"~method_:"get_log_lines"(* ls_files *)methodls_files~repo_root:_~below:_=unimplemented~trait:"Vcs.Trait.ls_files"~method_:"ls_files"(* name_status *)methodname_status~repo_root:_~changed:_=unimplemented~trait:"Vcs.Trait.name_status"~method_:"name_status"(* num_status *)methodnum_status~repo_root:_~changed:_=unimplemented~trait:"Vcs.Trait.num_status"~method_:"num_status"(* refs *)methodget_refs_lines~repo_root:_=unimplemented~trait:"Vcs.Trait.refs"~method_:"get_refs_lines"(* show *)methodshow_file_at_rev~repo_root:_~rev:_~path:_=unimplemented~trait:"Vcs.Trait.show"~method_:"show_file_at_rev"end