[Pkg-libvirt-commits] [libguestfs] 06/31: ocaml: doc: add the version (if available) of APIs

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:13:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag upstream/1.29.46
in repository libguestfs.

commit db1b0bc5085cde09032e8783d28f22b7e502c233
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Thu May 28 15:41:41 2015 +0200

    ocaml: doc: add the version (if available) of APIs
    
    Make sure to not add more newline's than needed.
---
 generator/ocaml.ml | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/generator/ocaml.ml b/generator/ocaml.ml
index e7c6a1a..d2a4690 100644
--- a/generator/ocaml.ml
+++ b/generator/ocaml.ml
@@ -153,12 +153,23 @@ end
       generate_ocaml_prototype name style;
 
       if need_doc then (
+        let has_tags = ref false in
+
         pr "(** %s" shortdesc;
         (match deprecated_by with
          | None -> ()
          | Some replacement ->
-             pr "\n\n    @deprecated Use {!%s} instead\n" replacement
+             has_tags := true;
+             pr "\n\n    @deprecated Use {!%s} instead" replacement
+        );
+        (match version_added f with
+        | None -> ()
+        | Some version ->
+             has_tags := true;
+             pr "\n\n    @since %s" version
         );
+        if !has_tags then
+          pr "\n";
         pr " *)\n";
       );
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list